9-Steps to Flash Sonoff WiFi Smart Switch with Tasmota (MacOS Catalina)
Tags: sonoff, tasmota, macos, wifi
Published: 2021-07-26 08:29:50

In this short tutorial, we will change Sonoff WiFi Smart Switch firmware with Tasmota, using MacOS Catalina. No worries, it’s very easy. Let’s move on.

Before we start, let’s have short reminders.

#What is Sonoff WiFi Smart Switch?

Sonoff is an ESP8266 based device providing users with smart home control. 

It’s a WiFi switch that connects to a variety of devices.
Initially, Sonoff sends data to a cloud platform via a WiFi router, allowing customers to control all connected appliances remotely using the eWeLink smartphone app, being the proprietary firmware of Sonoff.

If you landed here, you want to change this proprietary firmware of Sonoff, with Tasmota.

#What is Tasmota?

Tasmota is an open source firmware for ESP8266 based devices created and maintained by Mr Theo Arends.

For more details, please have a look on the dedicated Tasmota page on Github: https://tasmota.github.io/docs/About/ .

#Material required

| Components    | Where To Buy? | Price |
| ------------- |:-------------:| -----:|
| Sonoff Module | [Amazon.fr](https://www.amazon.fr/Interrupteur-Intelligent-Universel-minuterie-Android/dp/B07XYVKHNH), [Reichelt.de](https://www.reichelt.de/de/de/1-kanal-schaltaktor-wlan-sonoff-basic-r2-p288686.html) | ~9 EUR |
| FT232RL Adapter USB to TTL 3.3V | [Amazon.fr](https://www.amazon.fr/gp/product/B01N9RZK6I/)|   ~8 EUR |
| USB 2.0 A to USB Mini B cable | It Depends on the connection of the FT232RL you will have, but it’s to connect the FT232RL to the computer. (FYI: I ordered the model referenced with the Amazon link, and the port received was Mini B instead of USB 2.0 as presented. Nevermind ;-)).[Amazon.fr](https://www.amazon.fr/gp/product/B006ZZ1C4M/)    |~5 EUR |
|Cables and, Pin Connectors| To connect Sonoff with the FT232RL: [Amazon.de](https://www.amazon.fr/dp/B01JD5WCG2/)| ~1 EUR|

#Materials Overview

![Materials Overview](https://miro.medium.com/max/2400/1*fkIrVHraVfbIwYLZuBnXng.jpeg)

#9 Steps
Now, we are ready to start.

##Step1: 🏗️ Prepare the Sonoff for welding
Remove the Sonoff’s plastic box (Caution: be careful with static electricity while touching the electronic inside !)
![Sonoff Device Opened](https://miro.medium.com/max/700/1*L1iPGhKtzfBdtqJOGKohQA.jpeg)

Get a 4 pins connector and plug it on the Sonoff (cf image for the exact location)
![Plug Pins to Sonoff](https://miro.medium.com/max/700/1*Jd_VmBmnSHvPBBAT9Tv4zA.jpeg)

Braze the 4 connectors (or if you can, hold it on the device).

![Braze](https://miro.medium.com/max/700/1*HbVkUOx2PgVVqXXlvxagSw.jpeg)

##Step 2: 🔌 Connect the Sonoff and the FT232RL adapter together

The figure below show how to connect Sonoff and the FT232 adapter together.
As you can see on the figure and my pictures, the Pins are not on the same place. Never mind, it’s just a different model.
Connection Summary (from Sonoff to FT232RL):
- GND → GND
- TX → RX
- RX → TX
- VCC or 3.3V → VCC or 3.3V

![Connect Sonoff and FT232RL (Credit: https://www.domo-blog.fr/)](https://miro.medium.com/max/700/0*XTPU0FqRpJKGx5oj.jpg)

##Step 3: 🔌 Plug the USB Cable to the FT232RL

Plug the USB cable to the FT232RL. Don’t connect the cable to the computer yet.

###Overview after connection
![All Connected](https://miro.medium.com/max/700/1*MLC7irFwdVsnLTU7jsJPvg.jpeg)

Now we are all set, let’s move on the computer part 😄.

##Step 4: 🤓 Switch you Mac On…

For this tutorial, I’m using a Macbook Air with MacOS Catalina installed.

##Step 5: 🔌 Preparing Flashing

We need to flash the internal memory with Tasmota. In other words, we are replacing Sonoff firmware with Tasmota.

Download NodeMCU PyFlasher for Catalina, and Copy the App to your computer: https://github.com/marcelstoer/nodemcu-pyflasher/releases

![NodeMCU PyFlasher Github Page](https://miro.medium.com/max/700/1*htkYE5Fkp8mxev9KCgU8LA.png)

Download Tasmota: http://ota.tasmota.com/tasmota/release/
![Tasmota Releases](https://miro.medium.com/max/700/1*m5W3eKnj_qQDwlQNuKq-mg.png)

Now, open NodeMCU PyFlasher, and set the options as in the screenshot.

![NodeMCU PyFlasher configured](https://miro.medium.com/max/700/1*K7-C7nV7FL_6rJU19i6BTQ.png)

##Step 6: 💥 Let’s Flash now

Be careful here, because we need to switch the Sonoff to “boot mode”. 

Here is the process:
1. Press the Sonoff button (before plugging the USB!!)
2. While pressing the Sonoff button, plug the USB cable to the computer. Hold the Sonoff button for 2sec after plugging the USB cable.
3. Now you can launch the Flash ModeMCU on your computer. The operation can take up to 1 min.

![Button to Press on Sonoff](https://miro.medium.com/max/700/1*VB9yoHsmpE-dcjgyIoU-2g.jpeg)

![NodeMCU Config](https://miro.medium.com/max/700/1*ZJlHneLpCvRpmMJC1O7hRw.png)

Note: I had a few issues during the flashing step. My computer was not able to connect the Sonoff device. I had to restart a couple of times the operation of pressing the button, and connect the USB to access the Boot Mode. So be careful doing this operation. After a couple of tries, the Flashing operation succeeds.


#Step 7: ⚡ Power Up
Unplug the Sonoff device from USB adapter, and connect a Male Plug in the Input side, and a Female Plug in the Output side.
Now you can Power Up.

#Step 8: 🚧 Tasmota Setup
We should have TasmotaXXXX that appears in our WiFi networks. Select the WiFi Tasmota emitted by the Sonoff device.
After selecting, a pop-up window will appear from Tasmota Firmware asking to connect to your Wifi network. Enter login & password.

#Step 9: 🍿 Enjoy
We can now toggle Off & On the Sonoff WiFi switch :-).


Feel Free  to contact me if you have any questions, or  if any step was not clear enough, happy to help.