RUTX11 modbus SMS

Hello,
i have RUTX11 as modbus TCP client & a power recloser device as modbus server.
I’m polling power recloser measurements using modbus successfully from the RUTX11.
my question is:
can i send SMS message to the RUTX11 from my mobile to control the power recloser (TRIP/CLOSE), for example:
if i send “close”, it will trigger the modbus write command from the RUTX11 to the power recloser using configure modbus write command?

thanks in advance

Hello,

Yes, it should be possible to control your power recloser via Modbus by sending an SMS to the RUTX11. You can achieve this using the SMS Utilities feature. When an SMS with a specific text (e.g., “close”) is sent to the router, it can execute a custom script to write the required value to the Modbus register of the power recloser.

Here’s how you can set it up:

  1. Create a Custom SMS Rule:
  • Navigate to Services → Mobile Utilities → SMS Utilities.
  • In the Add Rule section:
    • For SMS Text, enter the desired keyword (e.g., close).
    • Select Action – Execute custom script.
    • Click Add.
  1. Enable the SMS Rule:
  • Enable the rule and for the Custom Script, you can use the following code as an example:
#!/bin/sh
sleep 1
ubus call modbus_client.rpc tcp.test '{"id":1,"timeout":5,"function":6,"first_reg":1,"reg_count":"777","data_type":"16bit_int_hi_first","no_brackets":0,"ip":"192.168.1.138","port":"502","delay":"1"}'
  1. Customize the Parameters:
  • Adjust the following fields in the script according to your requirements:
    • function: Modbus function code (e.g., 6 for setting a single holding register).
    • first_reg: The register number to write to.
    • reg_count: The value to be written to the register.
    • data_type: Data type (e.g., 16bit_int_hi_first for high byte first integer).
    • ip: Modbus server’s IP address (e.g., your power recloser).
  1. Save & Apply.

When you send the SMS with the specified text, the router will execute the script and send the Modbus write command to the power recloser.

If you need further assistance or have additional questions, feel free to ask.

Best regards,

2 Likes

Hello Martynas,
worked fine :slightly_smiling_face:
many thanks

Hello,

Great to hear it worked! :blush:

If you need further assistance, feel free to reach out.

Kind regard and happy holidays,

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