Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Sonoff gateway: sketch uploads fine but doesn't run

Sonoff gateway: sketch uploads fine but doesn't run

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 219 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    user2684
    Contest Winner
    wrote on last edited by
    #1

    Pretty weird behaviour here. I have two sonoff bought a couple of years ago acting as mqtt gateways with this sketch https://www.mysensors.org/build/sonoff running perfectly fine.

    I've recently bought another couple and despite uploading the same sketch it just does not work (the two of them). Sketch and wiring is the same of those working, arduino IDE's settings the same, the output when flashing is the same without errors, the PCB layout is identical (the new model has just 3 screws for the case instead of one but doesn't matter).

    After flashing just nothing happens (no serial output, no relay switching when pressing the button, no connection to the mqtt broker). I'd say it is a broken unit but doesn't make sense having two out of two broken and still able to be flashed (I'd have received a timeout error if the chip was completely broken). Tried flashing already multiple times without luck.

    Anybody seen a similar behaviour? Any special protection added to the ESP8266 chip in recent models I need to take rid of?

    Thanks!

    K YveauxY 2 Replies Last reply
    0
    • U user2684

      Pretty weird behaviour here. I have two sonoff bought a couple of years ago acting as mqtt gateways with this sketch https://www.mysensors.org/build/sonoff running perfectly fine.

      I've recently bought another couple and despite uploading the same sketch it just does not work (the two of them). Sketch and wiring is the same of those working, arduino IDE's settings the same, the output when flashing is the same without errors, the PCB layout is identical (the new model has just 3 screws for the case instead of one but doesn't matter).

      After flashing just nothing happens (no serial output, no relay switching when pressing the button, no connection to the mqtt broker). I'd say it is a broken unit but doesn't make sense having two out of two broken and still able to be flashed (I'd have received a timeout error if the chip was completely broken). Tried flashing already multiple times without luck.

      Anybody seen a similar behaviour? Any special protection added to the ESP8266 chip in recent models I need to take rid of?

      Thanks!

      K Offline
      K Offline
      kimot
      wrote on last edited by kimot
      #2

      @user2684
      Try:
      Install ESPTOOL

      run command ( it is for Linux - use com with its number in Windows )

      esptool.py --port /dev/ttyUSB0 flash_id
      

      Sonnof must response with its chip ID

      Something like this:

      Connecting...
      Manufacturer: e0
      Device: 4016
      

      If it does, chip and connection is ok....

      U 1 Reply Last reply
      1
      • K kimot

        @user2684
        Try:
        Install ESPTOOL

        run command ( it is for Linux - use com with its number in Windows )

        esptool.py --port /dev/ttyUSB0 flash_id
        

        Sonnof must response with its chip ID

        Something like this:

        Connecting...
        Manufacturer: e0
        Device: 4016
        

        If it does, chip and connection is ok....

        U Offline
        U Offline
        user2684
        Contest Winner
        wrote on last edited by
        #3

        @kimot thanks you've definitely given to me the right direction to look into.

        Looks like my chip info is different and is the following:

        esptool.py v2.6
        Serial port COM7
        Connecting....
        Detecting chip type... ESP8266
        Chip is ESP8266EX
        Features: WiFi
        MAC: ec:fa:bc:86:da:e2
        Uploading stub...
        Running stub...
        Stub running...
        Manufacturer: 5e
        Device: 4014
        Detected flash size: 1MB
        Hard resetting via RTS pin...
        

        I see that manufacturer 5e is given problems to many people so I've followed the advice I found here https://forum.micropython.org/viewtopic.php?t=3777 to actually solve the issue, specifically flashing with the -fm dout flag (e.g. esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 file.bin) and now it works!

        Many thanks!

        1 Reply Last reply
        1
        • U user2684

          Pretty weird behaviour here. I have two sonoff bought a couple of years ago acting as mqtt gateways with this sketch https://www.mysensors.org/build/sonoff running perfectly fine.

          I've recently bought another couple and despite uploading the same sketch it just does not work (the two of them). Sketch and wiring is the same of those working, arduino IDE's settings the same, the output when flashing is the same without errors, the PCB layout is identical (the new model has just 3 screws for the case instead of one but doesn't matter).

          After flashing just nothing happens (no serial output, no relay switching when pressing the button, no connection to the mqtt broker). I'd say it is a broken unit but doesn't make sense having two out of two broken and still able to be flashed (I'd have received a timeout error if the chip was completely broken). Tried flashing already multiple times without luck.

          Anybody seen a similar behaviour? Any special protection added to the ESP8266 chip in recent models I need to take rid of?

          Thanks!

          YveauxY Offline
          YveauxY Offline
          Yveaux
          Mod
          wrote on last edited by
          #4

          @user2684 There's a lot of info regarding flashing ESP devices on this site: https://github.com/arendst/Tasmota/wiki/Flashing and https://github.com/arendst/Tasmota/wiki/supported-devices

          You could also consider running Tasmota on your Sonoff devices, as it contains much more functionality compared to MySensors MQTT gateway.

          http://yveaux.blogspot.nl

          1 Reply Last reply
          1
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          17

          Online

          11.7k

          Users

          11.2k

          Topics

          113.1k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular