During the night I noticed the same error multiple times, see below. Also it stopped sending messages to the MQTT broker, not sure yet if it's the broker or Theengs Gateway that failed. The broker is also using Docker (eclipse-mosquitto version 2.0.18).
Error:
--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
msg = self.format(record)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
return fmt.format(record)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
record.message = record.getMessage()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
msg = msg % self.args
~~~~^~~~~~~~~~~
TypeError: %d format: a real number is required, not ReasonCode
Call stack:
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/opt/venv/lib/python3.11/site-packages/TheengsGateway/__main__.py", line 5, in <module>
main()
File "/opt/venv/lib/python3.11/site-packages/TheengsGateway/__init__.py", line 55, in main
run(configuration, config_path)
File "/opt/venv/lib/python3.11/site-packages/TheengsGateway/ble_gateway.py", line 683, in run
gw.client.loop_forever()
File "/opt/venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 2291, in loop_forever
rc = self._loop(timeout)
File "/opt/venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 1680, in _loop
rc = self.loop_read()
File "/opt/venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 2096, in loop_read
return self._loop_rc_handle(rc)
File "/opt/venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 3042, in _loop_rc_handle
self._do_on_disconnect(packet_from_broker=False, v1_rc=rc)
File "/opt/venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 4378, in _do_on_disconnect
on_disconnect(
File "/opt/venv/lib/python3.11/site-packages/TheengsGateway/ble_gateway.py", line 163, in on_disconnect
logger.error(
Message: 'Disconnected from MQTT broker with reason code = %d'
Arguments: (ReasonCode(Disconnect, 'Unspecified error'),)
Since I'm using the Docker version, what can I do to retrieve more useful information?
Since I moved the docker container to another RPi, I haven't seen this issue anymore. Perhaps the older RPi 2 just had issues. I will close this issue for now.
A couple of days ago I started using TheengsGateway using Docker on a RPi 2 (32-bit):
During the night I noticed the same error multiple times, see below. Also it stopped sending messages to the MQTT broker, not sure yet if it's the broker or Theengs Gateway that failed. The broker is also using Docker (eclipse-mosquitto version 2.0.18).
Error:
Since I'm using the Docker version, what can I do to retrieve more useful information?