Hi All,
1st post here so if I need to post this elsewhere or make a dumb error please help me get it right.
I have been trying to upload the "Blink" sketch to my ESP8266 for 3 days and I'm struggling to get the sketch to upload.
Sketch:
/*
ESP8266 Blink by Simon Peter
Blink the blue LED on the ESP-01 module
This example code is in the public domain
The blue LED on the ESP-01 module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}
Setup:
-
Arduino Mega 2560 Rev3
-
ESP8266-01S from AZ Delivery (ESP8622-01S)
-
Power supply for ESP8266: PSU from AZ Delivery
-
ESP8266, PSU & reset button mounted on breadboard
-
I have the TX => TX and RX => RX between the Arduino and the ESP8266
-
I have a ground connection between the breadboard and the Arduino
-
I have the GPIO0 connected to Ground
-
I have a reset button connected to the reset (RST) pin
Actions I take:
- Power up Arduino and ESP8266
- Connect Ardunio IDE (2.0.3) to Ardunio via standard USB cable.
- Open Serial Monitor. Set "Both NL & CR" & "74880 baud" options.
- Press the reset button for the ESP8266
- Observe
ets Jan 8 2013,rst cause:2, boot mode:(1,7)
showing on screen. I understand that the "1" indicates that I am in programming mode. - Close Serial Monitor
- Click "Upload"
- Observe output.
- The last few lines show:
"C:\Users\Des\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3" -I "C:\Users\Des\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1/tools/upload.py" --chip esp8266 --port "COM3" --baud "115200" "" --before default_reset --after hard_reset write_flash 0x0 "C:\Users\Des\AppData\Local\Temp\arduino-sketch-115050097BAF3ED954AC2171AD3C831D/Blink.ino.bin" esptool.py v3.0 Serial port COM3 Connecting........_____....._____....._____....
- While this is happening the blue LED on the ESP8266 is flashing.
- While the "Connecting" dots and dashes are marching, I press the RST button. No observable change on screen. Blue flashing LED briefly stops, then resumes.
- Eventually, I get,
A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
- I then spend many hours Googling the error and everything about this issue.
So, any ideas, thoughts, suggestions or requests for more info would be happily recieved!
Finally, it may be worth mentioning that if I disconnect the ground from GPIO0 and run AT from the Serial Monitor I get:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79
2nd boot version : 1.5
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000
rf cal sector: 249
rf[112] : 00
rf[113] : 00
rf[114] : 01
SDK ver: 1.5.4.1(39cb9a32) compiled @ Jul 1 2016 20:04:35
phy ver: 972, pp ver: 10.1
However, if I change to "115200 baud" and reset the ESP8266 I get a load of gibberish followed by:
Ai-Thinker Technology Co. Ltd.
ready
Thanks for your time and look forward to any input,
Des