Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR1000 & Fastrack AT+COPS=?


CEBTP Mar 12, 2014 09:49 AM

Hi,

I've got a CR1000(27) and a modem fastrack, I' writing a program to test and choose the best network service available.

I see in the AT command AT+COPS=?
I try it in hyperterminal mode OK but does'nt work on a CR1000

Public StringResult(2) As String
...
SerialOpen (COMRS232,9600,3,10000,100)
SerialOut (COMRS232,"AT+COPS=?"+CHR(13),"",0,100)
SerialIn (StringResult(1),COMRS232,100,0,200)
SerialIn (StringResult(2),COMRS232,100,0,200)
...

In snifer mode, it seems not working at all
Or AT+COPS? answer correctly even AT+CFUN=1

maybe "=?" isn't recognize or AT+COPS=? but why ?


EarlyBird Mar 12, 2014 10:59 AM

You are concatenating two strings in this instruction

SerialOut (COMRS232,"AT+COPS=?"+CHR(13),"",0,100)

I would use & to do this.

SerialOut (COMRS232,"AT+COPS=?" & CHR(13),"",0,100) as advised in the CRBasic manual.


CEBTP Mar 12, 2014 12:57 PM

I try with a "&" still doesn't working...

(Untill COPS=?, all my programs with some AT commande made with "+" instead "&" and work correctly

"At+CFUN=1"+CHAR(13) // "AT+COPS?"+CHAR(13)

I will try in my future program to put "&", TY.

Edit : I put SerialOut "At+CFUN=1" & CHAR(13) I receive a message with the text and reset software of modem not done...

* Last updated by: CEBTP on 3/14/2014 @ 7:41 AM *


EarlyBird Mar 12, 2014 03:06 PM

Quote from modem a manual

Note: since with this command a network scan is done, this command may require some seconds before the output is given.

Could be 30 seconds from sending the AT+COPS=? to getting a response.

Could this be the issue?


CEBTP Mar 13, 2014 01:35 PM

>_<

I was thinking the same thing this morning,
SerialIn (StringResult(1),COMRS232,1000,CHR(44),200)
Increase to 1000 instead 100, and I can catch the answer.

TY.

* Last updated by: CEBTP on 3/14/2014 @ 4:24 AM *


CEBTP Mar 14, 2014 11:06 AM

Bored...

At+COPS=?
Answer is : +COPs: (2,'Bouygtel","Bouygtel","20820"),(3,"ORANGE F","Orange","20801"),(0,"F SFR","SFR","20810") wich may change from locality

I would like to catch the entire line and make search string 20820/20801/20810 true/false for each, seems no possible ?

First SerialIn receive At+cops=? OK
Second SerialIn the first 21character +COPS: (2,"Bouygtel",
Third SerialIn the next 21 character
...

SerialIn syntax (Dest "ok",ComPort"Ok",TimeOut"Nok try some change nothing", TerminationChar "Work only on the 21 character sequence of each ??? what is the using prefer to STOP at each ")" doesn't work",MaxNumChars"only in the range of 21")...

>_<


CEBTP Mar 19, 2014 10:47 AM

I finally found but I don't like my code...

SerialOpen (MDMPORT,9600,3,10000,100)
SerialOut (MDMPORT,"AT+COPS=?" + CHR(13),"",0,100) 'AT command
Do
'Read buffer
SerialIn (StringResult,MDMPORT,1000,41,1000)

'Search Any OK to close the loop
SplitStr (SearchString(1),StringResult,"OK",1,2)

'search numerical between CHR44 "," and CHR41 ")"
SplitStr (SearchString(2),StringResult,",",1,10)
If SearchString(2)=20810 Then SFR=1
If SearchString(2)=20801 Then Orange=1
If SearchString(2)=20820 Then Bouygue=1

'Till Ok end of message
Loop Until SearchString(1)="OK"

* Last updated by: CEBTP on 3/20/2014 @ 8:29 AM *

Log in or register to post/reply in the forum.