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

CoAP fails to remove pairing #164

Open
roysjosh opened this issue Aug 25, 2022 · 0 comments
Open

CoAP fails to remove pairing #164

roysjosh opened this issue Aug 25, 2022 · 0 comments
Labels

Comments

@roysjosh
Copy link
Contributor

2022-08-25 10:50:38.164 DEBUG (MainThread) [aiohomekit.controller.coap.connection] Read value for 239.24A iid 2565: value 1
2022-08-25 10:50:38.165 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
  6 (State): (1 bytes/<class 'bytearray'>) 0x01
  0 (Method): (1 bytes/<class 'bytearray'>) 0x04
  1 (Identifier): (36 bytes/<class 'bytes'>) b'2b3111ef-b7bb-47be-b2f0-6cf47b5927d7'
]

2022-08-25 10:50:38.165 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
  1 (Identifier): (44 bytes/<class 'bytearray'>) 0x060101000104012432623331313165662d623762622d343762652d623266302d366366343762353932376437
]

2022-08-25 10:50:38.165 DEBUG (MainThread) [aiohomekit.controller.coap.connection] ENCRYPT counter=7
2022-08-25 10:50:38.196 DEBUG (MainThread) [aiohomekit.controller.coap.connection] DECRYPT counter=7
2022-08-25 10:50:38.196 DEBUG (MainThread) [aiohomekit.controller.coap.pdu] Got PDU Control=0x02, TID=0x8d, Status=Success, Len=0

But the pairing remains active (sf is 0). And indeed the old pairing info still functions.

I saw this error a few seconds after the above although it isn't clear that it is related:

2022-08-25 10:52:06.416 WARNING (MainThread) [coap-server] An exception that is not an aiocoap Error was raised from a transport; please report this as a bug in aiocoap: AttributeError("'RecvmsgSelectorDatagramTransport' object has no attribute '_fatal_error'")
2022-08-25 10:52:06.419 ERROR (MainThread) [aiohomekit.utils] Failure running background task: Task-1665
Traceback (most recent call last):
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/util/asyncio/recvmsg.py", line 130, in sendmsg
    self.__sock.sendmsg((data,), ancdata, flags, address)
AttributeError: 'NoneType' object has no attribute 'sendmsg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiohomekit/utils.py", line 29, in _handle_task_result
    task.result()
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiohomekit/controller/coap/pairing.py", line 168, in _process_config_changed
    await self.list_accessories_and_characteristics()
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiohomekit/controller/coap/pairing.py", line 148, in list_accessories_and_characteristics
    accessories = await self.connection.get_accessory_info()
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiohomekit/controller/coap/connection.py", line 404, in get_accessory_info
    _, body = await self.enc_ctx.post(OpCode.UNK_09_READ_GATT, 0x0000, b"")
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiohomekit/controller/coap/connection.py", line 183, in post
    res_pdu = await self.post_bytes(req_pdu)
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiohomekit/controller/coap/connection.py", line 167, in post_bytes
    response = await asyncio.wait_for(
  File "/usr/lib64/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/protocol.py", line 597, in _run_outer
    await cls._run(app_request, response, weak_observation, protocol, log)
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/protocol.py", line 656, in _run
    blockresponse = await blockrequest.response
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/tokenmanager.py", line 223, in request
    send_canceller = self.token_interface.send_message(msg, lambda: request.add_exception(error.MessageError))
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/messagemanager.py", line 422, in send_message
    self._send_initially(message, messageerror_monitor)
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/messagemanager.py", line 435, in _send_initially
    self._send_via_transport(message)
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/messagemanager.py", line 440, in _send_via_transport
    self.message_interface.send(message)
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/transports/udp6.py", line 360, in send
    self.transport.sendmsg(message.encode(), ancdata, 0, message.remote.sockaddr)
  File "/home/jroys/code/home-assistant/core/venv/lib64/python3.10/site-packages/aiocoap/util/asyncio/recvmsg.py", line 136, in sendmsg
    self._fatal_error(exc,
AttributeError: 'RecvmsgSelectorDatagramTransport' object has no attribute '_fatal_error'
@Jc2k Jc2k added the CoAP label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants