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
916 views 2 comments
by
Hello,

I was able to connect the RUT955 with my TCP Modbus slave, and is fetching the data correctly,  when I configure the Modbus Service to send the data to my aws MQTT broker (AWS IoT Core) but without success. IoT Core logs shows:

PRINCIPALID: <id> [ERROR]  EVENT:PublishEvent MESSAGE:PublishIn Status: CLIENT_ERROR

I logged in using router's root user via ssh and I was able to publish data to the broker using mosquitto_pub including same certs and key that I use using the WebUI (ModBus service). This proves that the router has the correct certificates and key to publish.

There is any other config that I should try? what I'm missing?

Thank you.

1 Answer

+1 vote
by anonymous
Following this guide, I assume that some options are not available in the Mqtt Data to sender function as bridge_protocol_version mqttv311 or cleansession.

Try to load (with winscp) a Mosquitto bridge conf as described and initialize the broker on CLI with mosquitto -d -c /etc/mydir/myconf.conf by placing the certificates in the same folder.

Then publish in Mqtt to the broker internal to the router in anonymous with the good topic.

For Azure, I exceeded the limits of the service as follows

https://aws.amazon.com/fr/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/
Best answer
by
Your answer leads me to the solution.

I still don't understand why a bridge is needed (since you can configure the same without it), but it results that the webUI includes (In services -> MQTT) a bridge option, so I did configure it the same as the guide that you share, and now the data is arriving to AWS.

Thank you.
by
With Bridge conf, you can have a log to understand what is missing (add log_type all and log_dest file  or add -v to the mosquitto command). On my example, Azure needs bridge_protocol_version line.

Bridge with Webui is limited and not allows to add lines.

It's not the easiest way but it works :)