Difference between revisions of "ESP8266"

From Review or Discard at Will
Jump to: navigation, search
(esptool.py: add esptool.py --port COM21 flash_id)
(Resources: Add esptool)
Line 6: Line 6:
*[https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool Sonoff-Tasmota Esptool]
*Decent writeup on [http://www.esp8266.com/viewtopic.php?f=9&t=820 FTDI config] with RTS and DTR
*Decent writeup on [http://www.esp8266.com/viewtopic.php?f=9&t=820 FTDI config] with RTS and DTR
*[https://github.com/jpmens/mqttwarn mqttwarn]
*[https://github.com/jpmens/mqttwarn mqttwarn]

Revision as of 07:34, 20 April 2019


My ESP8266 adventures history

  • 14 July 2016 - Ohh snap! Discovered homie arduino / MQTT goodness for ESP8266. Implemented mqttwarn to rewrite topics
  • 12 July 2016 - Began working with Nodemcu using esplorer
  • 19 September 2015 connected a ESP8266-01 to an arduino as a serial terminal.


Arduino as serial terminal

jha 9/9/2015

eXperiment with Esp8266
Use the arduino as a terminal to check / program the ESP8266
found the soft serial code here: https://www.arduino.cc/en/Tutorial/SoftwareSerialExample

"Works on my machine"


#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {

  mySerial.begin(115200); // the ESP8266 I bough on Amazon defaulted to 115,200 baud rate.


// the loop function runs over and over again forever
void loop() {
   if (mySerial.available()) {
  if (Serial.available()) {

Change and save default baud rate

I want to lower the baud rate because the arduino doesn't keep up with 115200 in the soft serial. I tried to issue the command "AT+UART_DEF=9600,8,1,0,0" to change and SAVE the baud rate but couldn't due to the unreliability of the soft serial at that speed. I was able to change the current baud rate (a shorter string) with "AT+CIOBAUD=9600" Then change baud rate for mySerial in the code, and then write with: "AT+UART_DEF=9600,8,1,0,0" Don't disturb the power while doing this. Then check by disconnecting power and restarting with the terminal set to 9600.

Find some SSIDs






Flash esp-01


esptool.py --port COM21 flash_id
esptool.py --port COM21 erase_flash
esptool.py --port COM21 write_flash 0x1000 .\sonoff-classic.bin
esptool.py --port COM21 write_flash -fs 1MB -fm dout 0x0 sonoff-classic.bin