Sonoffs Zigbee 3.0 USB Dongle Plus Firmware

Be aware if you are using the zwave on the HUSBZB-1 and migrate the zigbee network using ZHA’s functionality, you will have to change the zigbee ieee of the HUSBZB-1 afterwards.

If the HUSBZB-1 is powered the zigbee radio is transmitting, even if not actually in use by any software. When you migrate the HUSBZB-1 zigbee net, its zigbee ieee is copied to the new stick. Two radios with the same zigbee ieee cannot be active at the same time.

Some of the SILabs flashing tools will allow you to change the zigbee ieee on the HUSBZB-1. Just be aware it is a one time irreversible change fo SILabs
chips unless you invest in a jtag programmer.

If I don’t try to migrate the network then the two can coinside peacefully??

Yes. Might be best to put them on different channels, just to minimize any interference issues, but I doubt it would make much difference.

I’d probably keep one setup as ZHA and the other as zigbee2mqtt, if only for testing purposes.

Thanks for the info. I am hoping the new Sonoff will detect the new door sensors properly.

Thanks again

So several things here. Plugging in the Sonoff Dongle it isn’t found by HA. I have tried to Add zigbee2mqtt from the integrations and the store and I am coming up with nothing.

Question Does the Sonoff Dongle require a USB 3.0 ? Is there somewhere in HA that I might need to enable new device sensing?

If I delete the ZHA for the HUSBZB-1 I should be able to set ZHA up to work with the Sonoff , IF I get the HA to recognize it is there at all.

If it weren’t for the fact that I cannot get battery status on these Aquara devices I probably wouldn’t bother

Thanks

Hi all,

need help, I opened a threat here:
ZigBee / ZHA - error/situation - Configuration / Zigbee - Home Assistant Community (home-assistant.io)

and i suppose need to reflash the firmware, in this case it is possible to loose my network?

thx for answer…
Nick

My experience:

  1. My Installation:
    OS Version: Home Assistant OS 10.3
    Home Assistant Core: 2023.7.1
    ttyUSB0
    /dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
  2. Sonoff Zigbee Dongle stopped working around beginning of July 2023
  3. You can check the hardware with Configuration → System → Hardware → All Hardware (Einstellungen → System → Hardware → Gesamte Hardware). This gives also the number of the USB port (in my case 0)
  4. After just opening a Terminal from within Home Assistant website (homeassistant:8123) flashing with @jerrm 's program (see above) worked after updates as described.
  5. The (original) network configuration is active again after firmware update (preserved) without further action.
  6. My steps to update the firmware for the stick as “configurator” using the @jerm 's program but not the entire script

mkdir /config/sonoff_temp
mkdir /config/sonoff_temp/master
cd /config/sonoff_temp/master
wget https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_coordinator_20230507.zip
unzip *.zip
cd …
wget https://github.com/JelmerT/cc2538-bsl/raw/master/cc2538-bsl.py
pip3 install pyserial intelhex
python /config/sonoff_temp/cc2538-bsl.py -evw -p /dev/ttyUSB0 --bootloader-sonoff-usb /config/sonoff_temp/master/coordinator.hex
rm -rf /config/sonoff_temp

1 Like

thx hspiess,

I try to firmware again and is giving error, then did not connect again, delete the old network, and when I connect the stick is found all my device, crazy …

I order new stick Home Assistant SkyConnect and I will try to add to zg2tt… and then I will play with this one…

Anyhow, a lot of devices is disconnecting …

brb with news…

Nick

Just wanted to say thank you for this @jaaem. Worked fine for me, and I’m no developer.

Only real issue I found was that my process was to edit the script I required in Visual Studio and then copy paste it into terminal in HA. When doing this I found it consistently missed the first character. The $ symbol of $1 at the top and then the script autoran as expected. Not sure why but easy enough to work around once I realised.

I have been following this thread.

Yesterday after about 8 months, my ZBDongle-P just stopped working. I have tried to reboot and for a split second the devices come up then everything goes unavailable.

I followed this guide to flash and end up with the following error

Writing 360448 bytes starting at address 0x00000000
ERROR: Timeout waiting for ACK/NACK after ‘Send data (0x24)’

I am running HASSIO as a VM within Proxmox
USB0 - Confirmed
ZHA - Disabled

One note, I plugged in a spare Eero router last night to play with Thread Devices - Not sure if that has something to do with it (interference??). I have removed Eero and powered off all thread devices.
In addition in the past week, I have noticed that new devices I have added would drop.

Anyone with Any thoughts?

I’ve had the exact same error –> I’ve finally managed to upgrade the firmware after all.

First I tried to upgrade using the ZigStar addon in HA → didn’t work:

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: ZigStar TI CC2652P/P7 FW Flasher
 ZigStar TI CC2652P/P7 firmware flasher add-on
