Hi,
I've been hunting through the forum & Youtube for a couple of weeks & seem to getting nowhere!
I have a 40X2, routing it throughan RS232 to a SIMCOM 5320E module, with a few LED's each step of the code to see what's going on. I'm positive I've got the circuit right (but of course I could be wrong!). I tried a few different codes based on stuff in the forums, & then I got the command set file, but with so many commands available that confused me even more! so I started again, stripped down with as basic a set of code I thought might work
Can anyone see any obvious code or commands I've missed?
I started with (excluding the LED sequencing)...
#Terminal 9600 ;watching actions on the PC screen
#No_Data
Symbol gsmTX = D.0
Symbol gsmRX = D.1
Symbol BAUD = T9600_8
high gsmTX ;SERIAL Tx - set the line to default High before using any AT+ commands
high D.2 ;LED indicator
pause 2000
setfreq M8
main:
pause 200
if pinD.3=1 then sendsms ;TRIGGER TO SEND SMS
goto main
sendsms:
pause 800
high gsmTX ;SERIAL Tx - set the line to default High before using any AT+ commands
pause 2000
setfreq M8
serout gsmTX, BAUD, ("AT+IPR=9600_8",CR) ;Baud rate (local) - default is 115200
serout gsmTX,BAUD,("AT+CMGF=1",CR) ;CMFG=Select SMS message format 1=text mode
pause 2000
serout gsmTX,BAUD,("AT+CSCA=",$22,"+61418706700",$22,CR) ;Telstra SMS Router number
pause 2000
serout gsmTX,BAUD,("AT+CMGS=",$22,"+61407xxxxxx",$22,CR) 'target cell phone
pause 2000
serout gsmTX,BAUD,("test message from modem",$1A)
pause 2000
goto main
...but I couldn't get anything to text, then I added one at a time what I thought might be pre-qualifyers befor the main: sub-routine....
serout gsmTX,BAUD,("AT",CR) : pause 200 ' Check if the modem is alive
serout gsmTX,BAUD,("AT+CREG?",CR) : pause 200 ' Returns 0,1 if the network is registered
serout gsmTX,BAUD,("AT+CSQ",CR) : pause 200 ' Check signal strength. 39 is the highest.
serout gsmTX,BAUD,("AT+CSMP=1,,0,0",CR) : pause 200 ' Set the modem in to plain text message mode
serout gsmTX,BAUD,("AT+CMGF=1",CR) : pause 200 ' Use ASCII encoded text messages
... but still nothing. Am I missing something obvious?
Any comments welcome
Thanks, Bryan.
I've been hunting through the forum & Youtube for a couple of weeks & seem to getting nowhere!
I have a 40X2, routing it throughan RS232 to a SIMCOM 5320E module, with a few LED's each step of the code to see what's going on. I'm positive I've got the circuit right (but of course I could be wrong!). I tried a few different codes based on stuff in the forums, & then I got the command set file, but with so many commands available that confused me even more! so I started again, stripped down with as basic a set of code I thought might work
Can anyone see any obvious code or commands I've missed?
I started with (excluding the LED sequencing)...
#Terminal 9600 ;watching actions on the PC screen
#No_Data
Symbol gsmTX = D.0
Symbol gsmRX = D.1
Symbol BAUD = T9600_8
high gsmTX ;SERIAL Tx - set the line to default High before using any AT+ commands
high D.2 ;LED indicator
pause 2000
setfreq M8
main:
pause 200
if pinD.3=1 then sendsms ;TRIGGER TO SEND SMS
goto main
sendsms:
pause 800
high gsmTX ;SERIAL Tx - set the line to default High before using any AT+ commands
pause 2000
setfreq M8
serout gsmTX, BAUD, ("AT+IPR=9600_8",CR) ;Baud rate (local) - default is 115200
serout gsmTX,BAUD,("AT+CMGF=1",CR) ;CMFG=Select SMS message format 1=text mode
pause 2000
serout gsmTX,BAUD,("AT+CSCA=",$22,"+61418706700",$22,CR) ;Telstra SMS Router number
pause 2000
serout gsmTX,BAUD,("AT+CMGS=",$22,"+61407xxxxxx",$22,CR) 'target cell phone
pause 2000
serout gsmTX,BAUD,("test message from modem",$1A)
pause 2000
goto main
...but I couldn't get anything to text, then I added one at a time what I thought might be pre-qualifyers befor the main: sub-routine....
serout gsmTX,BAUD,("AT",CR) : pause 200 ' Check if the modem is alive
serout gsmTX,BAUD,("AT+CREG?",CR) : pause 200 ' Returns 0,1 if the network is registered
serout gsmTX,BAUD,("AT+CSQ",CR) : pause 200 ' Check signal strength. 39 is the highest.
serout gsmTX,BAUD,("AT+CSMP=1,,0,0",CR) : pause 200 ' Set the modem in to plain text message mode
serout gsmTX,BAUD,("AT+CMGF=1",CR) : pause 200 ' Use ASCII encoded text messages
... but still nothing. Am I missing something obvious?
Any comments welcome
Thanks, Bryan.