RUT951 send SMS ModBus register 396 hangs

I am debugging Ruby code running on a Raspberry Pi under Ubuntu to send an SMS message from an RUT951 using ModBus. Following the instructions on the web page at https://wiki.teltonika-networks.com/view/RUT951_Monitoring_via_Modbus is not usable because the Ruby code hangs in an infinite loop after writing a 1 to ModBus register 396 to initiate the send. As far as I can see using irb, the router does not respond to the query sent to it, so the Ruby code hangs in a loop waiting for a response.

How to reproduce:

  1. Write a telephone number and message text to ModBus registers 397 … 406 (I am doing this with a Ruby script, but it could be done with a modbus command as detailed in the above webpage (section Send SMS Message).

  2. Issue the command:

modbus write -D -p 502 192.168.1.1 %MW396 1

exactly as given in the webpage. This succeeds in sending the SMS, but it does not return to the command prompt. And the debug output shows only the Tx data:

Tx (15 bytes): [00][01][00][00][00][09][01][10][01][8c][00][01][02][00][01]

  1. After recovering from the hang with a few Cntl-Cs, trying a similar write to the next register works OK:

modbus write -D -p 502 192.168.1.1 %MW397 123

Tx (15 bytes): [00][01][00][00][00][09][01][10][01][8d][00][01][02][00][7b]
Rx (12 bytes): [00][01][00][00][00][06][01][10][01][8d][00][01]

So, it seems to me that the write to register 396 fails to respond with an echo of the PDU, causing the Ruby code in rmodbus to sit in a loop waiting indefinitely.

Maybe register 396 is different, and cannot be accessed this way, but I am following the instructions given on a Teltonika web page. Any ideas or suggestions would be welcome.

Hello,

Could you try writing the message to register 398 and upwards, and then send the message by pushing “1” to register 397?

Best regards,

Yes, I have tried writing to registers 398 upwards and pushing ‘1’ to register 397. It fails. The problem is definitely not the register number/address. I can succeed in sending an SMS by writing the phone number and message to registers 397 upwards as the first step. Then I edit the script to remove this step, and just leave in writing a ‘1’ to register 396. This correctly sends the SMS (it is received on my phone), but the code hangs, and only a few ^C will stop it and return to the command prompt. Writing to register 396 immediately after writing to registers 397 upwards causes a broken pipe {EPIPE} error.

1 Like

This topic was automatically closed after 15 days. New replies are no longer allowed.