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
1,323 views 3 comments
by
If there anyway, to accept data received on the serial port (RS232/485) then publish to MQTT broker?

1 Answer

0 votes
by anonymous
Hello,

Apart from using a custom script or FW, this solution is not currently supported on our routers.
by anonymous
Hi,

I tried a simple shell script to read ASCII temperature values coming from a sensor on RS485 in certain intervals.

 

while true

do

   read -r line < /dev/rs485

   mosquitto_pub -h mqttbroker -t Temperatur -m $line -u user -P password -p portnumber -d

done

Wenn you receive data from RS-485 (ASCII with CRLF at the end) then it will be published to the mqttbroker.

You have to install mosquitto-client.

I would prefer a bidrectional solution, sending commands via a mqtt broker to an RS-485 attached sensor and receiving the answer.

Any suggestions for a simple solution are very much appreciated.

Best regards

Chris
by
Hi Chris,

How did you install the mosquitto-client package? I would like to do nearly the same (sending some data via script to MQTT broker).

Br, Mike
by
Hi Mike,

sorry, I do not really remember anymore what I have done. I do not have the router anymore at home.

WIth best regards

Chris