Connecting an adapter to the Sonoff switch and flashing with ESPEasy
I am asked a lot about how to connect to the Sonoff switch, so it can be flashed with ESPEasy, so I am going to try to explain just that.
First you need a USB to TTL adapter, they are pretty cheap and easy to find on eBay.
The one I got can both do 3v3 and 5v. To select the voltage, I need to make a bridge between VCC and 3V3.
After that we need 4 jumper wires, one that goes into 3V3, which will be used to provide the ESP inside the Sonoff switch with power, one for GND to complete the circuit, and then one for TX and one for RX.
Inside the Sonoff switch, 3V3 from the adapter, goes to VCC, TX from the adapter goes to RX inside the Sonoff, and RX then goes to TX. Last se got GND to again complete the circuit.
With a bit of practice, you don’t even need to solder a header to the Sonoff, but it would make it easier. I just want to open it up, flash it with the new code, then close it up again.
This part will go over how to flash ESPEasy from Windows.
Start by figuring out which COM port your TTL adapter got. Then go to the ESPEasy site and download the latest stable version of ESPEasy, unpack the folder, and locate the “flash.cmd” file and start it.
My adapter is on COM8, the flash size for the Sonoff switch is 1024, and the ESPEasy folder I got is named “ESPEasy_R141” so the build is 141
Before hitting enter, disconnect GND, hold the button on the Sonoff in, and connect GND again. After waiting about one second, you can let go of the button again, and then hit enter in the command prompt. If you have put the correct port number in, it should start to flash the Sonoff switch with ESPEasy.