radonwave icon indicating copy to clipboard operation
radonwave copied to clipboard

mqtt with username and password

Open qingz2004 opened this issue 4 years ago • 5 comments

The script works good for me. Thank you for your effort. Now I want to publish the radon data to my mqtt server. Is there a way to connect to a mqtt server with username and password? What is the command?

Thanks!

qingz2004 avatar Dec 05 '20 22:12 qingz2004

I assume you have already found the --mqtt and --topic command-line options. There were no --username and --password options, so I just added them. Please get the newest version of the script to be able to use them. Also, I added an MQTT section to the README, please have a look.

marcelm avatar Dec 05 '20 23:12 marcelm

Is there a way to specify the port of the mqtt server? I'm using a non standard port to avoid being attached.

I installed a new mosquitto server with standard port, and no username/password, no radon message received.

Thanks!

qingz2004 avatar Dec 06 '20 02:12 qingz2004

That was missing from the documentation. You need to install the paho.mqtt package into the virtual environment, so run something like env/bin/pip install paho.mqtt. I have updated the README.

Also, I added a --port argument to the script, so you can write --port 12345.

marcelm avatar Dec 06 '20 10:12 marcelm

EDIT: It works now. Thanks!

qingz2004 avatar Dec 06 '20 14:12 qingz2004

Great to hear! I’ll close this issue now, thanks for letting me know.

marcelm avatar Dec 06 '20 20:12 marcelm