Hello,
TRB142 do not have a feature which would allow it to send serial data over MQTT. This would require additional development.
But you could try making a custom scripts which for example would log serial data to file, and then another script would take that info and with the help of mosquitto package you could try and send that data over MQTT.
Here are some ideas how those scripts could potentially look like:
- Logging serial data:
#!/bin/ash
microcom /dev/rs232 > /tmp/serialtomqtt.txt
- Sending data over MQTT:
#!/bin/ash
while true
do
if [ -s /tmp/serialtomqtt.txt ]
then
mosquitto_pub -h 192.168.1.244 -p 8800 -m "$(cat /tmp/serialtomqtt.txt)" -t testas
echo -n "" > /tmp/serialtomqtt.txt
else
mosquitto_pub -h 192.168.1.244 -p 8800 -t testas -m Nothning_Received
fi
sleep 10
done
You might need to install mosquitto package via opkg.
Please, keep in mind this is only a theory and we are not sure if this solution will work, so please test with "pinch of salt".
Best regards,