-----------------------------------------------------------
 Add-on version: 0.4.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.4  (amd64 / qemux86-64)
 Home Assistant Core: 2024.1.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 cc2652-flasher: starting
[01:54:19] INFO: Starting CC2652P flasher with Sonoff /dev/ttyUSB0
Setting filename to /root/firmware.hex
sonoff
Opening port /dev/ttyUSB0, baud 500000
Reading data from /root/firmware.hex
Your firmware looks like an Intel Hex file
Connecting to target...
pg_rev = 3, protocols = f, wafer_id = 0xbb41
CC135x PG2.0 (7x7mm): 352KB Flash, 20KB SRAM, CCFG.BL_CONFIG at 0x00057FD8
Primary IEEE Address: 00:12:4B:00:2B:48:1C:69
    Performing mass erase
Erasing all main bank flash sectors
    Erase done
Writing 360448 bytes starting at address 0x00000000
 Write 248 bytes at 0x00000000
 Write 248 bytes at 0x000000F8
// CUT //
Write 248 bytes at 0x00011DC8
 Write 248 bytes at 0x00011EC0
ERROR: No response from target on status request. (Did you disable the bootloader?)
[01:54:23] INFO: cc2652-flasher-up script exited with code 1
s6-rc: warning: unable to start service cc2652-flasher: command exited 1
s6-rc: info: service banner: stopping
s6-rc: info: service banner successfully stopped
s6-rc: info: service legacy-cont-init: stopping
/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 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

Then I decided to skip the “middleman” (being the HA instance) and use the python script directly from Proxmox CLI.

Unfortunately, the 0x24 error appeared:

root@s720proxmox:~/cc2538-bsl-master# python3 cc2538-bsl.py -p /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_74af528edd9ced1185ae7afaa7669f5d-if00-port0 -evw --bootloader-sonoff-usb CC1352P2_CC2652P_launchpad_coordinator_20230507.hex 
sonoff
Opening port /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_74af528edd9ced1185ae7afaa7669f5d-if00-port0, baud 500000
Reading data from CC1352P2_CC2652P_launchpad_coordinator_20230507.hex
Firmware file: Intel Hex
Connecting to target...
CC1350 PG2.0 (7x7mm): 352KB Flash, 20KB SRAM, CCFG.BL_CONFIG at 0x00057FD8
Primary IEEE Address: 00:12:4B:00:2B:48:1C:69
    Performing mass erase
Erasing all main bank flash sectors
    Erase done
Writing 360448 bytes starting at address 0x00000000
ERROR: Timeout waiting for ACK/NACK after 'Send data (0x24)'

Reboot didn’t help. Detaching and reattaching the dongle didn’t help.

What helped? I’m not sure, but I disconnected all USB devices from the PC, so that only the dongle was connected. Then I think it started working. I guess something was interfering.

Conclusion:

  • try directly from Proxmox CLI
  • shut down HA instance just to be sure it isn’t using the port
  • maybe try a different USB port
  • disconnect all other USB devices from the machine
  • good luck!
1 Like

Hi,

I have a SONOFF Zigbee 3.0 USB Dongle Plus connected to /dev/ttyUSB0 on my HomeAssistant machine. That’s an Odroid running Home Assistant OS. I thought it should be possible to run this script right on that machine. I connected via SSH, and stopped HA by running ha core stop. Then I ran the script.

First, I had issues that the script was not able to install some Python packages. I was able to resolve that by using a Python Virtual Environment. But now the actual firmware updater exits with the following output:

sonoff
Opening port /dev/ttyUSB0, baud 500000
Reading data from /root/config/zigbee-firmware/tmp/master/CC1352P2_CC2652P_launchpad_coordinator_20230507.hex
Your firmware looks like an Intel Hex file
Connecting to target...
ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'

I read in this thread that this could have to do with some other process still being connected to the USB port. Could it be that stopping HA with the mentioned command is not enough?

I’d love to hear if someone was able to pull off a firmware update this way. Otherwise, I suppose disconnecting the Zigbee Stick from my HA machine and connecting it to my MacBook would be the next thing to try…

@mmattel thanks for sharing your script!
I copy pasted from my mobile phone into a new file via the HA file editor, used the HA terminal to chmod and make it executable, updated the firmware file name to the latest version, disabled ZHA and then used the HA terminal to execute your script. Worked perfectly and one I reenabled ZHA my Sonoff dongle was good to go and running the latest firmware. I’m trying to fix the IKEA Tradfri remote battery drain issue and I hear the newer firmware fixes it.

For reference these steps worked for me on my Windows VirtualBox instance of HAOS. No reboot or anything else required.

1 Like

@bartkummel not sure if my instructions above help in any way but all I did was Disable ZHA and then run the script with HA terminal. Didn’t disable or stop anything else.

