Flash Sonoff Zigbee 3.0 USB Dongle Plus With Python For Use In Home Assistant | pt8

Sdílet
Vložit
  • čas přidán 25. 08. 2024
  • In this video I'm looking at flashing the Sonoff Zigbee 3.0 USB Dongle Plus which is a fantastic piece of kit and comes ready to use out of the box. However I'm going to flash it with the latest firmware using Python, which you might find easier than dismantling the dongle to flash it, and gives you access to the latest functionality and lets you support a greater number of devices.
    This is a step by step video and at the end I'll show you how to get the dongle set up in Home Assistant using Mosquitto MQTT broker and Zigbee2MQTT before I finally add in some of my Aqara Zigbee devices.
    Links to downloads can be found below 👇
    Remember to SUBSCRIBE to the channel so you don't miss future content
    SUPPORT THE CHANNEL 🙌
    Buy Me a Coffee: www.buymeacoff...
    READ MORE 🌐
    My Website: www.byteofgeek...
    YOU CAN FIND ME ON 👍
    Twitter: / byteofgeek
    Instagram: / byteofgeek
    Facebook: / byteofgeek
    #byteofgeek #technology #homeassistant #homeautomation #smarthome #zigbee
    Some of the links above may be affiliate links in which I receive a small commission if you click on the link and purchase an item. You're not obligated to use these links but if you do then it does help fund the channel to bring extra content to you!
    The following is the download links and commands to go with the video.
    Python
    www.python.org...
    Device Drivers
    www.silabs.com...
    Backup Dongle
    python -m pip install --upgrade pip
    pip install wheel pyserial intelhex python-magic
    pip install zigpy-znp
    python -m zigpy_znp.tools.nvram_read COM3 -o nvram_backup.json
    Bootloader
    github.com/Jel...
    Z Stack Firmware
    github.com/Koe...
    Flash Dongle
    python cc2538-bsl.py -p COM3 -e -v -w --bootloader-sonoff-usb CC1352P2_CC2652P_launchpad_coordinator_20220219.hex
    Zigbee2MQTT Repository
    github.com/zig...

