ragingcomputer / amridm2mqtt

runs rtlamr to read IDM power meter data and send to MQTT broker
MIT License
76 stars 43 forks source link

Need support for MQTT Authentication #1

Closed brent20 closed 6 years ago

brent20 commented 6 years ago

I'm using a basic username and password for my MQTT Broker (while it may not be as important), would it be possible to add MQTT Credentials for authentication?

Thanks!

ragingcomputer commented 6 years ago

Good idea! See commit 9224489. Give it a go and let me know if it works!

Username/Password auth is only enabled when both MQTT_USER and MQTT_PASSWORD are specified in settings.py

When both MQTT_USER and MQTT_PASSWORD are not specified in settings.py, it sets auth to None (for wide-open setups like mine)

I tested it with mosquitto on my network and it seems to work both with and without auth enabled now.

brent20 commented 6 years ago

Works great! Thanks! I started to see meter data flow into my MQTT Broker and then I filled in my serial number hoping to see it broadcast soon. Thanks again for porting this awesome code over to MQTT!