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

Hang after reboot to bootloader with default HUSBZB-1 firmware #33

Open
henryptung opened this issue Sep 26, 2021 · 20 comments
Open

Hang after reboot to bootloader with default HUSBZB-1 firmware #33

henryptung opened this issue Sep 26, 2021 · 20 comments

Comments

@henryptung
Copy link

henryptung commented Sep 26, 2021

When using ncp.py flash script with an unupdated/original HUSBZB-1 firmware/bootloader, I get a hang at:

# ./ncp.py flash -p /dev/ttyUSB1 -f ncp-uart-sw-6.7.8.ebl
Restarting NCP into Bootloader mode...
CEL stick
EM3581 Serial Bootloader v5.4.1.0 b962

and it hangs forever in that state until Ctrl-C'd. After much debugging and tweaking of the script, figured out the patch to make it work in my case:

    # Open new connection
    ser = serial.Serial(
        port=port,
        baudrate=115200,
        parity=serial.PARITY_NONE,
        stopbits=serial.STOPBITS_ONE
    )

My stick needed no flow control at all (either hardware or software), and the xonxoff=True flag in the bootloader connection was causing it to hang when waiting for 1 to be echoed back. Testing with minicom indicated disabling software flow control would make it work.

Not sure if that's an ideal fix or if setting rtscts=True might have also worked/been preferable, but my stick is now updated and I'm not planning to reflash.

Putting this here in case this helps other people or this could help improve the flasher script.

@MattWestb
Copy link

MattWestb commented Sep 26, 2021

Great findings !!

Wot i knowing is all "standard" Silabs bootloaders (EM35X and EFR32) if not cooking one self with other settings is using no flow control and baudrate 115200.

@travisghansen
Copy link

Yes, thank you for sharing..I hit this exact issue!

@mloffer
Copy link

mloffer commented Nov 14, 2021

I also ran into this going from 6.6.5 -> 6.7.8. Removing xonxoff from the script did the trick.

@CTOJoe
Copy link

CTOJoe commented Nov 26, 2021

Was experiencing the same issue. Removing xonxoff from the # Open new connection block fixed the issue for me.

@dkmcgowan
Copy link

this happened to me as well, I changed the same line to disable xonxoff just for the one connection where it was not using the CEL variable for xonxoff, seems to have worked fine for me

@thechickenmoo
Copy link

thechickenmoo commented Mar 27, 2022

Same. Had to unplug/replug the adapter after my initial hang/fail, restart the docker container, install nano (apt-get install nano) and modify the file (nano ./ncp.py).
I also mistakenly edited the wrong section the first time. (#Init Serial Port Section instead of #Open New Connection)

This did indeed fix the problem.

@lefebp
Copy link

lefebp commented Mar 31, 2022

Had the same issue, commenting xonxoff=True also worked for me.

Thank you!

@techguydave
Copy link

Just chiming in to say this fix also worked for me!

@brandon-dacrib
Copy link

+1 same fix today, can I submit a PR so that the next person doesn't have this problem?

@btyeung
Copy link

btyeung commented May 22, 2022

+1 also worked for me, linux (kubuntu) with nortek

@GroupeFMY
Copy link

WOW thanks waisted so much time before finding this little info. Thanks works a1

@mwpastore
Copy link

Oh man, I thought I had a bad flash and I've been trying to short those two frustratingly tiny pads for the past hour to get into the bootloader via minicom. I got it to flash after this patch... thank you!

@instantdreams
Copy link

This fixed the issue for me. Here's the commands I used:

$ docker run --rm --device=/dev/ttyUSB1:/dev/ttyUSB1 -it walthowd/husbzb-firmware bash
# apt install nano
# nano ./ncp.py

Locate function flash and find comment # Open new connection
Commend out line xonxoff=True
Exit and write buffer

# ./ncp.py scan
Connecting to.. /dev/ttyUSB1 57600 True False
{"ports": [{"port": "/dev/ttyUSB1", "vid": "10C4", "pid": "8A2A", "deviceType": "zigbee", "stackVersion": "5.4.1-194"}]}

# ./ncp.py flash -p /dev/ttyUSB1 -f ncp-uart-sw-6.7.8.ebl
Restarting NCP into Bootloader mode...
CEL stick
EM3581 Serial Bootloader v5.4.1.0 b962

Successfully restarted into bootloader mode! Starting upload of NCP image...
Finished!
Rebooting NCP...

# ./ncp.py scan
Connecting to.. /dev/ttyUSB1 57600 True False
{"ports": [{"port": "/dev/ttyUSB1", "vid": "10C4", "pid": "8A2A", "deviceType": "zigbee", "stackVersion": "6.7.8-373"}]}

Success!

@quincarter
Copy link

i can confirm this works. Just follow what these people have said. :) Thanks a bunch. I was hung up here. Glad i dove into the issues section.

root@d74e4d43563d:/tmp/silabs# ./ncp.py flash -p /dev/ttyUSB1 -f ncp-uart-sw-6.7.8.ebl
Restarting NCP into Bootloader mode...
CEL stick
EM3581 Serial Bootloader v5.4.1.0 b962

Successfully restarted into bootloader mode! Starting upload of NCP image...
Finished!
Rebooting NCP...
root@d74e4d43563d:/tmp/silabs# ./ncp.py scan
Connecting to.. /dev/ttyUSB1 57600 True False
{"ports": [{"port": "/dev/ttyUSB1", "vid": "10C4", "pid": "8A2A", "deviceType": "zigbee", "stackVersion": "6.7.8-373"}]}

@derekgorcz
Copy link

Also worked for me. Rather than installing nano or vim, you can also use the already installed sed to delete the line(for me 322).

  1. You can verify line number with this command:
root@cc611c1f6039:/tmp/silabs# sed -n 322p ncp.py 
        xonxoff=True
  1. If you see the "xonxoff=True" response, delete it with:
root@cc611c1f6039:/tmp/silabs# sed -i 322d ncp.py 
  1. Verify the delete worked:
root@cc611c1f6039:/tmp/silabs# sed -n 322p ncp.py 
    )
  1. Run the script as documented.

@quietsnow
Copy link

quietsnow commented Apr 8, 2023

I have the Home Assistant Blue, so I had to add a number of packages (in working memory, since it runs on Alpine Linux). Here are the series of commands that got this working (and of course, I had to comment out line 322 from 'ncp.py' that used to say 'xonxoff=True' along w/ the ',' in the line above - thank you, this was key)...

git clone https://github.com/walthowd/husbzb-firmware.git && cd husbzb-firmware
apk update
apk add python3
apk add python3 py3-pip
apk add py3-pyserial
pip3 install xmodem
ln -s /usr/bin/python3 /usr/bin/python
./ncp.py scan
./ncp.py flash -p /dev/ttyUSB1 -f ncp-uart-sw-6.7.8.ebl

And then a simple reboot and all those things disappear and after a while it all comes back up and works beautifully. Thanks again!

@samuelmcconnell
Copy link

Another note that ncp.py was hanging when attempting to restart the stick into bootloader mode, and commenting out xonxoff allowed me to flash the firmware successfully.

@fireheadman
Copy link

+1 worked for me also....

@xanderphillips
Copy link

I have had issues with the USB port not apparently providing enough power causing it to not work. Using a powered hub seems to address the issue quite well.

@jeremyforest
Copy link

+1 worked for me also

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