Flashing Sonoff Touch – No soldering

Although it is not really a big thing to solder an angled header in a SonOff Touch in order to reprogram it, one also has to solder a wire to the GPIO-0 pin of the ESP8285 chip as the SonOff Touch has no button that can be used to get it into flash mode.
I therefore wondered if it wouldn’t be possible to flash the Sonoff Touch without any soldering. Spoiler: yes it is possible, but you need some dexterity.
First open the Sonoff Touch. This is easiest done with cautiously prying a screwdriver on between the casing and the frontplate at the side.
once that is done you can see a small board that you can just pull-out.
On that board there are 4 in line holes that we need to connect an FTDI programmer to. On the bottom side of the board is also a 2×2 male header. That is the one that we just pulled out of its header in the housing. We are going to need that header a bit later as well.

indicated  the function of the 1×4 header in the image. You are going to need an FTDI to USB module  THAT YOU CAN SET TO 3.3 VOLT. You also will need a 1×4  straight pinheader and 4 female to female DuPont wires.
Now make the following connection between the 1×4 male header and the FTDI to USB connector:

header FTDI module
Ground Ground
Tx Rx
Rx Tx
Vcc Vcc

To make clear, if it already wasn’t, this is a connection to a loose, 4 pin male header.
The next thing you need is a female to male DuPont cable. Connect the female end to the ground connection on the 2×2 header.

Also, you need to identify GPIO0 on the ESP8285 chip:


For the final flashing you need a bit of dexterity but this is what you do:

  • Have your Arduino IDE available with the  required program loaded.
  • Under tools-boards choose the generic 8285 module
  • Flash size 1 Mbyte 16k SPIFFS
  • Make sure the FTDI module is not connected to the USB port of your computer.
  • Now press the 4 pin male header that is connected to your FTDI module in the proper holes. Make sure it is the right way around, so Ground connects to ground, Vcc to Vcc, Rx to Tx and Tx to Rx. If there is a bit of slack between the header and the holes. push against the pins with  the mouse of yr thumb or with your little finger, so it makes  poper connection.
  • Now take the male pin of the DuPont cable that you connected to the ground on the 2×2 pin header and push it against GPIO 0.
    Keep it in place with your thumb.
  • You still should have one hand free. Use that to push the FTDI module in the USB connection of your computer.
  • Once that is done, you can let go of the male pin pressed against GPIO0
  • In the IDE chose the right port and press ‘upload’.

That’s it.

So, what program should you upload to make the Sonof Touch work?
Of course there is Tasmota and many people are very happy with it. Truthfully, I found it cumbersome and couldn’t even compile it. Considering all we need to do is switch 1 pin, it shouldn’t be so hard to write something simple.
Given the fact that the Sonoff Touch will most likely disappear in the wall and you don’t want to have to take it out and flash it again, two things come in very handy in the program:

  • OTA (Over The Air) flashing
  • WiFiManager

The code also gives MQTT feedback about the

  • MAC
  • IP
  • Filename
  • SignalStrength

It can be downloaded here


4 thoughts on “Flashing Sonoff Touch – No soldering”

  1. Excellent! I have made a similar rig to program ESP12’s using an unpopulated NodeMCU board and 2mm header pins sliding up through the ESP12 through holes. I’ll add a link soon once I have made a post on my G+.

    As for Tasmota (you knew this was coming!), apart from me being a fan, if you want to compile your own version I really would encourage the use of platform.io instead of Arduino. But having said that, I have been doing rather complex things with Tasmota on Sonoff basics, a Sonoff bridge and several DIY designs and I can honestly say that it is simple not needed to compile. Instead of installing platform.io or tweaking the Ardiono IDE, simply flash the compiled binary. It’s a lot easier and faster too. And it works with your header trick!

    Download the compiled Tasmota binary from the git (releases section), or in fact any compiled binary, and issue:

    ~/.arduino15/packages/esp8266/tools/esptool/0.4.13/esptool -cd nodemcu -cb 921600 -cp /dev/ttyUSB0 -ca 0x00000 -cf ~/Downloads/sonoff.bin

    Funnily enough, I actually used that command today to flash another binary on an ESP8266. That firmware was closed source and the binary was the only thing provided.

      1. Thank you. I have several ESP12F-s, but they are already on an adapter plate, which makes it easier to program, but at the same time is a pity as they take a lot of space, maybe even bigger than a Wemos r1 mini. So it is much better to use them without the break out plate and solder them directly in place in a project. Your instructions for that are in fact pretty good. Smart idea. And once there is OTA in it, they can be kept soldered in place on their final project board

    1. Jeroen, thanks. Let me start by saying I made a mistake, I accidentally published this post before it was finished, which is witnessed by the abrupt ending. It needs to be completed by the program I use, but the technique ofcourse can be used for any program.

      Yes, I knew it was coming. I am sure Tasmota is a great program. So many people using it cant be wrong and Indeed it seems using Platformio supposedly makes things easier, as does using a binary. i am sure, one day i will try it.

      As for my own program…. The Touch is functioning perfectly for several days already, as does the OTA.I will add it one of these days

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: