Even More Sonoff

Having read the comments in “More Sonoff” it seemed that with the Sonoff RF – there might be a slightly easier way to program it rather than holding the board, holding a connector in place and trying to short a pair of contacts together with a spare LED.

Sonoff

In the photo above – taken I may add with my phone with the addition of a magnifying lens in front of it  -remarkably easy as the phone compensates for the lens and focuses – just like eyes do!!!  – you will see a resistor marked 000 at the top and down a little to the left – an empty space. ALL you have to do to return the Sonoff RF to push-button-programming glory – is move that resistor down to the left.

Well, it seemed like a good idea. My office is in disarray due to moving so could I HELL find my precision tweezers.  Off I went to my handy watch repair toolkit and took out the tweezers. Rounded corners. BAD mistake.

So after I lost the original resistor and 2 replacements in the carpet I finally managed , despite my resistors being one size up from these, to get a 0 ohm resistor to the right of that chip above in the place I’ve marked with a ring – you can see it was a choice – go into the radio chip OR go off to the button.

Well, what I can I say, the slightly burned button absolutely works a treat.  I think I’ll wait until I can find the right tweezers before doing any more of these but if your soldering iron is obscenely fine and your eyesight is that of a 20 year old you should have absolutely no problem moving that resistor.

If any of the above are not true – you might want to think twice before turning your Sonoff into a smouldering lack of melted plastic.  Oh and do try to avoid the button when soldering.

Armed with this mod, pushing a 4 way connector into the holes while holding that button down, releasing the button and programming is now a snap.