Komentáře • 126

  • @Byteofgeek
    @Byteofgeek  Před 2 lety +6

    Do you think this is easier than taking the Sonoff dongle apart? Let me know down below and if you enjoyed the video then don't forget to LIKE and SUBSCRIBE to the channel 👍

    • @gzcwnk
      @gzcwnk Před 2 lety +1

      I did it your way then tried the router install via the take it apart way. Your way worked first time but it took me a handful of goes the button way, to get the router firmware going. a right pain in the a**.

    • @Alec_99
      @Alec_99 Před rokem

      works like a charm, exelent explanation and good documentation!!
      This was a life saver for me, thanks 😃

    • @davidquirk8097
      @davidquirk8097 Před 11 měsíci +1

      Absolutely! I've tried several other methods and could never get the Dongle into Bootloader mode. I tried other Python methods but your description was thorough and complete and worked straight off.
      I really appreciate the effort you put into making this video both clear and concise.

    • @Byteofgeek
      @Byteofgeek  Před 11 měsíci

      @@davidquirk8097 thanks for the feedback and glad it helped you out 👍

    • @gyroggearloose
      @gyroggearloose Před 10 měsíci +1

      Thank you so much!
      I had no luck flashing with the TI flash programmer, this video was exactly what I needed to get my momentum back!

  • @nibblesd.biscuits4270
    @nibblesd.biscuits4270 Před rokem +1

    Thank you, I tried a half dozen tutorials before I found yours. They all failed and were hard to follow.
    Yours was successful and detailed. You may include the command line texts as it goes by fast and is hard to read but I was able.
    thanks again.

  • @PandaPowerable
    @PandaPowerable Před 2 lety +1

    The first time I watched this I thought it sounded and looked so complicated I could never do it, but I did it and it works! I did get stuck with the 502 bad gateway thing and gave up and went to bed, but now I'm up and it works....I guess it just needed more time. Thank you so much for this tutorial and your thorough and clear explanation! 🙂

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Cool, glad it's all working for you 👍

  • @bat3332
    @bat3332 Před 2 lety +1

    man you had no idea how many vidoes i went and searched and before i came across this life saver video. Thank you

  • @bandicoot99
    @bandicoot99 Před rokem

    That was really good. I spend hours trying to flash my sonoff dongle. Found your video and I was done in 5 minutes. A few coffees sent your way. Cheers.

    • @Byteofgeek
      @Byteofgeek  Před rokem

      Glad it helped and thanks for the support 👍

  • @jakubkulig8963
    @jakubkulig8963 Před 2 lety +1

    Great tutorial! Explains everything step by step and it's easy to follow. I tried two other tutorials on YT but this is actually the first one that got me all the way through. That hint about setting mqtt IP address in Z2M really helped. Adding zigbee devices is now a breeze and I can finally put those old aqara gateways to rest or use them as a doorbell/night lamp. Thank you sir! You saved my day.

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Thanks for the feedback Jakub, glad it helped you get set up 👍

  • @KrispKiwi
    @KrispKiwi Před rokem +1

    Just came back to this after a fresh install of home assistant to fix the dongle, still fixing my Z2M issues as always

  • @iTomAnks
    @iTomAnks Před rokem

    Thanks so much! I couldn't get the Texas Instruments Flasher software to flash my device, but this worked perfectly.

  • @jamesitube
    @jamesitube Před rokem

    Thanks! For whatever reason that I'll never know, I wasn't permitted to download that other flashing software so thank you kindly for showing another way.

    • @Byteofgeek
      @Byteofgeek  Před rokem

      Good to hear and thanks for watching 👍

  • @Johannes-ol4pn
    @Johannes-ol4pn Před měsícem

    Thanks, got an nvram error on my HomeAssistant ZHA integration and the manual bootloader method did not work. With your description I was able to reflash the Sonoff stick and my ZHA Integration ist ready to work directly again!

    • @Byteofgeek
      @Byteofgeek  Před měsícem

      Great news, glad it helped 👍

  • @slightbleeding
    @slightbleeding Před rokem

    Many many thanks for this super manual. This was the first that really works simple

  • @dannydigtl
    @dannydigtl Před 2 lety +2

    Thanks for this. Worked perfectly on a Mac. I installed python, installed pip, downloaded those scripts, found my dev (mine was /dev/cu.serialusb-210), ran your commands and it all worked. Thanks

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Hey good to hear, seems pretty straightforward on a Mac 👍

  • @ScottSchramm
    @ScottSchramm Před rokem +2

    I had troubles at the pip install zigpy-znp step, it would error out at failed building wheel for multidect and the fix was to install Microsoft Visual Studio. I think it has something to do with C# or C++ and it needs those in order to do the install. After that I got stuck at the next step when I tried to do the backup from COM4 in my case, it kept saying there were errors in the py script, something about AttrubuteError, create pseudo member. At this point I gave up and will try the GUI based flash with the software from TI.

    • @graafalard1408
      @graafalard1408 Před rokem +1

      Im having the exact same issues. :(

    • @rong2578
      @rong2578 Před rokem +1

      I was having the same problems. I had to uninstall Python and install an older version. I used Python 3.9.13. Same website but under Python Releases for Windows

  • @MindMonkeyFTW
    @MindMonkeyFTW Před rokem +1

    Do you happen to know whether I can flash a dongle as a router and plug that one into a random USB port in my house? In an attempt to extend my network range.

  • @totolo4437
    @totolo4437 Před 6 měsíci

    Thanks for the video! I made a mistake and got a synch error, doyou know what the command to use the zigpy backup would be ?

  • @Jishin85
    @Jishin85 Před 2 lety +1

    Really really useful, thank you very much! Obviously, for future firmwares, make sure to change the file names, before launching the scripts, to the correct date the file has.

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Thanks for the feedback, yes absolutely have to change the filename depending on when you're downloading the file 🙂

  • @philipknowles8372
    @philipknowles8372 Před rokem +1

    Thank you. It amazes me that the cc2538-bsl GitHub page misses the important part of the filename needs to be in the command string.

    • @mhandireowen
      @mhandireowen Před 8 měsíci

      What's missing?

    • @philipknowles8372
      @philipknowles8372 Před 8 měsíci

      the filename needs to be in command string. It didn't state that in the GitHub page (which is why I watched the YT video)

    • @mhandireowen
      @mhandireowen Před 8 měsíci

      Ok. Now I get it. Thanks for the response 👍

  • @oliviachowyc
    @oliviachowyc Před rokem

    Thank you, this is a great tutorial! Your method works, just need to use Python 3.9.13 as mentioned by someone in the comment.

  • @Faromme
    @Faromme Před 24 dny

    I tried but came to a stop when my cmd got me this message: pip' is not recognized as an internal or external command.
    Now what?

  • @karllinder
    @karllinder Před 2 lety

    Thanks, very good guide!

    • @Byteofgeek
      @Byteofgeek  Před 2 lety +1

      Thanks for letting me know, hope it helped 🙂

  • @jeffer8762
    @jeffer8762 Před 2 lety +2

    another question is if I configured Sonoff Zigbee at 7:02, how do I revert back :(

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      If you click on the 3 dots on the tile in integrations, there should be either a disable or remove option there 🙂

  • @flukebw
    @flukebw Před rokem

    Great tutorial, thanks! As I'm runnning ConBee II and just purchased the SonOff Dongle, I'm interested in the process to do a migration for z2m. As far as I understood, I need to also flash the coordinator ID of the ConBee II to the Sonoff Stick. Do you have some hints on that matter?

  • @greuve
    @greuve Před rokem

    Thanks for sharing this, I was about to give up on my (expensive!!) aqara door sensors after failing to upgrade the firmware of my sonoff dongle using the python script on linux. No idea why it did not work, but perhaps it's because my daily linux driver being a little obscure and locked down (F36SB). Word of warning for folks who like to copy/paste between working docs: there's a double dash towards the end of the process, just before --bootloader.... It caught me out as it translated between too many copy/pastes to some weird long dash.

    • @Byteofgeek
      @Byteofgeek  Před rokem +1

      Good shout, glad you got there in the end 👍

  • @michaelmolter6180
    @michaelmolter6180 Před rokem

    You may have to run "python -m pip xxxxx" instead of just "pip xxx" depending on your python install / configurations.

  • @tonksfight3518
    @tonksfight3518 Před 8 měsíci

    The first script doesn't work, neither in powershell nor cmd. I tried both normal user and administrator on both but nothing. Is really that necessary? Isn't possible to download wathever it is with a normal link?

  • @danieladam7915
    @danieladam7915 Před 2 lety +1

    Great video, but could you please share the Repository URL for the zigbee2mqtt addon? I cannot see it in the description.

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Thanks for watching and highlighting the missing link Daniel, it is now there in the description 👍

  • @JosefZvolanek
    @JosefZvolanek Před 2 lety

    Hi nice video, I use the same USB dongle as a coordinator and also as a router I flashed through a program from Texas Instruments with USB dog resolution it seems to me to be easier!

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Thanks for the feedback, it sounds like you're doing the hardware route then?

  • @joos2033
    @joos2033 Před 2 lety +1

    Can you make this tutorial with the new interface of Home Assistant ?

    • @Byteofgeek
      @Byteofgeek  Před 2 lety +1

      I'll check the differences and see what would need doing 👍

  • @slightbleeding
    @slightbleeding Před rokem

    Thanks!

  • @johndixon8534
    @johndixon8534 Před 9 měsíci

    Having spent hours on other methods that didn’t work I tried this one, spent a little time downloading and setting everything up then tried to flash. Didn’t work . Opens port,baud 500,000, reading data from launchpad file, firmware look like intel hex file, error 2, no such file or directory

  • @jasonstation
    @jasonstation Před rokem

    I don't understand why MQTT etc is required when the device works straight out of the box with Home Assistant? Thank you.

    • @Byteofgeek
      @Byteofgeek  Před rokem +1

      Better device support with MQTT and ZHA doesn't show all the entities compared to MQTT on a number of devices

  • @rong2578
    @rong2578 Před rokem

    I was having an error when running command pip install zigpy-znp (out at failed building wheel for multidect and the fix was to install Microsoft Visual Studioproblems). I had to uninstall Python and install an older version. I used Python 3.9.13. Same website but under Python Releases for Windows. Then everything worked. Also had to change the date on the hex file.

    • @oliviachowyc
      @oliviachowyc Před rokem

      Thanks! You are a genius. The Python 3.9.13 works like a charm!

  • @paulwyand6204
    @paulwyand6204 Před 9 měsíci

    Having problems with "pip install zigpy-znp" and even tried python -m pip install zigpy-znp. I get
    ERROR: Failed building wheel for multidict
    Failed to build frozenlist multidict
    ERROR: Could not build wheels for frozenlist, multidict, which is required to install pyproject.toml-based projects
    Of course nothing else works.

  • @tinteex9130
    @tinteex9130 Před 9 měsíci

    i get this error : Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'

    • @Byteofgeek
      @Byteofgeek  Před 9 měsíci

      Are you using a dongle P or E?

    • @tinteex9130
      @tinteex9130 Před 9 měsíci

      thanks for your reply. im using a P@@Byteofgeek

  • @UAIron
    @UAIron Před rokem

    Appreciate the video and work! I'm almost there, but running into an error at the end... Any idea what might be happening here?
    Opening port COM3, baud 500000
    Reading data from CC1352P2_CC2652P_launchpad_coordinator_20230507.HEX
    Cannot auto-detect firmware filetype: Assuming .bin
    Connecting to target...
    CC1350 PG2.1 (7x7mm): 352KB Flash, 20KB SRAM, CCFG.BL_CONFIG at 0x00057FD8
    Primary IEEE Address: 00:12:4B:00:29:E8:CE:64
    Performing mass erase
    Erasing all main bank flash sectors
    Erase done
    Writing 508113 bytes starting at address 0x00000000
    ERROR: Invalid data size: 508113. Size must be a multiple of 4.

  • @jjwang265
    @jjwang265 Před rokem

    Hi im getting a "USB-Enhanced-SERIAL CH9102" under ports instead of the Silicon labs title...help

    • @Byteofgeek
      @Byteofgeek  Před rokem

      There are two versions of the dongle now with the newer one having a different chipset. This was introduced after the video was done so this won't work on that

  • @eddyhorsting6199
    @eddyhorsting6199 Před 2 měsíci

    I got an error at the end of flashing, is it now flashed or not? I am not sure..
    Opening port COM3, baud 500000
    Reading data from 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: 00:12:4B:00:26:B8:76:A9
    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)
    ERROR: int() can't convert non-string with explicit base
    edit: put it back in my HA-device and it works. Gives the just installed firmware as version.

    • @Byteofgeek
      @Byteofgeek  Před měsícem +1

      Not seen that error before Eddy but glad you got it working in the end

  • @MrRoma70
    @MrRoma70 Před 2 lety

    I just bought two Sonoff Zigbee 3.0 USB Dongle Plus but when plug into HA does not recognize them, also when plugged into Windows device and checking the Device Manager it shows as USB-Enhanced-SERIAL CH9102 (COM4) dongles and both showing, can I still flash it, did I get a lemon? Cheers

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      I have seen that sonoff have a new version of the dongle (ZBDongle-E) that is shorter and uses a different Chipset, I think this has been introduced because of the chip shortages. Is it that one that you have?

    • @seb155
      @seb155 Před měsícem

      @@Byteofgeek I have the same CH9103.... getting timeoutError when trying to read....

  • @jeffer8762
    @jeffer8762 Před 2 lety

    11:03 this part is not clear, what server and what port ? I am getting 502 badgateway

    • @Byteofgeek
      @Byteofgeek  Před 2 lety +1

      IP address of your home assistant device, unless you've changed anything the port will probably been the same as mine. 👍

  • @zingrock
    @zingrock Před rokem

    My dongle is being detected as USB-Enhanced-SERIAL CH9102 instead of the Silicon Labs CP210x -- any ideas why? thanks

    • @zingrock
      @zingrock Před rokem

      Turns out its the "E" version - Seems like they made it when the CP chips ran out. More difficult to flash so I'm running stock fw and ZHA

    • @Byteofgeek
      @Byteofgeek  Před rokem

      Thanks for confirming, I think a few people have bought the E dongle, maybe because it's cheaper?? and have come across this problem according to the comments.

  • @Nqrgaard
    @Nqrgaard Před 2 lety

    I keep gerning bad gateway 502.
    There are No red lines in my log file, but it says error multiple places.
    Like fail to start and Error down udevadm ENOENT

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      OK can you check you've specified the correct COM port for the dongle?

    • @Nqrgaard
      @Nqrgaard Před 2 lety

      @@Byteofgeek
      If it is the dongle port I took the one as shown in the video. I have also checked that multiple times, so it should not be it. I also updated the dongle multiple times after the error, just to make sure

  • @sesshoumarusama7397
    @sesshoumarusama7397 Před 2 lety

    Weird, when I enter the flash commad just nothing happens, just the command prompt comes back (even without the stick inserted there is no error).

  • @dfgdfg_
    @dfgdfg_ Před rokem

    Is this the Dongle-P or Dongle-E?

    • @Byteofgeek
      @Byteofgeek  Před rokem

      This is the plus, at the time of recording the video the dongle-e had not been released

  • @gzcwnk
    @gzcwnk Před 2 lety

    sadly not working.....sonoff flashed OK but I get a bad gateway 502

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      OK, did you put your ip address in like I've shown in the video for this problem?

    • @gzcwnk
      @gzcwnk Před 2 lety

      It was a me or a software problem, the flash of the firmware was fine, TY.

  • @nateF888
    @nateF888 Před 10 měsíci

    I am getting timeout error in part 5:12 anyone know how to solve this ?

    • @tinteex9130
      @tinteex9130 Před 9 měsíci

      i am getting the same error. how did you fix it?

  • @Kev7274
    @Kev7274 Před 2 lety

    Keep getting this error...python: can't open file 'cc2538-bsl.py': [Errno 2] No such file or directory. Any ideas?

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      OK 2 things to check, make sure it's a command prompt in administrator mode and also make sure you're in the correct folder - can you actually see the cc2538-bsl file if you type dir or do you see another folder again?

    • @Kev7274
      @Kev7274 Před 2 lety

      @@Byteofgeek yes,command prompt as admin. Type Dir in the command prompt?

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Yes if you type DIR at the command prompt it will list the contents of the folder for you.

    • @Kev7274
      @Kev7274 Před 2 lety

      @@Byteofgeek yes,it's showing in the folder that I have it all in.

    • @Kev7274
      @Kev7274 Před 2 lety

      I re-downloaded and now it tries to flash,but now I get this error....ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)' I can't get it to flash with the Texas Instruments flasher because it can't find the dongle. I'm just wondering if the Dongle is bad?

  • @Nqrgaard
    @Nqrgaard Před 2 lety

    Should I Submit the Sonoff Zigbee 3.0 like I did with MQTT?

    • @Byteofgeek
      @Byteofgeek  Před 2 lety

      Where are you referring to?

    • @Nqrgaard
      @Nqrgaard Před 2 lety

      @@Byteofgeek I can see it was not submitted in the video either.
      So I don’t think it is necessary

  • @Dragon8567
    @Dragon8567 Před 10 měsíci

    rotzooi werkt niet

    • @Byteofgeek
      @Byteofgeek  Před 10 měsíci

      Doesn't work on yours, working fine for plenty of others. Post what the problem is and let's see if someone can help make it work for YOU 👍

  • @johndixon8534
    @johndixon8534 Před rokem

    Flashing Dongle with Router not CoOrdinator but all the same. But getting error, can anyone guide me.
    D:\Router Flash\cc2538-bsl-master>python cc2538-bsl.py -p COM3 -e -v -w --bootloader-sonoff-usb C1352P2_CC2652P_launchpad_router_20221102.hex
    sonoff
    Opening port COM3, baud 500000
    Reading data from C1352P2_CC2652P_launchpad_router_20221102.hex
    Your firmware looks like an Intel Hex file
    ERROR: [Errno 2] No such file or directory: 'C1352P2_CC2652P_launchpad_router_20221102.hex'

    • @Byteofgeek
      @Byteofgeek  Před rokem

      Make sure you have the matching filename in the line you're typing in at the command prompt

  • @MrAntropex
    @MrAntropex Před 2 lety

    no offense, but the title reads flashing the sonoff zigbee dongle in HA and not in Windows...flashing it in Windows is nothing new, whether flashing thru Python nor TI Flashing tool 😑

    • @Byteofgeek
      @Byteofgeek  Před 2 lety +1

      Ah I thought I'd changed that, thanks for pointing it out 👍

  • @andersrasmussen2096
    @andersrasmussen2096 Před rokem +2

    Ive tried this guide and everything besides the fw upgrade it self works but I get the following error
    C:\Temp\cc2538-bsl-master>python cc2538-bsl.py -p COM7 -e -v -w --bootloader-sonoff-usb CC1352P2_CC2652P_launchpad_coordinator_20220219.hex
    sonoff
    Opening port COM7, baud 500000
    Reading data from CC1352P2_CC2652P_launchpad_coordinator_20220219.hex
    Your firmware looks like an Intel Hex file
    Connecting to target...
    ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'
    I've tried to upgrade the Driver but windows states that I already have the best driver
    Do you have an idea how to solve this?

    • @Byteofgeek
      @Byteofgeek  Před rokem

      You haven't got the new SONOFF Zigbee 3.0 USB Dongle Plus-ZBDongle-E have you?

    • @andersrasmussen2096
      @andersrasmussen2096 Před rokem

      @@Byteofgeek oh yes that is what is written on the box and invoice and it is about 51 mm so I’m Pritty sure

    • @Byteofgeek
      @Byteofgeek  Před rokem

      OK that has a different chipset so I'm almost certain this won't work but I don't have one to test unfortunately

    • @andersrasmussen2096
      @andersrasmussen2096 Před rokem

      @@Byteofgeek Buttons on the device are also twisted 90° compared to the one you were using

    • @DenBredeYmer
      @DenBredeYmer Před rokem

      @@andersrasmussen2096 I have the same issue as you, did you find a solution?

  • @Wolf-3.5.9
    @Wolf-3.5.9 Před 2 lety

    Thanks!

  • @Wolf-3.5.9
    @Wolf-3.5.9 Před 2 lety

    Thanks!