walthowd / husbzb-firmware

Nortek GoControl HUSBZB-1 / EM3581 Firmware update image
GNU General Public License v3.0
246 stars 40 forks source link

Exception: <type 'exceptions.TypeError'> /dev/ttyUSB1 #31

Open magic7s opened 3 years ago

magic7s commented 3 years ago

I'm getting a TypeError when trying to scan GoControl HUSBZB-1. Scan fails, the flash seems to complete, but still unable to see anything on zigbee2MQTT.

OS: Raspbian GNU/Linux Buster (10) on Raspberry Pi 3b+

pi@homebridge:~/husbzb-firmware $ python2.7 ./ncp.py scan
Connecting to.. /dev/ttyUSB1 57600 True False
Exception: <type 'exceptions.TypeError'> /dev/ttyUSB1
Connecting to.. /dev/ttyUSB0 57600 True False
^CException: <type 'exceptions.KeyboardInterrupt'> /dev/ttyUSB0
Exception: <type 'exceptions.IndexError'> /dev/ttyAMA0
{"ports": [{"deviceType": "unknown", "pid": "8A2A", "port": "/dev/ttyUSB1", "vid": "10C4"}, {"deviceType": "unknown", "pid": "8A2A", "port": "/dev/ttyUSB0", "vid": "10C4"}, {"deviceType": "unknown", "port": "/dev/ttyAMA0"}]}
pi@homebridge:~/husbzb-firmware $ python2.7 ./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...
pi@homebridge:~/husbzb-firmware $ python2.7 ./ncp.py scan
Connecting to.. /dev/ttyUSB1 57600 True False
Exception: <type 'exceptions.TypeError'> /dev/ttyUSB1
Connecting to.. /dev/ttyUSB0 57600 True False
^CException: <type 'exceptions.KeyboardInterrupt'> /dev/ttyUSB0
Exception: <type 'exceptions.IndexError'> /dev/ttyAMA0
{"ports": [{"deviceType": "unknown", "pid": "8A2A", "port": "/dev/ttyUSB1", "vid": "10C4"}, {"deviceType": "unknown", "pid": "8A2A", "port": "/dev/ttyUSB0", "vid": "10C4"}, {"deviceType": "unknown", "port": "/dev/ttyAMA0"}]}
magic7s commented 3 years ago

Doing a bit of poor mans debugging...

At line 209 the response is ['\x1a', '\xc1', '\x02', '\x0b', '\n', 'R', '~'] which returns isV8 = True.

Then at 441 the response is ['\x12', 'C', '\xa1', '\xa9', '\xfe', '*', '\x15', '\xb5', ',', '\x95', 'L', '"', '\xa2', 'U', '8', '\x95', '\x14', '~']

So 444 returns a <type 'exceptions.TypeError'>

magic7s commented 3 years ago

I was able to solve my actual problem of zigbee2mqtt not working with the HUSBZB device. It was actually the default baud speed in zigbee2mqtt. Here are the settings that worked. I still did not get the firmware version to show, but the upgrade was successful as you can see from my original output. So I don't know if an update was needed or not. Feel free to close this issue, or not.

serial:
  port: /dev/ttyUSB1
  adapter: ezsp
advanced:
  baudrate: 57600
doron1 commented 2 years ago

At line 209 the response is ['\x1a', '\xc1', '\x02', '\x0b', '\n', 'R', '~'] which returns isV8 = True.

Then at 441 the response is ['\x12', 'C', '\xa1', '\xa9', '\xfe', '*', '\x15', '\xb5', ',', '\x95', 'L', '"', '\xa2', 'U', '8', '\x95', '\x14', '~']

So 444 returns a <type 'exceptions.TypeError'>

I'm seeing the exact same situation, with the exact same response from the stick. Any idea as to how to resolve?

B0ndo2 commented 1 year ago

I was able to solve my actual problem of zigbee2mqtt not working with the HUSBZB device. It was actually the default baud speed in zigbee2mqtt. Here are the settings that worked. I still did not get the firmware version to show, but the upgrade was successful as you can see from my original output. So I don't know if an update was needed or not. Feel free to close this issue, or not.

serial:
  port: /dev/ttyUSB1
  adapter: ezsp
advanced:
  baudrate: 57600

I tried this and it is not working for me. It causes the addon to be stuck showing as started but the frontend displays a blank page root@8513c2d0f1e7:/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"}]}