Sending and receiving SMS with RUTOS 7.14

Continuing the discussion from Implementation of Read-Only System Files and Mobile and I/O POST/GET Service Removal with RutOS 7.14:

Hello,
Up to now I have used the POST/GET method and commands such as “sms_read”, “sms_send” to receive and send SMS from SCADA and PLC. How to implement this functionality with the new firmware?

Bets regards
Michal

Hello,

Thank you for your inquiry.

Please note that Mobile POST/GET services will be discontinued starting only from the RutOS 7.14 firmware release, which is planned for Q2 this year.

However, for now, you can still use Mobile POST/GET methods, but the service has been moved to Package Manager. If your device does not have it installed, you will need to install it from System → Package Manager by searching Mobile POST/GET.

Changes in RutOS 7.14

With RutOS 7.14, the Mobile POST/GET and I/O POST/GET services will be permanently removed from the firmware and will no longer be available in the Package Manager. Instead, users will be able to achieve the same functionalities using the device’s API, which provides a more secure and efficient way to interact with the system.


Sending and Reading SMS via API

For detailed API documentation on sending and reading SMS messages, please refer to this link: https://developers.teltonika-networks.com/reference/rutx50/7.13/v1.5/messages.

Depending on your used device, you can choose the device with FW by pressing on the field shown in the screenshot below:

Here is a command’s example on RUTX50 of how to send an SMS using the API via CLI:

api post /messages/actions/send '{"data": {"number": "+370XXXXXX", "message": "Hello", "modem": "2-1"} }'

The "modem" parameter is a unique modem ID number, which can be checked with the following command:

cat /etc/board.json | jsonfilter -e '@.modems[0].id'

A successful SMS send request should return a response like this:

{"http_body":{"success":true,"data":{"sms_used":1}},"http_code":200}

Please let me know if you have any additional questions or need further clarification.

Best regards,

Thanks for quick response
now it works!

best regards

If you want to delete all messages from the modem, it’s simpler if you install jq

/bin/opkg -e /etc/opkg/openwrt/distfeeds.conf install jq

Then

ids=$(api get /messages/status | jq -cr '.http_body.data | map(.id|tonumber)')
api post /messages/actions/remove_messages '{"data": {"modem_id": "3-1", "sms_id": '$ids'} }'

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.