Formating data collected from modbus device to be sent by HTTP POST

Hello.

I am using a TRB245

I am successfully collected data from my modbus device (I got an array like [11,99] for exemple) and I would like to send by POST HTTP something like “Temp : 11 ; Pressure : 99”. How can I format my modbus data like this.

I can send them with data to server configuration using “custom” and in the format %data% but I did not find to have access to the separates values in the array %data%.

Thanks in advance.

Hugues

Hi there,

Formatting will require you to use LUA scripting. By default, we do not support splitting the arrays, instead it outputs the entire array.

You can find some user script examples in the following page to get you started: User Scripts examples - Teltonika Networks Wiki

I would like to note that custom scripts are out of technical support scope therefore we’re unable to provide any further support when it comes to them.

Regards,
M.

When you say “by default” … this does not mean it is impossible. This is juste it is not done in your standard transmitting way, right ?

Do you have a doc for the LUA scripting ?

Hi,

I’ve sent you the link to the user script examples, you may also refer to Google or any other platforms that are trustworthy. I don’t believe we have any other documentation on this.

When I said “by default” I meant that in the WebUI (or CLI) it is not configurable to have the output be formatted, this may only be achieved with the use of custom scripts.

Regards,
M.

Hello. Thanks for the clarifications. One last question : where are (or how do you “call”) the data coming for a modbus communication, in my case an array … Because I need this to properly access to their value in my script. I did not find any info in your doc about this

Thanks,

Hugues

Hi there,

I think the optimal way to go about this would be to utilize API requests, here’s the documentation: https://developers.teltonika-networks.com/

Regards,
M.

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