zigpy / zigpy-znp

TI CC2531, CC13x2, CC26x2 radio support for Zigpy and ZHA
GNU General Public License v3.0
145 stars 40 forks source link

Backup of HUSBZB-1 not working #89

Closed jds11111 closed 2 years ago

jds11111 commented 2 years ago

I (tried to) follow the instructions on home assistant to back up the coordinator: disable zigbee, ssh into machine, shell in docker. Then used the suggested command, and got the following errors:

~ $ docker exec -it homeassistant bash
bash-5.1# python -m zigpy_znp.tools.network_backup /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_C13017E9-if01-port0 -o network_backup.json
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/zigpy_znp/api.py", line 395, in request
    response = await response_future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/zigpy_znp/tools/network_backup.py", line 104, in <module>
    asyncio.run(main(sys.argv[1:]))  # pragma: no cover
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/zigpy_znp/tools/network_backup.py", line 95, in main
    await znp.connect()
  File "/usr/local/lib/python3.9/site-packages/zigpy_znp/api.py", line 116, in connect
    self.capabilities = (await self.request(c.SYS.Ping.Req())).Capabilities
  File "/usr/local/lib/python3.9/site-packages/zigpy_znp/api.py", line 395, in request
    response = await response_future
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 55, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 92, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Looks to me like it does not find the dongle, but I double checked the id of the device. Also tried rebooting the HA machine after disabling the coordinator. As a check I also tried downloading from the new Sonoff Zigbee 3.0 Dongle Plus, but received the same error.

tube0013 commented 2 years ago

You need to use bellows to back up a SiLabs radio.

Puddy has a build that will create a compatible network backup:

pip install zigpy-znp 'git+https://github.com/puddly/bellows@puddly/open-coordinator-backup'

Backup; bellows backup -d /dev/serial/.... > backup.json

Restore to new TI stick: python -m zigpy_znp.tools.network_restore /dev/... -i /path/to/backup.json

jds11111 commented 2 years ago

Thanks. I think that there is something wrong with the order of your Backup command ("backup" should follow the device), but there was still an error. Maybe I should try to do it from a linux box, instead from inside a docker container. Anyway, apparently this is not the place to discuss backing up the SiLabs dongle. Thanks for the pointers!

puddly commented 2 years ago

If you're doing a backup to migrate coordinators, this is as good a place as any to discuss. What's the error you receive? Did you disable the ZHA component before running any of these commands so that ZHA isn't concurrently using the serial port?