B4J Question From Mqtt broker to rs232 - how to do it?

amorosik

Expert
Licensed User
I have the XYZ software that accepts the input signal of a sensor on an rs232 port and displays a graph of it over time
However, my sensor goes out to an Mqtt broker and therefore 'shoots' the values read by the sensor directly on some entries of the mqtt broker
How can I allow the program to read the information from the pressure sensor?
I mean, how can I create a program that acts as a bridge between the two different communication systems (mqtt - rs232)?
 

aminoacid

Active Member
Licensed User
Longtime User
I have the XYZ software that accepts the input signal of a sensor on an rs232 port and displays a graph of it over time
However, my sensor goes out to an Mqtt broker and therefore 'shoots' the values read by the sensor directly on some entries of the mqtt broker
How can I allow the program to read the information from the pressure sensor?
I mean, how can I create a program that acts as a bridge between the two different communication systems (mqtt - rs232)?

It's really easy and I did something like that a while back with a couple of applications using temperature and pressure sensors interfaced via RS232. Take a look at this application that I posted a few months ago - don't let the title fool you. Look at the code. It actually is a TCP to MQTT bridge. However since the TCP (Network) library and the Serial Library both can use Asynch Streams (AST), it should be really easy to adapt it for a Serial to MQTT bridge.

 
Upvote 0
Top