Giter Club home page Giter Club logo

Comments (11)

puddly avatar puddly commented on July 21, 2024

Does it always produce the RESET_POWER_ON status code? Even if you run it multiple times in a row?

from zigpy-cli.

jesseas avatar jesseas commented on July 21, 2024

Yes, it seems to. I am happy to rerun a test. If I go that route, let it hang 30 seconds (should I wait longer?) and then ^c and then repeat a few more times?

from zigpy-cli.

puddly avatar puddly commented on July 21, 2024

It takes about 10 seconds to run for me with my HUSBZB-1, you should either see immediate output or an error code.

What about if you install and run bellows from its main branch (in a new venv)?

$ pip install bellows
$ bellows -v DEBUG -d /dev/... backup

The backup format for the above command won't be compatible with the other tools but it should also fail with a similar status.

from zigpy-cli.

jesseas avatar jesseas commented on July 21, 2024

ok, so on the first question, here are 3 runs in a row.

Here are three runs of zigpy, they all look the same to me, but maybe I am missing something.

(venv)  zigpy $ zigpy -vv radio ezsp /dev/ttyUSB1 backup backup.json
2022-03-12 19:26:59.150 localhost.localdomain asyncio DEBUG Using selector: EpollSelector
2022-03-12 19:26:59.259 localhost.localdomain zigpy.appdb DEBUG SQLite version for <module 'sqlite3' from '/usr/lib64/python3.8/sqlite3/__init__.py'>: 3.37.2
2022-03-12 19:26:59.313 localhost.localdomain asyncio DEBUG Using selector: EpollSelector
2022-03-12 19:26:59.437 localhost.localdomain bellows.ezsp DEBUG Resetting EZSP
2022-03-12 19:26:59.438 localhost.localdomain bellows.uart DEBUG Resetting ASH
2022-03-12 19:26:59.438 localhost.localdomain bellows.uart DEBUG Sending: b'1ac038bc7e'
2022-03-12 19:27:00.732 localhost.localdomain bellows.uart DEBUG RSTACK Version: 2 Reason: RESET_POWER_ON frame: b'c102029b7b7e'
2022-03-12 19:27:00.733 localhost.localdomain bellows.ezsp ERROR NCP entered failed state. Requesting APP controller restart
2022-03-12 19:27:00.734 localhost.localdomain bellows.uart DEBUG Closed serial connection
^C
Aborted!
2022-03-12 19:27:09.750 localhost.localdomain asyncio ERROR Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<Gateway.reset() running at /home/jesse/dev/zigpy/venv/lib/python3.8/site-packages/bellows/uart.py:223> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f32e5a8daf0>()]> cb=[_chain_future.<locals>._call_set_state() at /usr/lib64/python3.8/asyncio/futures.py:367]>
(venv)  zigpy $ zigpy -vv radio ezsp /dev/ttyUSB1 backup backup.json
2022-03-12 19:27:11.312 localhost.localdomain asyncio DEBUG Using selector: EpollSelector
2022-03-12 19:27:11.413 localhost.localdomain zigpy.appdb DEBUG SQLite version for <module 'sqlite3' from '/usr/lib64/python3.8/sqlite3/__init__.py'>: 3.37.2
2022-03-12 19:27:11.464 localhost.localdomain asyncio DEBUG Using selector: EpollSelector
2022-03-12 19:27:11.581 localhost.localdomain bellows.ezsp DEBUG Resetting EZSP
2022-03-12 19:27:11.582 localhost.localdomain bellows.uart DEBUG Resetting ASH
2022-03-12 19:27:11.582 localhost.localdomain bellows.uart DEBUG Sending: b'1ac038bc7e'
2022-03-12 19:27:12.883 localhost.localdomain bellows.uart DEBUG RSTACK Version: 2 Reason: RESET_POWER_ON frame: b'c102029b7b7e'
2022-03-12 19:27:12.884 localhost.localdomain bellows.ezsp ERROR NCP entered failed state. Requesting APP controller restart
2022-03-12 19:27:12.885 localhost.localdomain bellows.uart DEBUG Closed serial connection
^C
Aborted!
2022-03-12 19:27:23.205 localhost.localdomain asyncio ERROR Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<Gateway.reset() running at /home/jesse/dev/zigpy/venv/lib/python3.8/site-packages/bellows/uart.py:223> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f8f765728b0>()]> cb=[_chain_future.<locals>._call_set_state() at /usr/lib64/python3.8/asyncio/futures.py:367]>
(venv)  zigpy $ zigpy -vv radio ezsp /dev/ttyUSB1 backup backup.json
2022-03-12 19:27:26.124 localhost.localdomain asyncio DEBUG Using selector: EpollSelector
2022-03-12 19:27:26.225 localhost.localdomain zigpy.appdb DEBUG SQLite version for <module 'sqlite3' from '/usr/lib64/python3.8/sqlite3/__init__.py'>: 3.37.2
2022-03-12 19:27:26.279 localhost.localdomain asyncio DEBUG Using selector: EpollSelector
2022-03-12 19:27:26.400 localhost.localdomain bellows.ezsp DEBUG Resetting EZSP
2022-03-12 19:27:26.401 localhost.localdomain bellows.uart DEBUG Resetting ASH
2022-03-12 19:27:26.401 localhost.localdomain bellows.uart DEBUG Sending: b'1ac038bc7e'
2022-03-12 19:27:27.699 localhost.localdomain bellows.uart DEBUG RSTACK Version: 2 Reason: RESET_POWER_ON frame: b'c102029b7b7e'
2022-03-12 19:27:27.700 localhost.localdomain bellows.ezsp ERROR NCP entered failed state. Requesting APP controller restart
2022-03-12 19:27:27.701 localhost.localdomain bellows.uart DEBUG Closed serial connection
^C
Aborted!
2022-03-12 19:27:35.080 localhost.localdomain asyncio ERROR Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<Gateway.reset() running at /home/jesse/dev/zigpy/venv/lib/python3.8/site-packages/bellows/uart.py:223> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7ff6f20cdfd0>()]> cb=[_chain_future.<locals>._call_set_state() at /usr/lib64/python3.8/asyncio/futures.py:367]>

