Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MqttTransport: Calls _on_connect multiple times #176

Open
zxdavb opened this issue Mar 16, 2024 · 2 comments
Open

MqttTransport: Calls _on_connect multiple times #176

zxdavb opened this issue Mar 16, 2024 · 2 comments

Comments

@zxdavb
Copy link
Owner

zxdavb commented Mar 16, 2024

Traceback:

2024-03-16 16:47:31.368 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback QosProtocol.connection_made(MqttTransport...len(queue)=0)), ramses=True)():   File "/home/dbonnes/clients/hass/venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/home/dbonnes/clients/hass/venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
    rc = self._loop(timeout)
  File "/home/dbonnes/clients/hass/venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 1164, in _loop
    rc = self.loop_read()
  File "/home/dbonnes/clients/hass/venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 1556, in loop_read
    rc = self._packet_read()
  File "/home/dbonnes/clients/hass/venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 2439, in _packet_read
    rc = self._packet_handle()
  File "/home/dbonnes/clients/hass/venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 3039, in _packet_handle
    return self._handle_connack()
  File "/home/dbonnes/clients/hass/venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 3138, in _handle_connack
    on_connect(
  File "/home/dbonnes/clients/ramses_rf/src/ramses_tx/transport.py", line 975, in _on_connect
    self.loop.call_soon_threadsafe(
Traceback (most recent call last):
  File "/usr/lib/python3.12/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/home/dbonnes/clients/ramses_rf/src/ramses_tx/protocol.py", line 581, in connection_made
    super().connection_made(transport, ramses=ramses)
  File "/home/dbonnes/clients/ramses_rf/src/ramses_tx/protocol.py", line 488, in connection_made
    self._set_active_hgi(self._transport.get_extra_info(SZ_ACTIVE_HGI))
  File "/home/dbonnes/clients/ramses_rf/src/ramses_tx/protocol.py", line 341, in _set_active_hgi
    assert self._active_hgi is None  # should only be called once
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
@zxdavb
Copy link
Owner Author

zxdavb commented Mar 16, 2024

During init - _on_connect() is called & invokes Protocol.connection_made(), but this can happen again, later on.

@zxdavb
Copy link
Owner Author

zxdavb commented Apr 25, 2024

I believe this is 'normal' behaviour from MQTT/ramses_esp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant