How to use MQTT from CLI - I need to publish from CLI

Hi.
I need to make the RUTX50 publish any message I want from the CLI to a topic I decide

I did not even find any opkg pakage to use (or I am blind, I read before there was pakage mosquitto-client but looks like Teltonika removed it??!?!).

I found a mqtt_pub command but that looks like it have something todo with serial ports. (very odd that function is named mqtt_pub, and I cant find any other solution)

It’s super basic stuff for a MQTT compatible device, ut I cant find it anywhere.

Please help.

Hello,

Apologies for the delayed response.

If you are looking to install 3-rd party OPKG packages, please take a look at this post here.

When it comes to using MQTT from the CLI, I would suggest using mosquitto client:

opkg -e /etc/opkg/openwrt/distfeeds.conf update

opkg -e /etc/opkg/openwrt/distfeeds.conf install mosquitto-client-ssl

Then, you should be able to use mosquitto_sub and mosquitto_pub to subcribe and publish, respectively. For more information, I would recommend visiting mosquitto manual page here.

Kind Regards,

1 Like

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