I am trying to upload the Blink example from the Arduino IDE to a ESP8266-01 module using an Arduino Uno as serial programmer.
Now, the upload is successful but, upon restart (and disconnecting GPIO0 from GND), nothing happens.
I have tried with different example sketches but it seems code was not uploaded.
My Board manager configuration
- Board: Generic ESP8266 Module
- Flash mode: QIO
- Flash frequency: 40 MHz
- CPU frequency: 80 MHz
- Flash size: 1M (128K SPIFFS)
- Debug port: Serial
- Debug level: none
- Reset method: ck (tried nodemcu too without success)
- Upload speed: 115200
- USB port
As an addition, here's what I get from the ESP01 through the Arduino IDE Serial monitor:
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
e:
ets Jan 8 2013,rst cause:3, boot mode:(3,7)
ets_main.c
and here's the IDE console window output:
sptool.py v1.3
Connecting..........
Auto-detected Flash size: 8m
Running Cesanta flasher stub...
Flash params set to 0x0020
Writing 229376 @ 0x0... 0 (0 %)1024 [...]
Wrote 229376 bytes at 0x0 in 39.0 seconds (47.0 kbit/s)...
Writing 229376 @ 0x10000... 0 (0 %)1024 [...]
Wrote 229376 bytes at 0x10000 in 39.0 seconds (47.0 kbit/s)...
Leaving...
The sketch I am using
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 acive 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)
}
1 Answer 1
If you are using an ESP01 I don't think you should be using GPIO1 as the output pin, its my understanding that they don't have GPIO1.
I think they have GPIO0 and GPIO2, so you should have attached the LED to GPIO2 and use digitalWrite(2, HIGH);
in you code.
Have a look at this page and see if what its on about is what you are trying to do.
http://iot-playground.com/blog/2-uncategorised/38-esp8266-and-arduino-ide-blink-example
-
I guess it may be better to use a sketch which writes to the serial console to see signs of life from it if the led method is not conclusive. Incidentally, connecting a Uno directly to the ESP01 (which the OP appears to be doing) will result possibly in 5v at the ESP01 RX pin and some sort of level shifting is recommended.6v6gt– 6v6gt2017年02月27日 13:43:52 +00:00Commented Feb 27, 2017 at 13:43
-
Exactly, that is what I thought and apparently serial communication within the sketch is not working (the code was just sending a string over serial, no leds involved).Anelito– Anelito2017年02月27日 17:54:11 +00:00Commented Feb 27, 2017 at 17:54
-
GPIO1
is also known as TX, and on the ESP-01 it can be used as a digital output. Note that the blue on-board LED is also tied toGPIO1
, as an inverted on-low configuration. You can't useSerial.begin
if you use TX as an output.dandavis– dandavis2017年02月27日 19:04:41 +00:00Commented Feb 27, 2017 at 19:04 -
I'm using this sketch:
void setup() { Serial.begin(9600); } void loop(){ Serial.println("Hello World!"); delay(1000); }
Anelito– Anelito2017年02月27日 23:03:33 +00:00Commented Feb 27, 2017 at 23:03 -
@Anelito - 1. Are you connecting via Arduino? 2. Can you connect direct to PC/Mac? 3. Have you got a second ESP-01? 4. Are you using level shifting?Code Gorilla– Code Gorilla2017年02月28日 08:09:58 +00:00Commented Feb 28, 2017 at 8:09
1
instead of the macro