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

Connect response wrong hpai #217

Merged
merged 2 commits into from
Jul 14, 2019

Conversation

Julius2342
Copy link
Collaborator

Trying to fix #76 and home-assistant/core#24492

@farmio : is this how you thought it should be solved?

@Julius2342 Julius2342 requested a review from farmio July 13, 2019 13:44
@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 91.828% when pulling fe0f414 on Julius2342:connect-response-wrong-hpai into cc10a82 on XKNX:master.

@farmio
Copy link
Member

farmio commented Jul 13, 2019

so this is what I get when I test it now:

DEBUG:xknx.knx:Received: <KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="KNXIPServiceType.CONNECT_RESPONSE" Reserve="0" TotalLength="8" />
 body="<ConnectResponse communication_channel="0" status_code="ErrorCode.E_NO_MORE_UNIQUE_CONNECTIONS" control_endpoint="<HPAI 0.0.0.0:0 />" request_type="None" identifier="None" />" />
WARNING:xknx.log:Error: KNX bus responded to request of type 'Connect' with error in 'ConnectResponse': ErrorCode.E_NO_MORE_UNIQUE_CONNECTIONS
Traceback (most recent call last):
  File "/Users/meti/Documents/Dev/xknx-xknx/xknx/main.py", line 51, in <module>
    loop.run_until_complete(main())
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/Users/meti/Documents/Dev/xknx-xknx/xknx/main.py", line 40, in main
    await xknx.start(connection_config=connection_config)
  File "/Users/meti/Documents/Dev/xknx-xknx/xknx/xknx/xknx.py", line 76, in start
    await self.knxip_interface.start()
  File "/Users/meti/Documents/Dev/xknx-xknx/xknx/xknx/io/knxip_interface.py", line 102, in start
    self.connection_config.auto_reconnect_wait)
  File "/Users/meti/Documents/Dev/xknx-xknx/xknx/xknx/io/knxip_interface.py", line 144, in start_tunnelling
    await self.interface.start()
  File "/Users/meti/Documents/Dev/xknx-xknx/xknx/xknx/io/tunnel.py", line 83, in start
    await self.connect()
  File "/Users/meti/Documents/Dev/xknx-xknx/xknx/xknx/io/tunnel.py", line 104, in connect
    raise XKNXException("Could not establish connection")
xknx.exceptions.exception.XKNXException: Could not establish connection

That's far better than before 👍

Should we catch the error somewhere and exit gracefully?

@farmio
Copy link
Member

farmio commented Jul 14, 2019

home-assistant/core#15313 could profit from this as well.

@Julius2342 Julius2342 merged commit 7ab99cd into XKNX:master Jul 14, 2019
@Julius2342 Julius2342 deleted the connect-response-wrong-hpai branch September 29, 2019 18:54
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

Successfully merging this pull request may close these issues.

CouldNotParseKNXIP "wrong HPAI length" with HassIO
3 participants