I successfully upgraded my CR300 from OS 8.01 to OS 9.02. After that my CR300 program doesn't work.
The problem seems to be the Serial instructions in the subroutine "TestGSM" (reported below), because the execution of the Serial instructions do not return the expected results.
In particular the result of SerialOut instruction, "n" variable, remains always 0 (zero) and the destination variable "Risposta" of the SerialIn instruction, remains always empty.
The hardware configuration and cable connections are the same.
We have "sniffed" the RS-232 Comport by the Terminal emulator, and we verified that the serial communication works fine. Find below the text capture of the terminal emulator (both the command "At+CREG?" issued by the instruction SerialOut and the modem answer, are correct).
In the meanwhile I have downgraded my CR300 and I am working with the 8.01 OS.
Thank you for your attention,
Francesco Sabatini (National Research Council, Firenze, Italy)
Sub TestGSM 'Switch On Modem - Verify GSM Connectivity Public k As Long, n, Risposta As String k = 0 GSMstat = 0 SerialOpen (ModemPort,ModemBaudRate,0,0,100,0) SW12(1) Delay (1,15,Sec) SerialFlush (ModemPort) Do Delay (1,1,Sec) n = SerialOut (ModemPort,"AT+CREG?"&CrLf,"+CREG:",1,200) SerialIn (Risposta,ModemPort,100,"OK"&CrLf,100) SplitStr (CREG(),Risposta,",",2,0) k += 1 Loop Until GSMstat = 1 OR GSMstat = 5 OR k > maxGSMdelay SignalOK = (GSMstat = 1) OR (GSMstat = 5) If SignalOK Then SerialFlush (ModemPort) SerialOut (ModemPort,"AT+CSQ"&CrLf,"+CSQ:",1,200) SerialIn (Risposta,ModemPort,100,"OK"&CrLf,100) SplitStr (CSQ(),Risposta,",",2,0) EndIf SerialClose (ModemPort) Delay (1,2,Sec) EndSub
Capture by Terminal emulator on ComPort RS-232 (modem)
09:47:58.47 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:47:58.47 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:47:58.48 R 47 3A 20 30 2C 31 0D 0A 0D G: 0,1... 09:47:58.48 R 0A 4F 4B 0D 0A .OK.. 09:48:02.47 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:02.48 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:02.49 R 47 3A 20 30 2C 31 0D 0A 0D 0A G: 0,1.... 09:48:02.49 R 4F 4B 0D 0A OK.. 09:48:06.48 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:06.49 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:06.49 R 47 3A 20 30 G: 0 09:48:06.50 R 2C 31 0D 0A 0D 0A 4F 4B 0D 0A ,1....OK.. 09:48:10.49 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:10.50 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:10.50 R 47 3A 20 30 2C 31 0D 0A 0D 0A 4F 4B 0D 0A G: 0,1....OK.. 09:48:14.50 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:14.51 R 41 54 2B 43 52 45 47 3F AT+CREG? 09:48:14.51 R 0D 0D 0A 2B 43 52 45 47 3A 20 30 2C 31 0D 0A 0D ...+CREG: 0,1... 09:48:14.51 R 0A 4F 4B 0D 0A .OK.. 09:48:18.51 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:18.52 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 AT+CREG?....+CR 09:48:18.52 R 45 47 3A 20 30 2C 31 0D 0A 0D 0A 4F 4B 0D 0A EG: 0,1....OK.. 09:48:22.52 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:22.52 R 41 54 2B 43 52 45 47 3F 0D 0D 0A 2B 43 52 45 47 AT+CREG?...+CREG 09:48:22.53 R 3A 20 30 2C 31 0D 0A 0D 0A 4F : 0,1....O 09:48:22.53 R 4B 0D 0A K.. 09:48:26.52 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:26.53 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:26.53 R 47 3A 20 30 2C 31 0D 0A 0D 0A 4F 4B 0D 0A G: 0,1....OK.. 09:48:30.53 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:30.54 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:30.54 R 47 3A 20 30 2C 31 0D 0A 0D 0A 4F 4B 0D 0A G: 0,1....OK.. 09:48:34.54 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:34.55 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:34.55 R 47 3A 20 30 2C 31 0D 0A 0D 0A 4F 4B 0D 0A G: 0,1....OK.. 09:48:38.55 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:38.56 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:38.56 R 47 3A 20 30 2C 31 0D 0A 0D 0A 4F 4B 0D 0A G: 0,1....OK.. 09:48:42.55 T 41 54 2B 43 52 45 47 3F 0D 0A AT+CREG?.. 09:48:42.56 R 41 54 2B 43 52 45 47 3F 0D 0A 0D 0A 2B 43 52 45 AT+CREG?....+CRE 09:48:42.57 R 47 3A 20 30 2C 31 0D 0A 0D 0A G: 0,1.... 09:48:42.57 R 4F 4B 0D 0A OK..
Give this a try:
Do Delay (1,1,Sec) SerialFlush(ModemPort) n = SerialOut (ModemPort,"AT+CREG?"&CrLf,"",1,100) SerialIn (Risposta,ModemPort,200,13,100) SplitStr (CREG(),Risposta,",",2,0) k += 1 Loop Until GSMstat = 1 OR GSMstat = 5 OR k > maxGSMdelay
SerialOut will just wait for the echo. The CREG: in the response won't mess up SplitStr, because you are using option 0.
Dear Mr. JDavis, thank you for the prompt reply.
I have updated the Cr300 OS to version 9.02 again, then sent the program modified upon your suggestion.
Sub TestGSM 'Accende il modem e verifica se e' presente la connessione GSM Public k As Long, n, Risposta As String k = 0 GSMstat = 0 SerialOpen (ModemPort,ModemBaudRate,0,0,100,0) SW12(1) Delay (1,15,Sec) SerialFlush (ModemPort) Do Delay (1,1,Sec) SerialFlush(ModemPort) n = SerialOut (ModemPort,"AT+CREG?"&CrLf,"",1,100) ' Modifiche suggerite da J Davis - Forum Campbell Scientific SerialIn (Risposta,ModemPort,200,13,100) ' Modifiche suggerite da J Davis - Forum Campbell Scientific SplitStr (CREG(),Risposta,",",2,0) ' Modifiche suggerite da J Davis - Forum Campbell Scientific k += 1 Loop Until GSMstat = 1 OR GSMstat = 5 OR k > maxGSMdelay SignalOK = (GSMstat = 1) OR (GSMstat = 5)
Unfortunately the k factor reach the n. of attemps (120) and the program does nor execute the other instructions. The data transmission fails. I have recorded the communications over the Comport by the terminal emulator:
17:05:55.97 R 47 G 17:05:56.96 T 3F ? 17:05:57.69 R 3F ? 17:05:57.96 T 0D . 17:05:57.98 R 0D 0D 0A 2B 43 52 45 47 3A 20 30 2C 31 0D 0A 0D ...+CREG: 0,1... 17:05:57.98 R 0A 4F 4B 0D 0A .OK.. 17:05:58.97 T 0A . 17:05:59.70 R 0A . 17:06:02.98 T 41 A 17:06:03.48 R 41 A 17:06:03.98 T 54 T 17:06:04.04 R 54 T 17:06:04.98 T 2B + 17:06:05.37 R 2B + 17:06:05.99 T 43 C 17:06:06.31 R 43 C 17:06:06.99 T 52 R 17:06:07.05 R 52 R 17:06:08.00 T 45 E 17:06:08.19 R 45 E 17:06:09.00 T 47 G 17:06:09.14 R 47 G 17:06:10.00 T 3F ? 17:06:10.07 R 3F ? 17:06:11.01 T 0D . 17:06:11.02 R 0D 0D 0A 2B 43 52 45 47 3A 20 30 2C 31 0D 0A 0D ...+CREG: 0,1... 17:06:11.02 R 0A 4F 4B 0D 0A .OK.. 17:06:12.01 T 0A . 17:06:12.12 R 0A . 17:06:17.02 T 2B 2B 2B +++ 17:06:17.61 R 2B 2B 2B +++ 17:06:19.03 T 41 54 2B 43 46 55 4E 3D 34 0D AT+CFUN=4. 17:06:19.04 R 41 54 2B 43 46 55 4E 3D 34 0D 0D 0A 4F 4B 0D 0A AT+CFUN=4...OK..
The same program modified upon your suggestion works fine with the OS version 8_03
1:08:56.53 R 0D . 11:08:56.53 T 0A . 11:08:56.54 R 0D 0A 2B 43 52 45 47 3A 20 30 2C 31 0D 0A 0D 0A ..+CREG: 0,1.... 11:08:56.54 R 4F 4B 0D 0A OK.. 11:08:56.55 T 41 54 2B 43 53 51 0D 0A AT+CSQ.. 11:08:56.56 R 41 54 2B 43 53 51 0D AT+CSQ. 11:08:56.56 R 0A 0D 0A 2B 43 53 51 3A 20 31 33 2C 30 0D 0A 0D ...+CSQ: 13,0... 11:08:56.56 R 0A 4F 4B 0D 0A .OK.. 11:08:59.49 T 41 A 11:08:59.50 R 41 A 11:08:59.51 T 54 T 11:08:59.52 R 54 T 11:08:59.53 T 2B + 11:08:59.53 R 2B + 11:08:59.54 T 43 C 11:08:59.55 R 43 C 11:08:59.56 T 47 G 11:08:59.57 R 47 G 11:08:59.58 T 44 D 11:08:59.98 R 44 D 11:08:59.99 T 43 C 11:09:00.01 R 43 C 11:09:00.01 T 4F O 11:09:00.03 R 4F O 11:09:00.04 T 4E N 11:09:00.25 R 4E N 11:09:00.27 T 54 T 11:09:00.28 R 54 T 11:09:00.29 T 3D = 11:09:00.99 R 3D = 11:09:00.99 T 31 1 11:09:01.00 R 31 1 11:09:01.01 T 2C , 11:09:01.04 R 2C , 11:09:01.05 T 22 " 11:09:01.19 R 22 " 11:09:01.21 T 49 I 11:09:01.21 R 49 I 11:09:01.22 T 50 P 11:09:01.99 R 50 P 11:09:02.01 T 22 " 11:09:02.02 R 22 " 11:09:02.03 T 2C , 11:09:02.05 R 2C , 11:09:02.05 T 22 " 11:09:02.14 R 22 " 11:09:02.15 T 69 i 11:09:02.15 R 69 i 11:09:02.16 T 62 b 11:09:02.18 R 62 b 11:09:02.19 T 6F o 11:09:02.20 R 6F o 11:09:02.21 T 78 x 11:09:02.21 R 78 x 11:09:02.22 T 2E . 11:09:02.23 R 2E . 11:09:02.24 T 74 t 11:09:02.25 R 74 t 11:09:02.26 T 69 i 11:09:02.27 R 69 i 11:09:02.28 T 6D m 11:09:02.29 R 6D m 11:09:02.30 T 2E . 11:09:02.31 R 2E . 11:09:02.31 T 69 i 11:09:02.32 R 69 i 11:09:02.33 T 74 t 11:09:02.35 R 74 t 11:09:02.35 T 22 " 11:09:02.36 R 22 " 11:09:02.37 T 0D . 11:09:02.38 R 0D . 11:09:02.41 R 0D 0A 4F 4B 0D 0A ..OK.. 11:09:02.42 T 41 A 11:09:02.43 R 41 A 11:09:02.45 T 54 T 11:09:02.45 R 54 T 11:09:02.46 T 44 D 11:09:02.47 R 44 D 11:09:02.48 T 2A * 11:09:02.49 R 2A * 11:09:02.49 T 39 9 11:09:02.50 R 39 9 11:09:02.51 T 39 9 11:09:02.53 R 39 9 11:09:02.53 T 2A * 11:09:02.54 R 2A * 11:09:02.55 T 2A * 11:09:03.01 R 2A * 11:09:03.02 T 2A * 11:09:03.03 R 2A * 11:09:03.03 T 31 1 11:09:03.06 R 31 1 11:09:03.07 T 23 # 11:09:03.08 R 23 # 11:09:03.09 T 0D . 11:09:03.10 R 0D . 11:09:03.11 R 0D 0A 43 4F 4E 4E 45 43 54 0D 0A ..CONNECT..
I also use CR300 and just upgrade the OS from 9.02 to 10.01, and the PPP also seems behave differently....
I monitored the RS232 comm and sometimes it just stop at NO CARRIER.
I never have this issue with OS 9.02.
Can someone please show me where can I find the download link for the 9.02 OS?
I just want to roll back.
Thank you,
I can provide a copy if you can't get it from Campbell tech support directly.. just provide me an email and I can google drive share it