We have a Flexy 201 using a GSM connection with an FLB 3202 card. Based on the instructions of the SMS reception with eWON post in the section labeled «Wake up» an eWON by SMS I can do the following
SMS reception with eWON
«Wake up» an eWON by SMS
A SMS can be used to «wake up» the eWON GSM/GPRS to establish a connection to the Internet. The script shown hereunder will send out a mail after the SMS reception.
The scheduled mail will then activate the outgoing connection to the Internet as configured in the Outgoing Connection settings of the eWON. (Contents example of of the received SMS = Connect).
The «LogEvent» function is used to track the action done by SMS.
InitSection: ONSMS "Goto HSms" HSms: a% = Getsys Prg,"SmsRead" If (a%<>0) Then f$ = Getsys Prg,"smsfrom" a$ = Getsys Prg,"smsmsg" If a$ = "Connect" Then Sendmail "MyMail@abc.be","","eWON Wake up by SMS","The eWON online IP address is: [$dtSV$seOnlineIpAddr]" LOGEVENT "eWON Wake up by SMS from GSM number: " + f$, 120 ENDIF Goto Hsms Endif End
I’ve Tried
What I’ve done is make some minor adjustments to the script from the post to accommodate in our environment. We’d like this functionality to work so if ever needed we can send a text to the SIM phone number try to wake up the GSM network for data connection, but it seems the GOTO
call label function errors out and I cannot figure it out.
Here’s what I’m using so tell me if you see anything incorrect with this configuration
-
I put the below code in the Init Section
ONSMS "GOTO SMSWake"
-
I created a new script section named SMSWake and put the below code in it
a% = Getsys Prg,"SmsRead" IF (a%<>0) THEN f$ = Getsys Prg,"smsfrom" a$ = Getsys Prg,"smsmsg" IF a$ = "Wake" THEN Sendmail "MyEmailAddress@gmail.com","","eWON Wake up by SMS","The eWON online IP address is: [$dtSV$seOnlineIpAddr]" LOGEVENT "eWON Wake up by SMS from GSM number: " + f$, 120 ENDIF GOTO SMSWake ENDIF END
-
Now all I do is send the phone number registered on the eWON’s GSM SIM card a text message with the word “Wake” and I can see it log an error when it runs stating “label/function not found (27) : GOTO SMSWake”
I’ve attached the entire program.bas file but from the eWON https download naming convention and I did remove my legit email address beforehand though. $dtPG.txt (2.7 KB)
Questions
-
What am I doing wrong here to make this logic not be able to find the SMSWake routine?
-
Based on the logic in the “SMSWake” routine, does the value “
Wake
” in the lineIF a$ = "wake" THEN
actually get the content of the text body that you send per theGetsys Prg,"SmsRead"
setting thea$
variable?- If I send a text message to the GSM SIM number with a different word (not “
Wake
”), it also triggers theONSMS
but the label call still fails so that’s why I ask
- If I send a text message to the GSM SIM number with a different word (not “
-
In the “SMSWake” routine where the line reads
GOTO SMSWake
just above the lastENDIF
, is that really what it’s supposed to do with theGOTO
?- I guess I figured the
ONSMS
triggers the call to the routine per that event it sees, so I wasn’t sure why theGOTO SMSWake
was there but I may be interpreting the code wrong since I’m a BASIC novice.
- I guess I figured the