On the bellows test, I removed and reinserted the USB stick in order to make sure the blue light started on. I switched virtual envs and got this:

(venv)  dev $ bellows -v DEBUG -d /dev/ttyUSB1 backup
debug: Using selector: EpollSelector
debug: Using selector: EpollSelector
debug: Connected. Resetting.
debug: Resetting EZSP
debug: Resetting ASH
debug: Sending: b'1ac038bc7e'
debug: RSTACK Version: 2 Reason: RESET_POWER_ON frame: b'c102029b7b7e'
error: NCP entered failed state. Requesting APP controller restart
debug: _reset_controller_application callback: (<NcpResetCode.RESET_POWER_ON: 2>,)
debug: Closed serial connection
^C
Aborted!
error: Task was destroyed but it is pending!
error: task: <Task pending name='Task-5' coro=<Gateway.reset() done, defined at /home/jesse/dev/venv/lib/python3.8/site-packages/bellows/uart.py:202> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fcd4748a5b0>()]> cb=[_chain_future.<locals>._call_set_state() at /usr/lib64/python3.8/asyncio/futures.py:367]>
(venv)  dev $ bellows -v DEBUG -d /dev/ttyUSB1 backup
debug: Using selector: EpollSelector
debug: Using selector: EpollSelector
debug: Connected. Resetting.
debug: Resetting EZSP
debug: Resetting ASH
debug: Sending: b'1ac038bc7e'
debug: RSTACK Version: 2 Reason: RESET_POWER_ON frame: b'c102029b7b7e'
error: NCP entered failed state. Requesting APP controller restart
debug: _reset_controller_application callback: (<NcpResetCode.RESET_POWER_ON: 2>,)
debug: Closed serial connection
^C
Aborted!
error: Task was destroyed but it is pending!
error: task: <Task pending name='Task-5' coro=<Gateway.reset() done, defined at /home/jesse/dev/venv/lib/python3.8/site-packages/bellows/uart.py:202> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5c7c38b550>()]> cb=[_chain_future.<locals>._call_set_state() at /usr/lib64/python3.8/asyncio/futures.py:367]>
(venv)  dev $ bellows -v DEBUG -d /dev/ttyUSB1 backup
debug: Using selector: EpollSelector
debug: Using selector: EpollSelector
debug: Connected. Resetting.
debug: Resetting EZSP
debug: Resetting ASH
debug: Sending: b'1ac038bc7e'
debug: RSTACK Version: 2 Reason: RESET_POWER_ON frame: b'c102029b7b7e'
error: NCP entered failed state. Requesting APP controller restart
debug: _reset_controller_application callback: (<NcpResetCode.RESET_POWER_ON: 2>,)
debug: Closed serial connection
^C
Aborted!
error: Task was destroyed but it is pending!
error: task: <Task pending name='Task-5' coro=<Gateway.reset() done, defined at /home/jesse/dev/venv/lib/python3.8/site-packages/bellows/uart.py:202> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f626da4b5b0>()]> cb=[_chain_future.<locals>._call_set_state() at /usr/lib64/python3.8/asyncio/futures.py:367]>

I gave that 10 seconds or so before killing it with ^c. I also have three outputs from that.

from zigpy-cli.

puddly avatar puddly commented on July 21, 2024

This looks like a problem either with the stick or with the host. Are you sure no other software is accessing the stick (i.e ZHA or Zigbee2MQTT)? Can you try a different type of USB port or a different computer?

from zigpy-cli.

jesseas avatar jesseas commented on July 21, 2024

I initially tried this on my HA VM. When that didn't work (I don't remember what the error there was), I decided it was easier to move to my Linux laptop. My laptop doesn't have HA or anything else on it that should know or care about the zigbee dongle. I tried a different USB port (even moving from USB-A to Thunderbolt) and I don't see any change...

from zigpy-cli.

dmulcahey avatar dmulcahey commented on July 21, 2024

If on a Linux laptop: make sure modemmanager is not running / there

from zigpy-cli.

jesseas avatar jesseas commented on July 21, 2024

I removed ModemManager, although I don't think it was actually running. Zigpy and Bellows both give me the same error.

from zigpy-cli.

puddly avatar puddly commented on July 21, 2024

Bellows is the library ZHA and zigpy-cli use to communicate with the HUSBZB-1. If it can't connect, I'm not sure how you're able to use Home Assistant with it in the first place.

Some suggestions:

  1. Try yet another environment. If it 100% works within HA OS, you can disable ZHA and create the virtualenv in there to install the packages.
  2. Edit bellows to disable this specific check: https://github.com/zigpy/bellows/blob/dd00f42792efa200e40e1c806c5b84c5129b2d74/bellows/uart.py#L150

from zigpy-cli.

jesseas avatar jesseas commented on July 21, 2024

Ok, yeah, this device was being used on HA (on a different machine), so I can try to move back to that environment and give it another go, or dig into that further. That will take a little longer to turn around. Thanks for your help so far.

from zigpy-cli.

jesseas avatar jesseas commented on July 21, 2024

I was able to run this in the HA VM. not sure what caused the issue on my other machine. Thanks for the help.

from zigpy-cli.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.