FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14231 questions

16882 answers

27766 comments

54444 members

0 votes
122 views 2 comments
by
Hey

I need to setup a RUTX12 as an MQTT broker, and i need to do this on multiple devices.

Since i need to setup username/password, as well as change the port number to a non-standard one, i can't use the WebUI, so i'm doing things via CLI.

How do i "distribute" this setup, when the end-user does not want WiFi or Mobile network to be active?

1 Answer

0 votes
by
Hi David,

The easiest way to "distribute" the configuration is through RMS, you can make a backup file of the RUTX12 that is already configured, an then use this backup file on all RUTX12 on your RMS account, but in this case you would have to add all devices on RMS, and all of them must have an internet connection.

To apply your MQTT Broker configuration through CLI, you have a few options:

1- Copy the file "/etc/config/mosquitto" on the RUTX12 with the setup done, and then, paste it on the exact same spot on the other routers.

2- Use the UCI commands to set the Brokers parameters, similar to this: https://prnt.sc/Js0ijOe04yPW

3- Use a text editor on "/etc/config/mosquitto" to input your parameters.

If the end user doesnt want WiFi or mobile, you may reach the routers through cabled ethernet or RMS.

Best regards.
by
Hello

When i copy the config file and password file, it does not accept the password file. I have to create the password file on the same device it appears?

When using UCI commands, all i get is this

mosquitto.owrt=owrt
mosquitto.owrt.use_uci='0'
mosquitto.mosquitto=mosquitto
by
Hi David,

I've noticed that when the device is first booted, the "uci show mosquitto" command only shows this option "mosquitto.mqtt=mqtt", and after enabling it on the WebUI, the other options appear and stay even after disabling.

So, you can use the third option i've suggested, using a text editor like nano or vi, on the /etc/config/mosquitto file, and inputing the config parameters, that you've copied from another device already configured.

About the password file, i've checked and it has to be saved at: /etc/vuci-uploads/cbid.mosquitto.mqtt.password_filepassword.txt, and the location and name of the file has to be set on the /etc/config/mosquitto file, mosquitto.mqtt.password_file='/etc/vuci-uploads/cbid.mosquitto.mqtt.password_filepassword.txt'.

Best regards.

Best regards