Error while Receive SMS via python "SMS Received: xxx: POWER OFF,Not executed"

Hello,

every time the modem receives a sms i get “Not executed” in Event Log.

Box “Send received SMS messages to the command interpreter” is ticked.
The python script is listed under “autorun commands”.

Any ideas?

SMS control is done by OS, try a command line instruction used on the “Execute command” window on web interface with a browser.


send an SMS to your modem containing the line below

modemstat ?


the command “reboot” reboots obviously,
“pppstat 1” will give the IP if the WWAN in on ppp 1
ect…

Consult the list of Command Line Instructions for commands

Ba5tian, what are you trying to do exactly?

If you want to have SMS control of the router using the same commands as telnet/ssh then all you need to do is add your mobile number to the list “Allow CLI commands from the following SMS numbers.”

under Configuration - Network > Interfaces > Mobile > SMS Settings

You can use wild cards here too.

If however you want to receive SMS in your python script then you need to add your number above but disable “Send received SMS messages to the command interpreter”.

Confirm your python script is running with “pycfg scripts” via SSH/Telnet and you can see if it is running.

One thing to note is that python will exit after you initialise the callback so you need to have a while true loop that just sleeps for 1 second. This will stop your python exiting.

I want to receive a sms by python.

The script is running, confirmed it with “pycfg scripts”.

I will try to disable “Send received SMS messages to the command interpreter”.

The script did function but not anymore and i can’t find the reason.
“while true loop” is used.

After adding the wildcard as mobile number under “Allow CLI commands from the following SMS numbers.” the script was executed.
Problem solved.