Please help me understand. I just updated a several years old system with a new RUT901 running firmare 7.15, and I notice that I cannot handle SMS any more since the POST/GET method has been removed.
I have read some documentation here and I see that the manufacturer recommends the use of the API to handle SMS.
As far as I understand, the APIs are for writing new (or modified) firmwares for the RUT901 itself. So do I need to write extra code to be added to the RUT901 firmware, just to translate TCP messages that other nodes of the LAN are sending to the modem, to send and receive SMS?
I may have misunderstood, but please help me find a solution so that the other nodes of my system, that are connected to the LAN, can send and receive SMS just by exchanging TCP frames with the RUT901.
Thanks for your help.
Please read https://developers.teltonika-networks.com/, you don’t have to install or modify any firmware.
Hello,
Starting from firmware 00.07.14.0, the POST/GET services were completely withdrawn. You can find more details on this change here:
As an alternative to sending an SMS message, you can utilize the API requests, as you’ve mentioned yourself. More information specifically on sending SMS messages can be found here: https://developers.teltonika-networks.com/reference/trb500/7.14.3/v1.6.3/messages#post-messages-actions-send
If you have any additional questions or need assistance, feel free to reach out.
Best regards,
I tried to send Curl command as given in the application note. I have thus produced the following command:
curl -X POST “https://192.168.17.1/api/login” -H “Content-Type: application/json” -d ‘{“username”: “admin”, “password”: “mypassword”}’ -k
I submit this command to the command window of windows 11, but I receive the following reply :
{“success”:false,“errors”:[{“source”:“JSON body”,“code”:122,“error”:“unexpected end of data”}]}curl: (3) URL rejected: Bad hostname
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
curl: (3) unmatched close brace/bracket in URL position 11:
mypassword}’
^
What did I wrong?
Good afternoon,
An example of a command should look like this :
curl -k -X POST “https://192.168.1.1/api/sms/send” ^
-H “Content-Type: application/json” ^
-H “X-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…” ^
-d “{"number":"+491701234567","text":"Hello from RUT901"}”
Replace:
eyJhbGciOi… → with the token you received
+491701234567 → recipient phone number
“Hello from RUT901” → your message
Looking into your sent commands, it seems that you should :
Use only straight double quotes ("), not curly quotes (“ ”)
In Windows CMD, use ^ to break long lines.
Regards,
Arturas
As my previous message states it, I did not even receive a token. What was wrong with my attempt?
Hi there,
As advised above:
Use only straight double quotes (") , not curly quotes (“ ” )
In Windows CMD, use ^ to break long lines.
These instructions are not being followed in your command.
Regards,
My command was:
curl -X POST "http://192.168.17.1/api/login" -H "Content-Type: application/json" -d '{"username": "admin", "password": "**********"}' -k
The response is:
{"success":false,"errors":[{"source":"JSON body","code":122,"error":"unexpected end of data"}]}curl: (3) URL rejected: Bad hostname
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
curl: (3) unmatched close brace/bracket in URL position 11:
**********}'
(the stars were the actual password in the experiment)
The response is:
I have always used only straight double quotes, but in my previous messages I forgot to use the non-formatted text option.
And there is still something wrong. Please help.
Hi there,
Instead of using Curl commands, I would recommend to use API post command.
api post ‘{“data”: {“number”: “PhoneNumber”,“message”: “YourMessage”,“modem”: “TheModemToUse”}}’
Modem can be checked by heading to WebUI → Services → Mobile Utilities → Messages → Send messages , press F12 on your WebBrowser, go to your Network tab in the developer console, and send an sms. Under the “Payload” tab you will see the modem being used to send an SMS message.
Regards,
Arturas
Thanks for this advice. Actually, I used to send TCP messages from an arduino-like board, using the Ethernet library. So I cannot afford a complex processing to build the TCP command. What would the TCP command look like, to tell the RUT901 to send a SMS to some number?
Hi there,
Possible ways to send SMS messages from our devices:
- Through WEBUI.
- Through API.
- Curl commands (Api also)
- AT commands
- Certain services that can send SMS messages f.e. Events reporting.
If you are looking for an alternative way to send text messages, you would need to write a custom script, which is out of the scope of our assistance.
Regards,
Arturas
If I understand well, there are several methods to send sms by sending TCP frames to the RUT901, but ALL require the use of encryption (SSH). This is beyond of the capabilities of an arduino board (even though I am using a STM32 variant). Is there a way to configure the RUT901 to dismiss the need for encryption, and use Telnet for example? My LAN is strictly local, the data are disabled in my SIM card and I do not have any security requirement.
Hi there,
These are the advised ways to send SMS messages.
Disabling any encryption is not recommended, and token based encryption/authentication is necessary.
Thank you for your understanding.
Regards,
Arturas
I am experimenting with python and I have been able to log in and get the modem identification token so far.
I am in trouble because you say:
An example of a command should look like this :
curl -k -X POST “https://192.168.1.1/api/sms/send” ^
but if I go to the programming reference here, they say that the url would be
https://192.168.1.1/api/messages/actions/send
Has there been a change? Since which firmware version?
Hi there,
This is not change, there are different methods how to send commands to device via API. In this question RMS API - keep getting "FORBIDDEN" / basic API setup help needed - #7 by Arturas we have a guide how to utilize API commands via postman, and that is the recommended method. Follow the instructions in the guide, and you should be able to successfully send API request to the device. I would recommend testing the above method, and please advise whether you unable to utilize this, or you don’t get expected values, as this method has been tested working.
Regards,
Arturas