-
Notifications
You must be signed in to change notification settings - Fork 197
Compile and Upload
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
Load the file sonoff.ino
into the IDE.
Update user_config.h
with your specific MODULE (SONOFF, SONOFF_2, SONOFF_POW, MOTOR_CAC or ELECTRO_DRAGON) until version 4, Wifi and MQTT parameters.
Verify and/or compile the project and upload once to your sonoff using the serial connection as shown in Peter Scargill's blog. See below for specific Sonoff Module information.
Note: newer version of the Sonoff module consist of five pins below the button. Follow the image above and ignore the pin furthest to the Button.
Do not connect AC power during the flash cable connection.
![S20 Smart Socket](https://github.com/arendst/arendst.github.io/raw/master/media/sonoffrffix.jpg)
Phalox explains the case with a picture where you have to install a jumper wire for R21. I received the same result using a small screwdriver and shorting both solder pads of R21 while holding down the button during programming.
Pairing a RF remote is the same as with iTead software:
- two short button presses will blink a red led shortly and start RF signal recognition. Three longer blinks signal RF reception.
- three short button presses will keep the red led on for some seconds and erase the known RF code.
I was unable to pair the Sonoff RF 434MHz receiver with any of my KaKu switches so to me the RF functionality is a bit disappointing.
![Dual GPIO0 grounded](https://github.com/arendst/arendst.github.io/raw/master/media/dual2a.jpg)
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](https://github.com/arendst/arendst.github.io/raw/master/media/s20b.jpg)
Remember that during programming the Smart Socket is NOT connected to mains.
Trying to program the Sonoff Pow comrade MySKU learned the hard way how to brick it.
![Sonoff Pow Bricked](https://github.com/arendst/arendst.github.io/raw/master/media/pow1.jpg)
During both AC connection and Serial connection you may connect the live 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 EU](https://github.com/arendst/arendst.github.io/raw/master/media/toucheu.jpg)
- Tools Board Generic ESP8285 Module
- Flash Size: 1M (64K SPIFFS)
Programming the Sonoff touch is as easy as the Sonoff Basic.
![Sonoff Touch US](https://github.com/arendst/arendst.github.io/raw/master/media/touchus.jpg)
The pictures show for both the EU version (top) and the US version (bottom) where to connect your FTDI cable (Gnd, TxD, RxD and 3.3V). The GPIO0 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.
![MotorCAC](https://github.com/arendst/arendst.github.io/raw/master/media/motorcac1.jpg)
Programming the onboard 3.3V PSA-B is possible when Rx (pin7), Tx (pin8) and Gnd (pin9) are connected to the FTDI interface, the button is pressed and (USB) power is provided.
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 with command seriallog 3
.