How to install Tasmota firmware on Sonoff switches with Tasmotizer (PC/Mac)

In this video, I will show you how to install the Tasmota firmware on your Sonoff Switches. If you prefer a written version, read the full transcript below.

Hello, my name is Daniel, welcome to the CrossLink channel. I would like to help you being more successful with 3d printing and if you're here for the first time, subscribe and hit the bell notification icon so you don't miss anything.

In the recent weeks, I started to make my 3D printing workshop a bit more professional and automated by adding Rasperry Pis with Octoprint to every printer and now, I wanna take care of the power management by adding these wall plug switches to automatically turn my printers on when a print starts and when it's done to turn it off.

I did a bit of research, how to do this and frankly, there is so many options but using these Sonoff wireless switches turned out to be quite popular.

Now a caveat of the SonOff switches is that by default they have a firmware that talks back to the manufacturers cloud service and I don't want to share my data with them.

So I looked for alternatives and the Tasmota firmware is one of the most adopted options as far as I see. It's an open source alternative firmware that you can use to control these switches inside your wifi. It also integrates well with Alexa and Google Home and many more smart home controllers.

So in this video, I will focus only on Tasmota and how it is used with these kind of switches.

Let's have a look what's inside of these - this is a SonOff S20, and this one is a SonOff Basic.

The newer S20 have three Phillips screws that you need to release, older ones only have one screw that's hidden under a little sticker, so you have to destroy that.

Then you can pop off the cover.

The SonOff Basic is even easier, there you can just remove the cover to get to the electronics.

A few words on safety upfront, don't do anything described in this guide with the switch connected to mains power. So remove any power connections from the Sonoff Mini and accordingly unplug the S20 from the wall socket.

What you will notice is that none of these boards has any kind of USB-Interface that you could use right away to flash new firmware.

But if you look close, you will see that there is some connectors here, in this case unlabeled, in some cases there might actually be labels on these like rx / tx / vcc / gnd but the newer models seem not to have those labels anymore.

Nevertheless, these connectors are the connectors of a serial interface that can be used to flash a new firmware to the chip on these boards. The chip is an ESP8266, which is widely used in many smart home devices. It's a little microcontroller that's pretty versatile and powerful enough for a lof of smart home appliucations.

Actually, if you look at the Tasmota homepage, there is a list of supported devices, which is HUGE - must be douzends and douzends of devices that have this chip and can be used with Tasmota.

So, these SonOff switches are obviously not the only supported devices but they are super affordable and I also know a lot of people using them who are super happy with how reliable they are.

Anyways, if you wanna get them, I've put some links in the description of this video as well.

Now, how do we flash a new firmware on these devices - as I said, there is a serial interface on the boards, so we will need to use a serial to USB adapter to connect that to a PC or Mac.

These adapters come in all kind of different shapes and sizes. I have some examples here for you, and I've also linked them in the description.

All these adapters have in common that they have a USB interface, this one has a micro-USB connector, where you plug in the cable, others might have Mini-USB connector like this one.

What you will also need is four jumper wires to connect the USB adapter to the Serial connectors on the Sonoff board.

Depending on the USB to serial adapter, you might need to soldier pin headers into the adapter, to make connecting your jumper wires easy on that side at least.

So the USB Adapter has pin headers to make connecting jumper wires easy but the Sonoff Switches usually don't have pin headers.

There is two things you can do

Either solder some pin headers into the SonOff PCB as well, that's what I did here for the SonOff basic.

Or you can just stick the jumper wires into the connector holes and tilt them and hold them tilted so they will basically press against the metal ring around the hole.

That can work, but it's tricky because you need to hold these four pins tilted, then push the button, which will enable the flashing mode and then while still doing all of that you need to connect the USB cable to your PC and then start the flashing process.

So I decided at least for me, it's just easier to solder these pin headers in in the first place and then have a reliable connection, but that's completely up to you.

So let's connect the USB interface to the pins. The pin layout is documented quite well in the Tasmota Wiki, so let's draw it here again quickly.

You need to connect the VCC, which is the plus cable to the VCC of your USB-adapter. Please make sure you use a voltage of 3.3V not 5V.

Some Adapters have a switch to change the outgoing power between 5 and 3.3V, so make sure that this is set to be 3.3V.

Other adapters like this one have two different VCC pins, one for 3.3V and one for 5V.

The VCC is usually marked on the Tasmota board with at least a little arrow and the metal connection around the hole is shaped rectangular instead of being a circle.

The Ground cable goes to Ground on the USB Adapter

And on the Tasmota side, this is the fourth pin from the VCC pin, if you include the VCC pin.

So there now are two pins in the middle still unconnected.

