I have purchased a RUT200. I was wondering if it would be possible to create some sort of script that I could SMS my unit and get it to send a TCP msg to another LAN card on the same network?
For example send an SMS that would read #qq and the IP address 192.168.1.155 and then the router sends the message to unit at .155
OR even just broadcast the #qq to all connected devices?
Thanks!
You can create a custom SMS rule to execute a script with arguments. Then, you can create a script itself that will take those arguments, process and format them the way you need, and then send them to your device.
For example, create the following /etc/yourscript.sh script:
And I named the script paulcmd.sh and when I run it in your CLI it works fine and my PCB responds just fine as follows:
root@Teltonika-RUT200:/etc# sh paulcmd.sh pp d qq t8 p9
BACK:pp d qq t8 p9
root@Teltonika-RUT200:/etc# sh paulcmd.sh pp d qq t8 p9
BACK:pp d qq t8 p9
root@Teltonika-RUT200:/etc# sh paulcmd.sh pp d qq t8 u88
BACK:pp d qq t8 u88
root@Teltonika-RUT200:/etc# sh paulcmd.sh a b c d
BACK:a b c d
BUT, when I send the SMS it seems like only the 1st SMS sent works. After that the 3 x 3g/4g lights flash on the RUT200 and I have to wait quite a while before they stop blinking and then I can send another SMS command again. Here is my SMS script code:
#!/bin/sh
sh /etc/paulcmd.sh "$@"
Also, when I try to read the list of received SMS’s on the SMS MESSAGES page, the page is blank/inaccessible until those three lights have stopped flashing.
So I have two questions:
Is this normal behaviour? Or am I doing things wrong?
Should I be having some sort of code after the sh /etc/paulcmd.sh “$@” to tell the unit stop executing this script?
HI Andzej
I tried looking at logs, and nothing really shows.
But, what I can definitely say, is that if I send the RUT200 a standard SMS, it receives as many as I send without any trouble.
But, the minute I send the SMS with the #cmd abc in it it reeives and acts on only the first sms and then the lights start flashing and one has to wait about two/three minutes where everything is blank on the SMS messages page. A popup occirs which says “Could not retrieve SMS’s” or something like that. Herewith the screen capture of the first SMS cmd sent, followed by a sccreen capture thereafter. As you can see the second image has no message info.
I found the problem. I did not have any SMS credit on the sim card! Apologies!
It seems somewhere there is a setting to SMS my number back when any data comes in from my PCB. Right now my PCB/MCU just echoes back whatever the unit sends it for testing purposes and the unit was hanging trying to send me an sms. Once I put credit on the sim card the unit worked fine every time.
Thanks for your help. I am going to try to find out where that rule is.
When executing the script via SMS message, the device always responds with an SMS that contains a status code. Currently, there is no way to disable this in the SMS utilities.