FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
823 views 11 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 anonymous
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 anonymous
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.
by anonymous
Hi, has anyone solved this one, I'm looking to do the same!

Thanks,

Paul
by anonymous
I guess not. I just hope the other Teltonika features are not as finished as this one...

p.s.

The new Mikrotik KNOT device looks promising but it's not on the market yet.

2 Answers

0 votes
by anonymous

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 anonymous
Thank you for your answer!

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

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 anonymous

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 anonymous

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 anonymous

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 anonymous
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
by anonymous
Looks like this is not making progress, in general we have had several issues and inconsistencies with MQTT and Modbus with TRB and RUT devices, they need a lot mor debugging and polishing. In our experience, when it comes down to doing more elaborate things with MQTT and  Modbus, it is better to use a separate device, and use Teltonika as a router only.
0 votes
by anonymous
I figured this one out - if you use {%z:%a} (for modbus serial) or {%s:%a} for TCP, it gives the register number with the data.

Hope this helps :)

Harv