Remember this only applies to the Sonoff RF and only if you don’t want to use the existing software and are able to flash your own (or someone else’s software into the board – Relay output is GPIO12.

And no I’m not going to show you a picture of the finished item. It’s embarrassing.

Apologies to any of you who tried to visit yesterday around 4pm and shortly thereafter – the site went down – and then magically came back up – I’ve put in a support query to find out why.

43 thoughts on “Even More Sonoff

  1. Hi, i manage to install espEasy to my Sonoff RF. Can you halp me with one more issue ?
    I can’t get my RF module work with it . No idea how to pair rf module with my remote. It was easy with original firmware.

    1. First of all, that is not a photo of a Sonoff RF – there is no RF module mounted on the motherboard. See the 4th photo on https://tech.scargill.net/more-sonoff/ for a picture of the Sonoff RF.

      Sonoff do sell the small RF board separately and there are some instructions on how to pair the board to your RF transmitter – https://www.itead.cc/wiki/433Mhz_RF_receiver

      The RF RX board must be connected to some of the ESP 8266 inputs but I’m not sure if the ESP Easy software will look at those inputs and trigger the relay.

      You’ll have to do some more digging! Good luck.

  2. Hi, I am using SONOFF RF and i got a problem while have tried to add external hardware swith paralel to existing.
    I solder out my button and now it’s not triger.
    Can you help me please and give me idea where i can solder it again ?
    I think problem is from front left pin of buttom
    Thank you.

  3. Hi Peter,
    i solved my problem with your post with the connection between R7 and D4…
    so i can use my favorite easyesp :)))
    what’s with the zero resistor? should i move it back? i’m so happy that i move it 😉
    Thanks a lot!

  4. I have received also my Sonoffs with 5 pins header.
    And i moved the zero resistors in the “ring”, but i can’t flash the esp?
    At the start i hold the button down and release ist after 2-3sec.
    But nothing, the led is blinking the whole time. What could be wrong?
    Tim

    no flashmode:
    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    error: espcomm_upload_mem failed

  5. Hi Peter, i did lot of reading to get started to flash my sonoff device.
    But get suck on th connection via a FTDI usb to serial.
    Do you have any model ore type of a working FTDI?
    Rg Frank

    1. I just use the standard-looking red FTDIs from China with the little 3v3/5v link. You need 3v3 when programming Sonoffs.

  6. I have received my Sonoffs with 5 pins header. I have soldiered gold pins, but I am unable to flash it with EspEasy. Does any of you can lend a hand here?

    1. Are you using the top 4 pins only. Nothing has changed in their layout. I have quite a few that I have managed to program without an issue. Just make sure you hold down the top push button switch before you apply power with with your FTDI adapter and everything should be fine.

      1. I can not flash mine too. I have the the “wifi only” version. It does have 5 pins. The 5th is reserved for DHT sensor. It works fine with their android application, but I want to use my own mqtt server.

        If I press the button before power up (from the FTDI cable) the LED does not blink anymore. When I try to upload anything the FTDI adapter just flash the send indicator. Errors like:

        warning: espcomm_sync failed
        error: espcomm_open failed

        are displayed

        Tried with Arduino IDE and ESPEasy but no luck. ANY extra wiring?

          1. I also have this problem… Has anyone solved this. I’m tearing my hair out trying to find a solution.

          1. I found a solution to this. I’m not sure if it’s my FTDI board or the Sonoff, but by reversing the RX and TX pins I was able to get my FW uploaded to the Sonoff.

            So I now have VCC closest to the button (connected to 3.3V on my FTDI) and then moving up, TX (connected to RX on my FTDI), RX (connected to TX on my FTDI), GND (to GND) and the top pin unused for flashing the FW. I hope that’s useful to someone else.

  7. If the diagram I’m looking at is correct, the SONOFFs have a 5 way connector (no pins attached) – the one we use for programming… that 5th pin APPEARS to be connected to GPIO14 – which means – an easy way to attach an input – or temperature sense chip??

    1. I thought that but my sonoff’s do not actually have the 5th pin..

      I mentioned that in an email to Itead and they confirmed that was an older version which did..

      1. Awww… ok well I will ask them to consider this in future versions – the board would be a LOT more useful if the made the IO pins available… having a DS18B20 on there, pref on a long lead would definitely be a plus.

        1. Indeed, although I’m using the easyesp software and have found that by turning off the serial debugging stuff I have no problems using the serial tx & rx lines for a pir sensor or the dallas sensor 🙂

          1. Just a quick question: I already flashed a couple of sonoffs with espeasy and so far so good with domoticz, but I miss turning on my lights via a wall switch. What would be the easieast way to add it back? De-solder the switch attached to GPIO0? Or could I use the pins used for programming? thanks

            1. The problem with using GPIO0 is that if someone leaves the light switch on – next time there’s a reboot it’ll go into programming mode! So just earlier today I asked the designers if there was any chance of bringing that 5th pin back which has been reduced to 4 – and the good news is yes, likely GPIO2 or another.. that will then allow for a manual override.. the only thing you could do now is arrange a toggle with a real switch which is a spring return job… and suitable software of course…

  8. Love to know if anyone is controlling a Sonoff from a PC running Linux/windows rather than an app on a phone

    1. No problem at all I’m running Sonoff and other devices from Node-Red on simple timers and not so simple events – but in ADDITION over-riding from an APP

      1. At the moment would love a windows solution but willing to try the node-red on Ubuntu.

      2. At last Ive managed to get node-red working from Windows. Now to get them linked – Any advice

    2. Yep all my Sonoffs are running espeasy (with various PIR sensors & dallas temp etc) using Domoticz..

  9. I flashed Sonoff RF putting the tip of a screwdriver in place of R21. In principle it worked, could control Sonoff with Blynk. But when Sonoff restart no longer worked, and I could not go back to flash.

    I repeated in process with another Sonoff with the same result. Now I have two useless Sonoff. Any idea why this has happened? Any idea how to restore life to Sonoff?

    1. Solved! This problem was caused because I forget to erase the memory. I could not go back to flash, but if I could erase the memory, flash back and now works well. If memory not erase then it is a very confusing behavior.

  10. Found a solution for Pulse counting with the sonoff: leaving the relay function intact and giving you two additional GPIOs. It is based on the excellent ESPeasy framework http://www.esp8266.nu/index.php/Main_Page and support here: http://www.esp8266.nu/forum/

    There is a branch here: https://github.com/costonisp/MiniESPEasy that changes the use of the TX/RX pins for devices with limited I/O. I can now use GPIO1 and GPIO3 headers that I installed to reprogram the device!.
    You can add different sensors to these pins now – including DS18B20 or switches.

    I now have the Pulse counter from my water meter on GPIO1 (tx). The Count variable is the number of additional counts since last successful send. My pulse are every 1 Litre.
    Make sure that you are careful with the electrical connections as the MAINS POWER tracks are nearby.

    Note, for MQTT, use OPENHAB and in Advanced settings remove the leading / from the topics as Mosquitto doesn’t like them. Also in Config, set the Unit NR to something other than 0. Have Fun!

    1. I use EASYGPIO – but I think you’re talking about the ESP/Arduino environment??? For MQTT my own favourite is Mosquitto with websockets.

      1. Yes, ESPeasy is a suite of modules – very easy to use – which you configure the modules used in a web browser. For non-gpio limited devices, they support OLED as well as a long list of sensors and gpio expanders http://www.esp8266.nu/index.php/Main_Page#Applications

        It is supplied as ESP8266 Arduino code (source) that you compile by pressing a button and upload to the device.

        It is well worth a look!

  11. Is there away to read out the code from the chip to reprogram it after you are finished messing around with the Sonoff? Also how does one go about programing this device?

    Thanks
    Kas

    1. Not as far as I’m aware (reading the code back) – and how to program ESPs is a bit beyond the scope of this article – there are many tutorials out there.

  12. A lot more help here than itead 🙂

    When asked about the differing schematics:

    “Yes, it is the schematic of Sonoff with 433”

    When asked about flashing:

    “Sorry, we do not provide any information about the flash mode”

    So thanks everyone 🙂

    Pete, when using OTA flashing on 1meg devices where parameters are being stored in the flash, do you have a way to retain those parameters?

    1. 🙁
      I feel bad to here that.
      We, ITEAD, are always trying to provide sufficient support to the customers.
      With the rapid growing of the business, we do not have sufficient manpower to do the support.
      So we hire more ppl.
      But we are in such a dilemma,
      – people with engineer background have poor English skill..
      – good English guys almost know nothing about circuit and code

      We will try to improve the service as far as we can.

  13. Why do you say this only applies to the Sonoff RF? I did not receive the Sonoff devices yet, but from the schematics, one would say that mounting R21 instead of R9 (as you describe) always connects E-FW (GPIO) to the key.

    Unless… the non-RF version does not have the additional processor (EFM8BB1..) and has R21 mounted by default. Which would also mean one can use the button for FW-programming by default.

    I guess I’ll just wait for my Sonoffs to arrive…

  14. Of course for those of us that do not have SMD parts to hand, and lose or destroy the zero ohm resistor (so easily done), a wire jumper works just as well!

Comments are closed.