These are the the RX and TX, which are the transmit and receive cables.

The RX pin on the Adapter needs to be connected to the TX pin on the SonOff.

The TX pin on the Adapter needs to be connected to the RX pin on the SonOff.

If you wanna learn about the pin assignments of different SonOff devices or other Tasmota compatible devices in general, check out the Wiki, I've linked in the description down below. It's super helpful and contains tons of information about every single device and wiring instructions as well.

This is how it should look, now we are ready to flash some firmware.

I'm going to use a free software that is called Tasmotizer, which I've linked in the description, that is for Mac or PC. This software makes it super easy to flash firmware literally with one button click.

So once you have that ready and running on your computer, look at the list of available COM ports. In my case, I have COM5 and COM6, which have nothing to do with the adapter, we are going to plug in in a moment.

Now, take the Sonoff Switch, press the little button, it's the only button and hold it pressed.

Now, if you've chosen not to soldier you pin headers into the Sonoff, also hold the jumper wires tilted so they have good connection at the same time.

Then connect your USB Adapter to the Computer.

If the LED on the Sonoff starts flashing, you either did not press the button hard enough or you had the USB table plugged into your computer before pushing the button. In this case, unplug the usb cable and repeat.

After plugging in the USB cable while holding down the button, wait a second, then you can release the button. The led should be off permanently now.

Then in Tasmotizer, next to the port list, hit the refresh button. Now, select the port of the adapter, it should appear in the list as a new port, in my case, COM3.

If your USB adapter doesn't show up in the list of COM ports by now, you probably don't have the correct driver installed for it, so what you need to do is checking what kind of chipset your adapter has, for example the CH340 or the FT232 and look for instructions how to install the drivers. I've linked some other videos in the description which explain that.

Now, Select Release as the software version, unless you have already a binary file of a custom firmware you want to flash.

Optionally you can select a language specific binary from the list if you want, otherwise the firmware is going to be english.

Also you can backup the old firmware, so if you ever want to go back to Sonoff stock firmware, enable this switch to backup the original firmware.

Erase before flashing, I would enable in this case, because we wanna make sure that anything from the previous firmware is wiped from the chip and we can start fresh.

Now, hit the Tasmotize button to start the firmware flashing.

If Tasamotizer cannot connect to the ESP and reports back with a timeout waiting for packet header, you probably have mistakenly swapped the RX and TX pins or you did not push the pins hard enough to the side, so they got no good connection.

Swapping the RX and TX cables is not an issue, you cannot break anything and just try out if the connection works if you swap them.

But you most likely need to start over again the power on procedure.

After a few seconds, it should be done writing the image and report success.

If a timeout error happens during the flashing process, it's most likely again a bad connection of you pins with the mainboard. This is the reason why I prefer to soldier these pin headers in in the first place. A bit of work but makes life easier.

Now, if you recycle power, the LED will start flashing again, reporting that the device is ready. Now, we wanna connect it to the local WIFI network.

So you could now re-assemble the cover and connect the SonOff to the mains power or still do this while you supply power to the device over the USB port.

Take your smartphone now and open your WIFI settings to search for a new network that starts with the name tasmota.

Connect to that network. What should happen is that you get a notification that you can now connect to that new network or to sign in to that new network. Confirm that and you will be taken to the Configuration page of Tasmota for that device.

Here you can either directly enter your network SSID, which is the name of your WIFI network and also your password that you use to connect to your WIFI.

If you don't remember the name of your WIfi exactly, use the "Scan for WIFI networks link" at the top of the page. It will give you a list of available networks. Select the right one for you and then enter the password.

You may want to give your SonOff device a meaningful name in the Hostname field, so you can find it easier in your network later. Otherwise, it's going to get a random name like tasmota123 or so.

I'm gonna call it Ender3Power. Make sure you don't use spaces or special characters for the hostname.

Now save the settings. The Tasmota software will now restart and try to connect to your network.

You will be disconnected from the Tasmota Wifi and it should disappear from your network list in a few seconds.

Now, you can head over to your browser and enter the hostname that you have just given to your SonOff device, starting with http:// , otherwise you might just trigger a google search.

You Should now get to the Tasmota Page of the device and here you can simply try to switch it on and off using the Toggle button.

Connected to mains power, it should trigger the relais and switch on mains power for the connected device.

Congratulations! Next up, I will show you how to control these switches from OctoPrint at print start and print end, so make sure you're subscribed not to miss it.

If you like this video, please do me a favor. I appreciate if you hit the like button or subscribe to my channel - BUT - the real way, how you can support me is - Go watch some of my other videos that I have linked for you in these two cards here.

Thanks for watching, see you next time.