7105 questions

8491 answers

13758 comments

10493 members

0 votes
138 views 8 comments
by

Hello all,

I'm trying to configure RUT230 to read some values from Siemens PLC via Modbus and send it with http/s request to a webserver.

My FW version is RUT2XX_R_00.01.13.1

I configured one Modbus master with two requests. Then I created sender with the default configuration. It works, but only the first Modbus request data is sent to the webserver. At some point I will need to request, for example, start register 1, count 10 and start register 50, count 10 and send them in one web request.

I tried manipulating the JSON string but it seems that %s and %a are always replaced with the first enabled request data. Is there any way to send both datasets in one web request?

Below are screenshots of my configuration.

Thank you!

by
Hi Tosh were you able to solve this?  We have been told to use the %s variable in the JSON to pull different registers from the Modbus slave, however we are stuck to figure out how to use the %s with %a variables in the JSON field to "select" different modbus rtu registers, so that we can have two data senders, each one for a differente Modbus register (this is what we HOPE can be done!)
by
Sorry for the delay, I didn't see your post until now.

I thought %s and %a are placeholders for the register offset and the data itself. Anyway, we had no luck with this issue. Also if we set read and send periods to super short intervals (1-2 sec), the reading stops after around 1019 reads and there is no more Modbus activity. We reproduced this multiple times.

I guess this feature is not production ready, but I got a call from Teltonika representative today and she promised to help solve this.

1 Answer

0 votes
by

Hello, 

Regarding the scenario you want to achieve you can send the data in one go via Data to server where segment count will be set to All.. 

Sample data received:


If picture is blur you can refer to this link: https://prnt.sc/w2zg82

Regards,

Jerome

by
Thank you for your answer!

Segment count selection does not provide option "All". It's a range from 1 to 10.
by

Hello, 

Could you try executing this command via CLI: 

uci set modbus_data_sender.@data_sender[0].json_segment_count='all'
uci commit modbus_data_sender 
luci-reload


The said command lines should make your data_sender segment count to all 

Let me know the results

Regards,
Jerome

by

The result of the commands was:

root@Teltonika-RUT230:~# uci set modbus_data_sender.@data_sender[0].json_segment_count='all'
root@Teltonika-RUT230:~# uci commit modbus_data_sender
root@Teltonika-RUT230:~# luci-reload
A match found : 99
A match found : 99
bad

In the webconfig (in browser) Segment count was set to 1 and the sender stopped sending.
After updating any option from the browser, the sender starts again with
Segment count 1.

by

Hello, 

Could you execute this commands instead of putting all input a number. 

uci set modbus_data_sender.@data_sender[0].json_segment_count='12'

uci commit modbus_data_sender
luci-reload

Regards,
Jerome

by

Hello again,The result is pretty much the same:

root@Teltonika-RUT230:~# uci set modbus_data_sender.@data_sender[0].json_segment
_count='12'
root@Teltonika-RUT230:~# uci commit modbus_data_sender
root@Teltonika-RUT230:~# luci-reload
A match found : 99
A match found : 99
bad

In the webconfig (in browser) Segment count was set to 1 and the sender stopped sending.

In my understanding "Segment count" option is to select how many of the buffered (in RAM) records should be send. I thought it's used to protect the server from receiving more data than it can handle. 

Please, let me know if I'm wrong.

by
I have this same issue with a TRB145 trying to send multiple register requests to Thingsboard.io cloud server. But TRB145 data sender sends all the separate registers data as a single value via mqtt message packet. And the same goes for when you even try send the TRB145's own internal modbus values like signal strength, uptime etc. Sends all that data as a single mqtt value as well. Doesn't seem like the teltonika range is very mqtt friendly when you need it to act as a mqtt gateway