Can't start program
Start string: ./mqtt2sql.py --mqtt mqtt://user:pass@host:1883/topic/# --mqtt-insecure --sql-type mysql --sql-host host --sql-username mqtt --sql-password 'pass' --sql-db mqtt -v Output: 2024-05-27 23:43:26: mqtt2sql.py[1917929] v3.0.2 start 2024-05-27 23:43:26: MQTT server: 192.168.31.3:1883 (suppress TLS verification) keepalive 60 2024-05-27 23:43:26: user: user 2024-05-27 23:43:26: topics: topic/# 2024-05-27 23:43:26: exclude: None 2024-05-27 23:43:26: SQL type: MySQL 2024-05-27 23:43:26: server: 192.168.31.3:3306 [max 50 connections] 2024-05-27 23:43:26: db: mqtt 2024-05-27 23:43:26: table: mqtt 2024-05-27 23:43:26: user: mqtt 2024-05-27 23:43:26: timezone: UTC 2024-05-27 23:43:26: Verbose level: 1 2024-05-27 23:44:11: end 2024-05-27 23:44:11: mqtt2sql.py[1917929] v3.0.2 end 2024-05-27 23:44:11: signal SIGTERM#15 2024-05-27 23:44:11: mqtt2sql.py[1917929] v3.0.2 end 2024-05-27 23:44:11: end 2024-05-27 23:44:11: mqtt2sql.py[1917929] v3.0.2 end 2024-05-27 23:44:11: signal SIGTERM#15 2024-05-27 23:44:11: mqtt2sql.py[1917929] v3.0.2 end Exception ignored in: <module 'threading' from '/usr/lib/python3.10/threading.py'> Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1567, in shutdown lock.acquire() File "/opt/mqtt2sql/./mqtt2sql.py", line 934, in exitus self.exitus(signal, 'signal {}#{}'.format(self.signalname(signal), signal)) File "/opt/mqtt2sql/./mqtt2sql.py", line 955, in exitus sys.exit(status) SystemExit: 0
Which python and paho-mqtt?
python --version
python -m pip show paho-mqtt
$ python --version Command 'python' not found, did you mean: command 'python3' from deb python3 command 'python' from deb python-is-python3 $ python3 --version Python 3.10.12 $ python3 -m pip show paho-mqtt Name: paho-mqtt Version: 1.6.1 Summary: MQTT version 5.0/3.1.1 client class Home-page: http://eclipse.org/paho Author: Roger Light Author-email: [email protected] License: Eclipse Public License v2.0 / Eclipse Distribution License v1.0 Location: /usr/local/lib/python3.10/dist-packages Requires: Required-by:
pls try running with more debug output by appending three -d -d -d
./mqtt2sql.py --mqtt mqtt://user:pass@host:1883/topic/# --mqtt-insecure --sql-type mysql --sql-host host --sql-username mqtt --sql-password 'pass' --sql-db mqtt -v -d -d -d
Thanks for the keys. It was problem with mysql connection. Debug output helps me.