Skip to content
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

Web flasher fails to connect to ZBDongle-E with router firmware #172

Open
ditschi opened this issue Jan 9, 2025 · 4 comments
Open

Web flasher fails to connect to ZBDongle-E with router firmware #172

ditschi opened this issue Jan 9, 2025 · 4 comments

Comments

@ditschi
Copy link

ditschi commented Jan 9, 2025

I used the Web Flasher to flash the router firmware on my ZBDongle-E. Using 'Custom firmware' that was easy and straight forward. 👍

When connecting the dongle to a USB Power supply I can also add the router to my zigbee2mqtt which tells me the Device is functional and running as intended.

When trying to convert back from router to the coordinator firmware the Flasher is failing to connect to the device. (See full attached log: silabs_flasher.log)

i guess this is the issue

DEBUG Failed to parse frame bytearray(b'\x80\x98\x06\x06x\x06\x06')
Traceback (most recent call last):
  File "/lib/python3.11/site-packages/bellows/ash.py", line 473, in data_received
    frame = parse_frame(data)
            ^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bellows/ash.py", line 353, in parse_frame
    return frame.from_bytes(data)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bellows/ash.py", line 222, in from_bytes
    control, data = cls._unwrap(data)
                    ^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/bellows/ash.py", line 159, in _unwrap
    raise ParsingError(
bellows.ash.ParsingError: Invalid CRC bytes in frame bytearray(b'\x80\x98\x06\x06x\x06\x06'): expected 9719, got 0606

It would be great if the Flasher would support to convert a custom firmware back to a "known" one

@ditschi ditschi changed the title Webflasher fails to connect to ZBDongle-E with router firmware Web flasher fails to connect to ZBDongle-E with router firmware Jan 9, 2025
@darkxst
Copy link
Owner

darkxst commented Jan 9, 2025

Its not possible for the flasher to support this directly with Sonoff builds. You need to either:

  • On Linux, use universal-silabs-flasher with option --bootloader-reset sonoff
  • Or disassemble and use physical boot button to trigger bootloader, while running the webflasher.

@LinusCDE
Copy link

LinusCDE commented Feb 3, 2025

Its not possible for the flasher to support this directly with Sonoff builds. You need to either

Huge thanks! This saved my rear! I had purchased a 2nd dongle and flashed the router fw on it, not realizing that going back to coordinator might not be as easy as going Coordinator -> Router.

Note for future travellers finding them selves here as well:

  • universal-siliabs-flasher seems to not work as of this time (pip release). It can probe the stick in router mode, but flashing fails because of an exeeded "PROBE_TIMEOUT" (raising it from 2 to 5 didn't help either). Might be fixed in future, so pay attention to the date of this comment.

  • Disassembling and using the boot button worked like a charm. Make sure to hold down the boot button while plugging in. The green led should not light up then. After that the device showed up in the web flasher as "Bootloader (recovery)" and flashing worked perfectly well. 👍

@LinusCDE
Copy link

LinusCDE commented Feb 3, 2025

Actually, using the universal-silabs-flasher, is possible. Just a different command.

I brought the issue up at their repo (NabuCasa/universal-silabs-flasher#97) and puddly troubleshooted and explained/fixed it very quickly.

See the linked issue for more. Quoting puddly (NabuCasa/universal-silabs-flasher#97 (comment)):

The issue arises because the flasher only ever considers using the hardware bootloader trigger if there is no software trigger. So far, the ITEAD router firmware is the only firmware that's unable to be software triggered (as in, you're stuck with the firmware that's running).

You can bypass this by instructing the flasher to not try probing the stick and just flash: --probe-method bootloader.
[...]

I was able to succesfully flash back the coordinator firmware while the device had the router fw, using this command: universal-silabs-flasher --probe-method bootloader --bootloader-reset rts_dtr --device /dev/ttyUSB0 flash --firmware Downloads/ncp-uart-sw_EZNet7.4.4_V1.0.0.gbl

So no need to open the device up after all. 🎉

@darkxst
Copy link
Owner

darkxst commented Feb 3, 2025

yes --bootloader-reset for Sonoff dongles has been around for a long time, I just havent as yet integrated this into web flasher, but may eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants