darkxst / ha-operating-system

HAOS for iHost
Apache License 2.0
36 stars 4 forks source link

Zigbee firmware flash countered "Failed to probe running application type" #19

Closed derbirch closed 6 months ago

derbirch commented 6 months ago

The flash for on-board zigged chip would fail with the firmware given in the wiki page at some point. My first attempts worked, but when I started to try other options like other series ports as well as firmwares, they all failed. And I could not get back to the version that once worked.

I figured out that the CRC error I mentioned in HA community should be caused by insufficient power supply, but the Error: Failed to probe running application type remained still.

After the flash, ZHA wizard shows "Failed to connect," when I follow your guide.

Hardware: iHost 2GB version

Here's the log for reference, if you need any further info, I'm glad to help

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service banner: starting

-----------------------------------------------------------
 Add-on: Silicon Labs Flasher
 Silicon Labs firmware flasher add-on
-----------------------------------------------------------
 Add-on version: 0.2.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.1.rc2  (armv7 / tinker)
 Home Assistant Core: 2023.12.3
 Home Assistant Supervisor: 2023.12.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service banner successfully started
s6-rc: info: service universal-silabs-flasher: starting
[09:57:18] INFO: Starting universal-silabs-flasher with /dev/ttyS4 (bootloader baudrate 115200)
2023-12-20 09:57:24 core-silabs-flasher universal_silabs_flasher.flash[150] INFO Extracted GBL metadata: NabuCasaMetadata(metadata_version=1, sdk_version='4.3.2', ezsp_version='7.3.2.0', ot_rcp_version=None, fw_type=<FirmwareImageType.NCP_UART_HW: 'ncp-uart-hw'>, baudrate=115200)
2023-12-20 09:57:24 core-silabs-flasher universal_silabs_flasher.flasher[150] INFO Probing ApplicationType.GECKO_BOOTLOADER at 115200 baud
2023-12-20 09:57:26 core-silabs-flasher universal_silabs_flasher.flasher[150] INFO Probing ApplicationType.EZSP at 115200 baud
2023-12-20 09:57:31 core-silabs-flasher universal_silabs_flasher.flasher[150] INFO Probing ApplicationType.CPC at 460800 baud
2023-12-20 09:57:35 core-silabs-flasher universal_silabs_flasher.flasher[150] INFO Probing ApplicationType.CPC at 115200 baud
2023-12-20 09:57:40 core-silabs-flasher universal_silabs_flasher.flasher[150] INFO Probing ApplicationType.CPC at 230400 baud
2023-12-20 09:57:44 core-silabs-flasher universal_silabs_flasher.flasher[150] INFO Probing ApplicationType.SPINEL at 460800 baud
Error: Failed to probe running application type
[09:57:49] INFO: universal-silabs-flasher-up script exited with code 1
s6-rc: warning: unable to start service universal-silabs-flasher: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service banner: stopping
s6-rc: info: service banner successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
darkxst commented 6 months ago

Which firmware did you flash?

In anycase if the flash was interrupted, you will need to force a bootloader reset. The code for the ihost to do this isnt merged yet but you can find it here:

https://github.com/NabuCasa/universal-silabs-flasher/pull/51

On the ihost you can do this

wget https://codeload.github.com/NabuCasa/universal-silabs-flasher/legacy.tar.gz/pull/51/head -O flasher.tar.gz
tar -xzvf flasher.tar.gz
cd NabuCasa-universal-silabs-flasher-98dc8da

python -m universal_silabs_flasher --device /dev/ttyS4 --bootloader-reset ihost --probe-method bootloader flash --firmware <<new_firmware.gbl>>

However if you are in ssh terminal (addon) you may need to install dependencies also:

python3 -m venv user
. ./user/bin/activate
pip install  --find-links "https://wheels.home-assistant.io/musllinux"  --prefer-binary universal-silabs-flasher
derbirch commented 6 months ago

Which firmware did you flash?

In anycase if the flash was interrupted, you will need to force a bootloader reset. The code for the ihost to do this isnt merged yet but you can find it here:

NabuCasa/universal-silabs-flasher#51

On the ihost you can do this

wget https://codeload.github.com/NabuCasa/universal-silabs-flasher/legacy.tar.gz/pull/51/head -O flasher.tar.gz
tar -xzvf flasher.tar.gz
cd NabuCasa-universal-silabs-flasher-98dc8da

python -m universal_silabs_flasher --device /dev/ttyS4 --bootloader-reset ihost --probe-method bootloader flash --firmware <<new_firmware.gbl>>

However if you are in ssh terminal (addon) you may need to install dependencies also:

python3 -m venv user
. ./user/bin/activate
pip install  --find-links "https://wheels.home-assistant.io/musllinux"  --prefer-binary universal-silabs-flasher

Thankx for the guide!

For your question, I actually forgot which firmware screwed up my setup.

I tried both rcp-uart-802154-v4.3.1-zbdonglee-115200.gbl and ncp-uart-hw-v7.3.2.0-zbdonglee-115200.gbl following your guide. And they all seemed to be flashed 100%, but the flash command did not exit itself. When I type ctr+c, it tells me Aborted!. And I went back to ZHA and Multipotocal addon, they all failed to set up.

Screenshot 2023-12-20 at 16 23 01

Sorry for posting a pic full of text, I can not copy them from WebUI

darkxst commented 6 months ago

I think might be a bug in the GPIO PR that my patches depend on. but you can check if it flashed succesfully afterwards. I suspect its just stuck in bootloader mode.

EDIT: Even though it gets stuck at 100% it appears to have completed successfully

python -m universal_silabs_flasher --device /dev/ttyS4 probe

derbirch commented 6 months ago

I think might be a bug in the GPIO PR that my patches depend on. but you can check if it flashed succesfully afterwards. I suspect its just stuck in bootloader mode.

EDIT: Even though it gets stuck at 100% it appears to have completed successfully

python -m universal_silabs_flasher --device /dev/ttyS4 probe

Thanks! That little cutie worked like a charm! The thread performance is not that ideal though. I tested some Homekit over Thread devices, the Eve Aqua went offline sometimes, but yeah it worked!

darkxst commented 6 months ago

Even though it gets stuck at 100% it appears to have completed successfully

This is just getting stuck waiting for the bootloader menu to reappear after flashing. It has fully completed flashing. I suspect the bootloader on these is buggy and will look at preparing updated bootloader for these.