Sonoffs Zigbee 3.0 USB Dongle Plus Firmware

Too much assumption folks here know the open source development terms.

A pull request is a “request” to the HA devs that they “pull” code from your repository into Home Assistant.

In this case it would not be computer code, but just documentation text. The same platform (github) supports both in HA’s case. See Home Assistant · GitHub.

Probably too much to expect a casual user to get into the intricacies of learning all that’s necessary, but I guess it doesn’t hurt to ask.

1 Like

LOL it’s a github thing. It’s how to suggest changes to code or documentation on github.

Thanks for the elaboration, folks… and apologies for lowering the tone there.

No apologies needed. Assumptions “everyone’s a dev” is a common problem in open source communities.

9 Likes

The apology was for suggesting the alternative meaning for ‘pull request’.

Documentation pulls are a lot easier than code pulls.

2 Likes

Great! working fine for me … many thankx …

Hi All,

If you are using MAC or Linux please see this:

I ran into this topic wanting to upgrade the firmware, and made it easier for myself for the next time :slight_smile:

If you run into anything let me know.

3 Likes

@belastingvormulier Thank you for your script! It worked very well. On my mac it made some problems at first, probably again because of the m1, but on my debian (proxmox) server it worked without problems. (At least after i looked what the requirements were and installed them :wink: )

1 Like

Using this on Arch, after hitting y to proceed I get:

# Get device ready for flashing:
This is a debug log
This is an info log
This is critical
An error occurred

/dev/ttyUSB0 - Sonoff Zigbee 3.0 USB Dongle Plus
选择串口(输入串口序号即可):

Hit enter after this, and supplied the dongle’s address (that same /dev/ttyUSB0) and hit enter again:

# Please supply the serial port again:
/dev/ttyUSB0
# Flashing the device:
sonoff
Opening port /dev/ttyUSB0, baud 500000
Reading data from CC1352P2_CC2652P_launchpad_coordinator_20220219.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:24:C1:73:A4
    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: 0xddfc152d)
# Cleaning up env, Till next time!

…and everything seems to have worked on three dongles, just a little confusing on the output. Thanks regardless!

Hi There,

Glad It worked, The output is indeed MEH at best… But the reason is that I wanted to keep things as “Original” as possible ( I do not have evil intentions, but you never know :wink: ) now you can easily verify the sources and stuff!

Hey all, I’m trying to use the script above but I’m getting a timeout. The dongle shows up as /dev/tty/ACM0 also but neither port seems to work. I have the E variant of the dongle.

# Please supply the serial port again:
/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220811144022-if00
# Flashing the device:
sonoff
Opening port /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220811144022-if00, baud 500000
Reading data from CC1352P2_CC2652P_launchpad_coordinator_20220219.hex
Firmware file: Intel Hex
Connecting to target...
ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'
# Cleaning up env, Till next time!

I didn’t actually use /dev/serial or /dev/tty/ for mine. The script scanned the ports and displayed the exact text I needed to type in. In my case it was

/dev/ttyUSB1

note there’s no / inbetween tty and USB, and USB needed to be in caps to match the output the script gave me

1 Like

Mine mapped to /dev/ttyACM0 but that didn’t work for the script. It’s working fine in Zigbee2MQTT but I can’t get the firmware update. I suppose I can probably leave it as is for now.

I have taken the bash script from @jerrm (see above, May 12th) as base and enhanced it including several checks for ease of use. In the meanwhile from when he created that script, the router and the dev firmare has been removed from z2m. This caused the original script to fail.

With the new changes incorporated, steps are now modular and can easily be commented for testing, You can also quickly identfy the USB port used, repsectively the script denies flashing if no Sonoff stick is connected. I also took care that the pip dependencies are handled by the bash script (and are then only checked by the python flasher) so you are in better control of these.

I can state that flashing my Sonoff using the new script was a no brainer. For all who are interested, you can download it at: firmware_sonoff.sh (dont forget to make it executable :grinning:)

If there will be once a new firmware, adapting the script is quite easy as you - as far I have understood the upgrade process - only need to fix the downloaded firmware filename.

6 Likes

A big step above my notes in script form.

Try this to pull down the current versions without needing to edit urls.

Consider it untested pseudo code. I did a quick check on the snippets, but not in context of the whole script.

download_firmware () {
    # https://github.com/Koenkk/Z-Stack-firmware

    cd $basepath/$tmp
    git clone https://github.com/Koenkk/Z-Stack-firmware.git
    if [ $1 == "dev" ]; then
      git -C Z-Stack-firmware checkout develop
    fi
    for f in Z-Stack-firmware/$2/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_$2_*.zip
    do
      unzip $f
    done
}
flash_firmware () {
    # for more options see: https://github.com/JelmerT/cc2538-bsl#cc26xx-and-cc13xx
    python $basepath/$tmp/cc2538-bsl.py -evw -p \
        /dev/ttyUSB$3 \
        --bootloader-sonoff-usb \
        $basepath/$tmp/*.hex
}
1 Like

I had the same issue. I’ve read in a different post that the serial channel might be used by other applications.

I’ve stopped home assistant

ha homeassistant stop
<<do patching here>>
ha homeassistant start

Be sure to check you have the updated script. This flag should be in the flash_firmware() function
--bootloader-sonoff-usb

Same issue here, works fine in Z2M, but I cannot update firmware.

Z2M is not running, I’ve tried it with designating port:

sudo python3 cc2538-bsl.py -ewv -p /dev/ttyUSB0 --bootloader-sonoff-usb ./CC1352P2_CC2652P_launchpad_coordinator_20221226.hex

and without designating port:

sudo python3 cc2538-bsl.py -ewv --bootloader-sonoff-usb ./CC1352P2_CC2652P_launchpad_coordinator_20221226.hex

Also tried doing both with jusy ‘python’ vs ‘python3’ and get ACK/NACK error, also tried it on two widnows machines, same timeout errors.

I have the Sonoff Dongle Plus-E

/dev/ttyUSB0 designates a port in linux, under Windows it will be something like COM3, however you have to make sure you have the drivers installed. This video helped me:

Flashing Sonoff Zigbee Dongle Plus in Windows (Python Method) - YouTube

Caveat: I have the -P version of the dongle, but I don’t think that matters

2 Likes

“P” vs “E” makes all the difference. Different chips, different firmware, different methods, different tools.

cc2538-bsl is a tool for the TI chip in the ZBDongle-P.

See @Hedda’s ZBDongle-E post for links to tools and firmware for the SI Labs based ZBDongle-E.

2 Likes