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

Upgrade hangs at "CEL stick" step #15

Open
eric72777 opened this issue Jan 23, 2021 · 6 comments
Open

Upgrade hangs at "CEL stick" step #15

eric72777 opened this issue Jan 23, 2021 · 6 comments

Comments

@eric72777
Copy link

I was unable to upgrade a HUSBZB-1 (5.4.1-192) using the docker image. Restarting the computer and unplugging and re-plugging the stick didn't fix the issue.

sudo docker run --rm --device=/dev/ttyUSB1:/dev/ttyUSB1 -it walthowd/husbzb-firmware bash

cd /tmp/silabs

./ncp.py scan
Connecting to.. /dev/ttyUSB1 57600 True False
{"ports": [{"stackVersion": "5.4.1-194", "deviceType": "zigbee", "pid": "8A2A", "port": "/dev/ttyUSB1", "vid": "10C4"}]}
./ncp.py flash -p /dev/ttyUSB1 -f ncp-uart-sw-6.6.5.ebl
Restarting NCP into Bootloader mode...
CEL stick
^CTraceback (most recent call last):
File "./ncp.py", line 459, in
flash(args.port,args.file)
File "./ncp.py", line 310, in flash
ser.readline() # read blank line
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 565, in read
ready, _, _ = select.select([self.fd, self.pipe_abort_read_r], [], [], timeout.time_left())
KeyboardInterrupt

@ajmath
Copy link

ajmath commented Feb 20, 2021

I'm seeing the same issue.

@MikePaer
Copy link

MikePaer commented Apr 7, 2021

Same problem here. Also, running the docker run main command just hangs. Has anyone figured this out?

@sreknob
Copy link

sreknob commented Apr 7, 2021

The next step in the script is the initialization of the serial port which might be failing... for me re-plugging fixed it.
If you can open up your stick, try the firmware recovery instructions in the readme as a work around. It's actually quite easy to do it that way.
The other thing you could try is another linux environment. If you clone the repo and install python 2.7, pyserial and xmodem, you can use the python script outside of a container. I've done this on just a raspberry-pi rather than running the docker image.

@MikePaer
Copy link

MikePaer commented Apr 8, 2021

Thanks for the pointers. Tried running the Python script outside the container and on a different machine, neither worked. I didn’t try the firmware recovery, and instead replaced my HUSBZB-1 device assuming it was defective. The new device worked right out of the box with no issues. I think I just had a lemon.

@C2BB
Copy link

C2BB commented Aug 16, 2022

Thanks @sreknob your tip on unplugging the stick solved the issue for me.

@BHSPitMonkey
Copy link

BHSPitMonkey commented Apr 9, 2023

Having the same issue today with one of my HUSBZB-1 devices. Note that I am commenting out xonxoff=True as a workaround for the other issues reported in different threads (this has helped me flash another device previously), but in this case the failure occurs either way.

Here's some strace output indicating what's going on behind the pyserial readline() call that never finishes (never sees a \n appear):

husbzb-firmware/ncp.py

Lines 296 to 299 in 12de988

# EZSP protocol initialization
if ezspV8Init(ser)!=NO_ERROR and ezspV7Init(ser)!=NO_ERROR and ezspV6Init(ser)!=NO_ERROR and ezspV5Init(ser)!=NO_ERROR and ezspV4Init(ser)!=NO_ERROR:
print('NCP no ZigBee Ack. Please try again.')
sys.exit(1)

write(3, "\32\3008\274~", 5)            = 5
read(3, "\32\301\2\v\nR~", 7)           = 7
write(3, "\0B!\250\\,\240~", 8)         = 8
read(3, "\1B\241\250P(\5\346\177b~", 11) = 11
write(3, "\201`Y~", 4)                  = 4
write(3, "\32\3008\274~", 5)            = 5
read(3, "\32\301\2\v\nR~", 7)           = 7
write(3, "\0B!\250S\335O~", 8)          = 8
read(3, "\1B\241\250P(\5\346\177b~", 11) = 11
write(3, "\201`Y~", 4)                  = 4
write(3, "\32\3008\274~", 5)            = 5
read(3, "\32\301\2\v\nR~", 7)           = 7
write(3, "\0B!\250R\315n~", 8)          = 8
read(3, "\1B\241\250P(\5\346\177b~", 11) = 11
write(3, "\201`Y~", 4)                  = 4
write(3, "\32\3008\274~", 5)            = 5
read(3, "\32\301\2\v\nR~", 7)           = 7
write(3, "\0B!\250Q\375\r~", 8)         = 8
read(3, "\1B\241\250P(\5\346\177b~", 11) = 11
write(3, "\201`Y~", 4)                  = 4
write(3, "\32\3008\274~", 5)            = 5
read(3, "\32\301\2\v\nR~", 7)           = 7
write(3, "\0B!\250P\355,~", 8)          = 8
read(3, "\1B\241\250P(\5\346\177b~", 11) = 11
write(3, "\201`Y~", 4)                  = 4

husbzb-firmware/ncp.py

Lines 296 to 299 in 12de988

# EZSP protocol initialization
if ezspV8Init(ser)!=NO_ERROR and ezspV7Init(ser)!=NO_ERROR and ezspV6Init(ser)!=NO_ERROR and ezspV5Init(ser)!=NO_ERROR and ezspV4Init(ser)!=NO_ERROR:
print('NCP no ZigBee Ack. Please try again.')
sys.exit(1)

write(3, "}1C!'Un\220~", 9)             = 9

husbzb-firmware/ncp.py

Lines 309 to 311 in 12de988

# Read response bytes
ser.read(8)
ser.close()

read(3, "\22C\241'T\2539~", 8)          = 8

husbzb-firmware/ncp.py

Lines 316 to 326 in 12de988

# Open new connection
ser = serial.Serial(
port=port,
baudrate=115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
xonxoff=True
)
# Burn the prompt
ser.write(b'\x0A')

write(3, "\n", 1)                       = 1

husbzb-firmware/ncp.py

Lines 327 to 330 in 12de988

# Boot menu - legacy or Gecko bootloader?
# Gecko BL verion at 2nd line
# Legacy BL verion at 3rd line
ser.readline() # read blank line

read(3, "\230", 1)                      = 1
read(3, "`", 1)                         = 1
read(3, "\0", 1)                        = 1
read(3, "\30", 1)                       = 1
read(3, "\30", 1)                       = 1
read(3, "\236", 1)                      = 1
read(3, "x", 1)                         = 1
read(3, "\376", 1)                      = 1
read(3, "\206", 1)                      = 1
read(3, "\376", 1)                      = 1
read(3, "\6", 1)                        = 1
read(3, "\340", 1)                      = 1
read(3, "\6", 1)                        = 1
read(3, "\340", 1)                      = 1

(At this point the script hangs indefinitely and there's no more reads/writes. Pyserial waits indefinitely for a newline character but only receives the unexpected data shown in the strace above.)

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

6 participants