1 Like

Thanks for your reply, @JJW.AU! I tried your approach, with only disabling ZHA and letting HA run. This also doesn’t work for me. Output is slightly different compared to my previous attempt:
</s> <s>Opening port /dev/ttyUSB0, baud 500000</s> <s>Reading data from /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_04630975aec9eb11bf748d4f1d69213e-if00-port0</s> <s>Cannot auto-detect firmware filetype: Assuming .bin</s> <s>Connecting to target...</s> <s>ERROR: device reports readiness to read but returned no data (device disconnected or multiple access on port?)</s> <s>

Scratch that. I made an error editing the script. Your approach actually did work, when I corrected that! Thanks a lot!

For future reference, I’ll try to summarize this thread:

Two different dongles

First of all, it’s important to acknowledge that Sonoff sells two different dongles with almost the same name and almost the same housing. This thread is only about the “P” dongle. Don’t try to update an “E” dongle with the information from this thread! For completeness:

(If you follow any of the two links, the page will have a handy comparison table of both sticks.)

Different update mechanisms

Searching the internet, you’ll find different ways of updating the firmware of the Sonoff P dongle:

  • One involving taking apart the dongle and using specific I/Os to put it in.
  • One involving a GUI tool.
  • One involving some scripts.

All of these method are also referenced in this thread. I did only test the third option, so the remainder of this post will discuss that.

Updating the firmware with scripts

Prerequisites

For this approach, you can leave the dongle attached to your Home Assistant machine. I tested it with Home Assistant OS, I ran the script while logged in to HA OS via SSH. To be able to SSH to your HA machine, you need to install the SSH addon.

To be clear: I tested with a pre-installed image of Home Assistant, I believe this is called a “supervised” installation, but I’m not entirely sure about the right terminology here.

Step 1. Preparing the script

  1. Copy the contents of this file, and paste them into a new file, e.g. in your config directory. For the remainder of the instructions, let’s assume you call that file firmware_sonoff.sh.
  2. Make the script executable, typing the following command in the shell while logged in to your HA machine:
    chmod ug+x firmware_sonoff.sh
    

Step 2. Python virtual environment

  1. Create a Python virtual environment, using the following command:
    python3 -m venv ./venv-for-firmware-update
    
    This will create the virtual environment in a subdirectory of the current directory.
  2. Activate the virtual environment:
    ./venv-for-firmware-update/bin/activate
    
  3. Edit the firmware_sonoff.sh script from step 1 to use the Python version from the virtual environment. To do so:
    • replace all occurences of python with /path/to/venv-for-firmware-update/bin/python. In my case that was /root/config/venv-for-firmware-update/bin/python.
    • replace all occurences of pip with /path/to/venv-for-firmware-update/bin/pip.

Step 3. Disable ZHA

Before running the script, you should disable the ZHA integration, to prevent it from accessing the dongle during the update process.

Step 4. Run the script

Run the script with the right arguments. If you’re not sure about the arguments, run the script without any arguments and it will print a short usage message.

Victory!

A successful run of the script should end with something like this:

Opening port /dev/ttyUSB0, baud 500000
Reading data from /root/config/zigbee-firmware/tmp/master/CC1352P2_CC2652P_launchpad_coordinator_20230507.hex
Your firmware looks like an Intel Hex file
Connecting to target...
CC1350 PG2.0 (7x7mm): 352KB Flash, 20KB SRAM, CCFG.BL_CONFIG at 0x00057FD8
Primary IEEE Address: --8<---snip--->8--
    Performing mass erase
Erasing all main bank flash sectors
    Erase done
Writing 360448 bytes starting at address 0x00000000
Write 104 bytes at 0x00057F988
    Write done
Verifying by comparing CRC32 calculations.
    Verified (match: 0xe83aa727)

Don’t forget to re-enable the ZHA integration!

I hope this is helpful to anyone. It will at least be helpful to a future me… :wink: Let me know if anything is unclear or if I made an error in my description. (I didn’t make notes when I did all this, so I wrote this up afterwards from the top of my head…)

3 Likes

Could you add a paragraph talking about the requirements for the third method? I suppose you would need a linux machine (any kernal requirements?) and the USB dongle being connected directly to the linux…? Or are we saying all those scripts can be done inside an HAOS…?

Hi @k8gg ,

Thanks for your suggestion! I’ve done this on my HAOS machine directly. I thought I mentioned that, but I’ll see if I can make it more clear.

Best,
Bart

How is the approach if using the pre-configured image from HA for the Raspi?
SSH is limited to that environment as not everything is exposed?

Thanks

@h3rb3rt Using the pre-installed HA image is exactly what I did! You need to install the SSH addon, it will give you the access you need. Will add that to my post, thanks for pointing out this was not clear.