💡 One of an alternative to alternative firmware Sonoff
Don’t worry if uploading firmware is new to you. I’ve tried to write down the detailed manual, but if you get stuck on something then feel free to ask in comment.
- Opening Sonoff Basic box
- PIN header soldering
Connectionbetween USB serial module and board’s PIN header
- Driver installation for USB serial module
- Reboot in Flash Mode
- Download or build your custom Sonoff-Tasmota firmware
- Upload firmware to Sonoff Basic
And we will describe all the steps in detail now.
1. Opening Sonoff Basic box
It’s not necessary to screw anything. We will cut off warranty seal and squeeze the bottom part of
2. PIN header soldering
You will need at least basic soldering skills. For starters, you will certainly need
I can recommend this handle MX-DEMEL 60W Electric Soldering Iron at a cost of approximately $ 4.5.
We will also need a 4 or 5 pin PIN header – the last fifth is optional – we will not need it for firmware upload.
You can easily find a place for a 5-pin header on the board and solder the header.
Connection between USB serial module and board’s PIN header
Now we need to connect the PIN header with the USB serial programming module – UART device, which then plugs into the computer USB port and serves to upload the new firmware itself.
If you do not have a UART device yet I can recommend Aluminum shell CP2102 USB 2.0 to TTL UART – it looks nice, works great and the price is less than $ 3.
😈 Do not connect Sonoff to the mains via its inputs (up to 220V), but should only be powered by UART when uploading firmware.
On the UART itself we have individual PINs described and we will map the PIN header Sonoff board (PCB) – the order is from the black pin:
1️⃣ PIN1 – 3V3
2️⃣ RX (TDX for USB)
3️⃣ TX (RDX for USB)
4️⃣ Ground (GND)
5️⃣ Not connected
4. Driver installation for USB serial module
Installation is slightly different according your operation system, but in general you will need to install driver for your own specific USB module and operation system.
For CP210x you can visit Silabs webpage and download driver for Windows, Mac OS or Linux.
In Mac/Linux it will be visible as dev/tty device and you can search a name by command:
The name of port device should be
5. Reboot in Flash Mode
This is done by pulling the
GPIO0 pin to
GND while the device is booting.
On most devices the installed control button is connected to
GND, making entering Flash Mode very easy – this is the case of Sonoff Basic described here.
For Sonoff Basic the following order should be followed
- Disconnect serial programmer and power
GNDby pressing the on-board button
- Connect the serial programmer back
- Release button after one-two seconds
- Device is in Flash Mode now
6. Download or build your custom Sonoff-Tasmota firmware
The simplest way how to get firmware is to download
For initial upload recommend to start with
😈 Don’t download
7. Upload firmware to Sonoff Basic
The last step is finally here – we will upload downloaded or prepared binary file to Sonoff Basic.
Before initial uploading I recommend to make a backup of the current firmware version using the
Esptool needs Python 2.7 or 3.4 or newer, so make sure you have it installed. T
pip install esptool
When tool is installed connect USB module to Sonoff Basic and don’t forget to press the button for Flash Mode.
To make a backup we need run command:
esptool.py read_flash 0x00000 0x100000 image1M.bin
and we should see something as that:
esptool.py v2.5.1 Found 2 serial ports Serial port COM4 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi MAC: 84:f3:eb:4b:4e:e8 Uploading stub... Running stub... Stub running... 1048576 (100 %) 1048576 (100 %) Read 1048576 bytes at 0x0 in 95.4 seconds (87.9 kbit/s)... Hard resetting via RTS pin...
We use same utility for upload as for backup, but with different parameters:
esptool.py write_flash -fs 1MB -fm dout 0x0 sonoff-minimal.bin
The last parameter is
And we should see something as that:
esptool.py v2.5.1 Found 2 serial ports Serial port COM4 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Features: WiFi MAC: 84:f3:eb:4b:4e:e8 Uploading stub... Running stub... Stub running... Configuring flash size... Compressed 1048576 bytes to 661082... Wrote 1048576 bytes (661082 compressed) at 0x00000000 in 59.0 seconds (effective 142.1 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin...
That’s it – you could reconnect USB module now and type IP address of Sonoff device into browser and you should see web interface for configuration.
If you don’t have your own Sonoff Basic yet, you can buy it on the Internet:
🙋♂️ Let me know in comments when you have any issues during flashing.