-
Notifications
You must be signed in to change notification settings - Fork 40
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
Support for slae.sh CC2652RB stick #35
Comments
can you run the same command but with |
@Adminiuga Many thanks for quick reply! Really appreciate it!
|
Probably due to Koenkk/zigbee-herdsman#196 |
So it shoud just skip invoking the bootloader on this device? |
I'll have to research the problem itself (and figure out what the terminology means). Try playing with the following setting: zha:
zigpy_config:
device:
flow_control: hardware # or software I believe the fix might require changing the flags in https://github.com/zha-ng/zigpy-znp/blob/54b21cfbeae58ed7275a4de58291ab8d143010f9/zigpy_znp/uart.py#L232 If you want to try playing around with it and finding what flags need to be set for your stick, the PySerial flags are all documented: https://pyserial.readthedocs.io/en/latest/pyserial_api.html#serial.Serial.__init__ |
hey :) sure, will try that during the weekend! just some quick ideas:
@puddly maybe you can contact me on telegram? https://t.me/slaesh =) |
this method will invoke the bootloader. we should do the same but with the inverse of DTR to NOT invoke it ;) |
I already tried the flow_control flag in the Home Assistant's UI wizard. I can try look in the code as slaesh mentioned to not invoke the bootloader. But that will take me longer as I haven't properly seen the code yet. (I didn't even know it has verbose mode lol ) |
I will check it asap |
@MarhyCZ I've pushed a preliminary fix a few minutes ago so it should work if you install the latest dev release within your virtual environment:
Not 100% sure if HA will end re-installing the latest stable version on startup so you might have to use something like the approach in here: https://github.com/zigpy/bellows/#testing-new-releases |
Awesome! I was installing it from a local git folder. I tried to make a patch, but I just couldn't quickly absorb the asyncio documentation :( |
Darn. You can use The only other thing that I can think of is adding a 1s delay to |
So adding the 1second delay in ZNP.connect did not help and removing the LOGGER.debug("Waiting 1s before the skip bytes are sent")
await asyncio.sleep(1)
skip = bytes([c.ubl.BootloaderRunMode.FORCE_RUN])
self._uart._transport_write(skip * 256) |
Hmm, perhaps the correct way is to set Those appear to generate the same |
That was freaking it!! I couldn't understand the difference between these two. |
Thanks a lot for the patience! I really appreciate it! |
Awesome, thank you for remotely debugging this! |
One thing to note: if you've previously used this stick with a default Z2M install, zigpy-znp will not overwrite the configured network settings when used with HA. These include a fixed PAN ID and network key. You may want to run |
Oh, thanks a lot! Didn't think about it. Thats very helpful! |
Hi,
does anyone tried this stick with this library? I am having problem to have it properly initialized.
It does work in zigbee2mqtt software, not here.
I tried to exclude all other factors, so instead of passing it to Home Assistant docker and using in ZHA, I downloaded zigpy-znp library to the host os (Arch Linux) and tried to launch the Energy scan tool.
It cannot even connect to the stick
The error I am getting:
`python -m zigpy_znp.tools.energy_scan /dev/serial/by-id/usb-Silicon_Labs_http:_slae.sh_cc2652-_slaesh_s_iot_stuff_00:12:4B:00:21:A8:EB:55-if00-port0
2020-09-17 20:47:29 SERVER main[4075] INFO Starting up zigpy-znp
2020-09-17 20:47:34 SERVER zigpy.application[4075] ERROR Couldn't start application
Traceback (most recent call last):
File "/home/user/znp/zigpy-znp-dev/zigpy_znp/api.py", line 472, 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/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/user/znp/zigpy-znp-dev/zigpy_znp/tools/energy_scan.py", line 98, in
asyncio.run(main(sys.argv[1:])) # pragma: no cover
File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/user/znp/zigpy-znp-dev/zigpy_znp/tools/energy_scan.py", line 94, in main
await perform_energy_scan(args.serial, num_scans=args.num_scans)
File "/home/user/znp/zigpy-znp-dev/zigpy_znp/tools/energy_scan.py", line 26, in perform_energy_scan
app = await ControllerApplication.new(
File "/home/user/znp/lib/python3.8/site-packages/zigpy/application.py", line 68, in new
await app.startup(auto_form)
File "/home/user/znp/zigpy-znp-dev/zigpy_znp/zigbee/application.py", line 152, in startup
await znp.connect()
File "/home/user/znp/zigpy-znp-dev/zigpy_znp/api.py", line 215, in connect
ping_rsp = await self.request(c.SYS.Ping.Req())
File "/home/user/znp/zigpy-znp-dev/zigpy_znp/api.py", line 472, in request
response = await response_future
File "/home/user/znp/lib/python3.8/site-packages/async_timeout/init.py", line 55, in aexit
self._do_exit(exc_type)
File "/home/user/znp/lib/python3.8/site-packages/async_timeout/init.py", line 92, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError`
@slaesh Would you mind trying to use this library on your own stick?
The text was updated successfully, but these errors were encountered: