Install Tasmota to Sonoff basic

Sonoff basic is a cheap solution to control over wifi a rele’ to turn on and off appliances, such as light or other devices.

I don’t like vendored solutions, so I will try to brick my Sonoff basic device while installing Tasmota.

Tasmota docs on github

Docs are pretty good and can be found at https://tasmota.github.io/docs/

There is also an hardware reference for many devices at https://templates.blakadder.com/sonoff_basic.html

Wire connection

To get started you need a FTDI programmer, can be found on Amazon for around 5 Euros.

The connection must be like this

FTDI connection

Ensure you press the button 2sec when plugging the FTDI. If the Sonoff blinks means it is not in programming mode. Repeat every time you need to read/write to the device.

Flashing

I followed the official guide at https://tasmota.github.io/docs/#/installation/Flashing

The tasmota binary is available on github

I used v8.1.0 at https://github.com/arendst/Tasmota/releases/download/v8.1.0/tasmota.bin

  1. Backup the current image

./venv/bin/esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x100000 fwbackup.bin

!(backup ok)[https://imgur.com/Z6I88yN.png]

  1. Write the new firmware
1
2
3
4
# Reset
./venv/bin/esptool.py --port /dev/ttyUSB0 erase_flash
# Write
./venv/bin/esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 tasmota.bin

!(write ok)[https://imgur.com/1GVUIFM.png]

Plugging to AC

Next step is to connect a wire and search for a network called tasmota-* where you can configure a wifi connection.

Once done, search for your device (I found it in the router connected peers) and access it by its IP.

plug