Skip to content
arendst edited this page Dec 23, 2016 · 48 revisions

In the Arduino IDE for sonoff select from Tools Board Generic ESP8266 Module and set the following options:

  • Flash Mode: DIO
  • Flash Frequency: 40MHz
  • Upload Using: Serial
  • CPU Frequency: 80MHz
  • Flash Size: 1M (64K SPIFFS)
  • Debug Port: Disabled
  • Debug Level: None
  • Reset Method: ck
  • Upload Speed: 115200
  • Port: Your COM port connected to sonoff

Update user_config.h with your specific MODULE (SONOFF, SONOFF_POW or ELECTRO_DRAGON), Wifi and MQTT parameters.

Connection diagram
Verify source and upload once to sonoff using the serial connection as shown in Peter Scargill's blog.

Do not connect AC power during the flash cable connection.

Sonoff Dual

Dual GPIO0 grounded Programming the Sonoff Dual is more difficult as the button is not connected to GPIO0 which is needed to put the ESP8266 in programming mode during power up.

I suggest to solder a 4 pin header for the serial interface as shown in the image on the right (the vertical connector) and use the small inter layer VIA to ground GPIO0 using the GND pin from the button 0 and button 1 header.

The 4 pin header in the middle, which is normally not present, is not needed but might be used in programming the ESP8266 as there must be a better way for itead to get the initial code loaded ...

S20 Smart Socket

S20 Smart Socket The picture on the right, provided by ThomDietrich, shows how to program the S20 Smart Socket powered by the FTDI USB converter.

Remember that during programming the Smart Socket is NOT connected to mains.

Sonoff Pow - WARNING

Trying to program the Sonoff Pow comrade MySKU learned the hard way how to brick it.

Sonoff Pow Bricked As the Sonoff Pow power monitoring hardware connects AC power to the logic ground of the ESP8266 it is utterly mandatory to **NOT CONNECT AC POWER WHILE SERIAL CONNECTION IS BEING USED**.

During both AC connection and Serial connection you may connect the life AC wire with your PC's DC ground leading to a power short, broken Sonoff Pow and laptop Power Supply as MySKU has experienced.

Sonoff Touch

Sonoff Touch EU As the Sonoff Touch is based on the ESP8285 using Flash Mode DOUT you will have to make some changes to the proposed Arduino IDE settings as follows:
  • Tools Board Generic ESP8285 Module
  • Flash Size: 1M (64K SPIFFS)

Programming the Sonoff touch is as easy as the Sonoff Basic.

Remove the top PCA containing the ESP8285 from the assembly as shown in the pictures on the right.

Sonoff Touch US The pictures show for both the EU version (top) and the US version (bottom) how to connect your FTDI cable (Gnd, TxD, RxD and 3.3V). GPIO00 pin needs to be connected to Ground to put the Sonoff Touch in programming mode.

Remember that during programming the Sonoff Touch is NOT connected to mains.

Upload image

Verify and upload an OTA image to your web server with option Upload Using: OTA_upload.

Since version 1.0.26 you may also use sonoffs web server and upload the file directly.

Enable debug messages by selecting option Tools Debug Port: Serial.

Clone this wiki locally