MQTT Mysql Logger
Budget: $50 – $150 USD
I wanted to use something like this; ncd.io/log-mqtt-gateway-data-to-mysql-database/
When I try to run this on a centos 7.9 server that has MQTT running on it, I get this error;
MQTT Client Connected
MySQL Client Connected
MQTT Client Connected
MySQL Client Connected
^CTraceback (most recent call last):
File "mqtt_sub_mysql_pub.py", line 118, in <module>
client.loop_forever()
File "/usr/local/lib/python3.6/site-packages/paho/mqtt/client.py", line 1773, in loop_forever
self._reconnect_wait()
File "/usr/local/lib/python3.6/site-packages/paho/mqtt/client.py", line 3612, in _reconnect_wait
time.sleep(min(remaining, 1))
KeyboardInterrupt
The author says the script is meant to work with their own hardware so I thought I would ask here if someone can alter the script to make it work for me.
One extra addition that I'd like is DB based user authentication.
When adding/removing users, I would like MQTT to look in the MySQL db for the user and either allow or not allow the user based on a flag such as 0 do not allow or 1 allow device/user.
If you can do this, it may lead to a lot more work as this is just a proof of concept for a client of mine.
When I try to run this on a centos 7.9 server that has MQTT running on it, I get this error;
MQTT Client Connected
MySQL Client Connected
MQTT Client Connected
MySQL Client Connected
^CTraceback (most recent call last):
File "mqtt_sub_mysql_pub.py", line 118, in <module>
client.loop_forever()
File "/usr/local/lib/python3.6/site-packages/paho/mqtt/client.py", line 1773, in loop_forever
self._reconnect_wait()
File "/usr/local/lib/python3.6/site-packages/paho/mqtt/client.py", line 3612, in _reconnect_wait
time.sleep(min(remaining, 1))
KeyboardInterrupt
The author says the script is meant to work with their own hardware so I thought I would ask here if someone can alter the script to make it work for me.
One extra addition that I'd like is DB based user authentication.
When adding/removing users, I would like MQTT to look in the MySQL db for the user and either allow or not allow the user based on a flag such as 0 do not allow or 1 allow device/user.
If you can do this, it may lead to a lot more work as this is just a proof of concept for a client of mine.