kardia-as / zigpy-zboss

GNU General Public License v3.0
39 stars 4 forks source link

ApplicationController probe method - wrong configuration #30

Closed DamKast closed 10 months ago

DamKast commented 11 months ago
          Attempting to add the update to HomeAssistant via:
  1. Make a custom component by copying the zha component from inside the docker container /usr/src/homeassistant/homeassistant/components/zha to the /config/custom_components directory.
  2. add a version key (I used "2025.1.1") and "zippy-zboss==1.1.1" to the requirements list in manifest.json
  3. add import zigpy_zboss.zigbee.application and boss = ("boss", zigpy_zboss.application.ControllerApplication,) to custom_components/zha/core/const.py
  4. Restart

I am able to see the custom component:

Screenshot 2023-11-06 at 8 29 35 AM

I select the serial port. It should be passed through into the docker container as I was using it previously with a cc2531.

Screenshot 2023-11-06 at 8 29 57 AM

I select the radio type:

Screenshot 2023-11-06 at 8 30 12 AM

I then get to a port configuration in the control flow, but no matter what combination of flow control and speed I select, it errors and won't move forward, with an "unknown error occurred."

Screenshot 2023-11-06 at 8 30 34 AM

The logs from home assistant:

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 8:33:22 AM (2 occurrences)
Last logged: 8:35:19 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy_zboss/api.py", line 80, in connect
    self._config[conf.CONF_DEVICE], self)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'device'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha/config_flow.py", line 269, in async_step_manual_port_config
    if await self._radio_mgr.radio_type.controller.probe(user_input):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy_zboss/zigbee/application.py", line 480, in probe
    await nrf.connect()
  File "/usr/local/lib/python3.11/site-packages/zigpy_zboss/api.py", line 83, in connect
    "Connection to %s failed, cleaning up", self._port_path)
                                            ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy_zboss/api.py", line 63, in _port_path
    return self._config[conf.CONF_DEVICE][conf.CONF_DEVICE_PATH]
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'device'

The nrf52840 is showing up in lsusb

ha@ha:~/ha$
lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Communications, Driver=cdc_acm, 12M
    |__ Port 1: Dev 2, If 1, Class=CDC Data, Driver=cdc_acm, 12M
    |__ Port 1: Dev 2, If 2, Class=Mass Storage, Driver=usb-storage, 12M

ha@ha:~/ha$
ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Nov  6 08:27 /dev/ttyACM0

Apologies if I'm posting this in the wrong place and thanks for the update!

Originally posted by @willpuckett in https://github.com/kardia-as/zigpy-zboss/issues/28#issuecomment-1795485751

DamKast commented 10 months ago

@willpuckett I made a new release that fixes the probing issue. You should be able to use ZBOSS as alternative radio using v1.1.2.

willpuckett commented 10 months ago

Awesome I just made a quick attempt and it still was getting stuck at the same place. Could this be because I'm using a Seeeduino Xiao nRF52840? It shows up in lsusb as a modem and two other devices, but maybe I need to do a firmware built in west for that device? I'll try poking around with it a little more when I'm home over the weekend...

DamKast commented 10 months ago

You can try this to verify if you have the correct firmware on your dongle.

willpuckett commented 10 months ago

Thanks for looking into this. I had hoped that since it was not using any gpio it would work as is... I'll try to do a build sometime and see if I can get it going.

stolevegen commented 10 months ago

@DamKast I don't know if this typo is in your actual manifest.json file, but in the comment above it says "ziPpy-zboss==1.1.1" instead of "ziGpy-zboss==1.1.1"

2. add a version key (I used "2025.1.1") and "zippy-zboss==1.1.1" to the requirements list in manifest.json