zigpy / zigpy-cli

Command line interface for zigpy
GNU General Public License v3.0
44 stars 12 forks source link

[BUG] Sonoff Zigbee 3.0 USB Dongle Plus-P (Windows) #32

Closed Kochise closed 1 year ago

Kochise commented 1 year ago

Hi,

Source : https://sonoff.tech/product/gateway-and-sensors/sonoff-zigbee-3-0-usb-dongle-plus-p/

Installed (to get COM port) : https://sonoff.tech/wp-content/uploads/2022/08/CP210x_Windows_Drivers_with_Serial_Enumeration.zip

Fresh Python install :

pip install zigpy
pip install zigpy-cli
pip install zigpy-xbee
pip install zigpy-znp
pip install bellows
pip install zha-quirks

Then :

zigpy radio znp com10 reset
zigpy radio znp com10 form
zigpy radio znp com10 info

Getting :

Traceback (most recent call last):
  File "D:\TEST\Python\lib\site-packages\zigpy_znp\api.py", line 228, in load_network_info
    await self._load_network_info(load_devices=load_devices)
  File "D:\TEST\Python\lib\site-packages\zigpy_znp\api.py", line 104, in _load_network_info
    nib = await self.nvram.osal_read(OsalNvIds.NIB, item_type=t.NIB)
  File "D:\TEST\Python\lib\site-packages\zigpy_znp\nvram.py", line 171, in osal_read
    raise KeyError(f"NV item does not exist: {nv_id!r}")
KeyError: 'NV item does not exist: <OsalNvIds.NIB: 33>'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\TEST\Python\Lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\TEST\Python\Lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\TEST\Python\Scripts\zigpy.exe\__main__.py", line 7, in <module>
  File "D:\TEST\Python\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "D:\TEST\Python\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "D:\TEST\Python\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\TEST\Python\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\TEST\Python\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\TEST\Python\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "D:\TEST\Python\lib\site-packages\click\decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "D:\TEST\Python\lib\site-packages\zigpy_cli\cli.py", line 20, in inner
    return loop.run_until_complete(cmd(*args, **kwargs))
  File "D:\TEST\Python\Lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "D:\TEST\Python\lib\site-packages\zigpy_cli\radio.py", line 86, in info
    await app.load_network_info(load_devices=False)
  File "D:\TEST\Python\lib\site-packages\zigpy_znp\zigbee\application.py", line 160, in load_network_info
    await self._znp.load_network_info(load_devices=load_devices)
  File "D:\TEST\Python\lib\site-packages\zigpy_znp\api.py", line 230, in load_network_info
    raise NetworkNotFormed() from e
zigpy.exceptions.NetworkNotFormed

Any idea how to make it work "out of the box" ?

Regards.

puddly commented 1 year ago

Please re-run all of the above commands with debug logging fully enabled and post the full output:

zigpy -vv radio znp com10 reset
zigpy -vv radio znp com10 form
zigpy -vv radio znp com10 info
Kochise commented 1 year ago

Too long to post "as is" so look into the attached text file :

[BUG] Sonoff Zigbee 3.0 USB Dongle Plus-P (Windows).txt

Now I remember what really happened on a "new" coordinator, without reset and form first :

zigpy radio znp com10 info

Maybe check that those are done before info instead to crash.