This is a guide for how to upload new firmware using Arduino IDE. Sonoff is a ESP8266-based WiFi wireless switch that can connect to appliances of different types and brands. This is a smart switch to control any device on 110v and 230v.
Note this operation will overwrite the original software, this guide is for people who want to use their own software.
See this project here: SONOFF - ESP8266 update firmware with Arduino IDE.
Step 1: Components- Sonoff - WiFi Wireless Smart Switch
- PL2303 - USB to UART Converter
- USB cable
- Several wires
- Switch
At the beginning we need the Arduino IDE. If you do not have it, then you can download from this site: Arduino IDE download. To be able to program ESP8266 in the Arduino environment, we need to install the additional platform ESP8266 to the Arduino environment. Our option settings in the Arduino IDE should look like this:
- 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
- PL2303 pin π ESP8266 pin
- GND π GND
- 3.3v π 3.3v
- RX π TX
- TX π RX
Do not connect AC power during the flash cable connection. To flash the new software to our Sonoff, we have to start Sonoff in flash mode. Follow this process:
- Connect the USB converter to Sonoff.
- Hold down the Sonoff
buttonToggle
the switch to apply power to the Sonoff circuit.
- Then we can release the Sonoff button.
- After Sonoff is in flash mode, we can upload new software.
This program is very simple, so it is great for first flashing.
#define LED_PIN 13
void setup() { Serial.begin(115200);
Serial.println("START");
pinMode(LED_PIN, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH);
delay(1000);
digitalWrite(LED_PIN, LOW);
delay(1000);
Serial.println("LED");
}
ESP8266 and multiple temperature sensors DS18b20 with HTTP server.
Comments