marcelm / radonwave

Read radon levels from Airthings Wave
MIT License
26 stars 8 forks source link

mqtt with username and password #8

Open qingz2004 opened 3 years ago

qingz2004 commented 3 years ago

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!

marcelm commented 3 years ago

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.

qingz2004 commented 3 years ago

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!

marcelm commented 3 years ago

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.

qingz2004 commented 3 years ago

EDIT: It works now. Thanks!

marcelm commented 3 years ago

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