Want to blink GPIO2 LED (built in) on ESP8266-01 (1024K) module

Dear All,

I'm able to flash the empty arduino sketch and LED blink code (GPIO2) but not blinking the LED.
DO I need to flash any bootloader or anything ?
I have black color ESP8266-01 module.
While programming I pull down the GPIO0 pin and for booting I pulled up the GPIO0...
What could be the problem for not booting the ESP8266 blink code ?

This is the code I flashed into ESP8266-01 using Arduino IDE (Board selection is "Generic ESP8266")

const short int BUILTIN_LED1 = 2; //GPIO2
//const short int BUILTIN_LED2 = 0; //GPIO0
void setup() {
pinMode(BUILTIN_LED1, OUTPUT); // Initialize the BUILTIN_LED1 pin as an output
//pinMode(BUILTIN_LED2, OUTPUT); // Initialize the BUILTIN_LED2 pin as an output
}

void loop() {
digitalWrite(BUILTIN_LED1, LOW); // Turn the LED ON by making the voltage LOW 
//digitalWrite(BUILTIN_LED2, LOW); // Turn the LED ON by making the voltage LOW 
delay(5000); // Wait for a second
digitalWrite(BUILTIN_LED1, HIGH); // Turn the LED off by making the voltage HIGH
//digitalWrite(BUILTIN_LED2, HIGH); // Turn the LED off by making the voltage HIGH
delay(5000); // Wait for a seconds

}

Can anyone help me on this issue ?

  1. I also want to perform some AT operation.
    I tried to use this but not able to type or response from ESP8266-01 but junks.
    GitHub - espressif/ESP8266_AT: This project is not maintained, please use https://github.com/espressif/esp-at.

Can you also please help me to change the ESP8266-01 in AT mode ?

Regards,
Titus S.

You can either use the ESP-01 with the Arduino IDE to upload sketches, OR you can control the module with AT commands. You can NOT do both.
Uploading from the Arduino IDE with those cores basically flashes all in one step. You've already overwritten the AT-command recognizing firmware that came with the module by using the Arduino IDE.

See if changing
const short int BUILTIN_LED1 = 2; //GPIO2
to
const byte BUILTIN_LED1 = 2; //GPIO2

does anything. "short int" is redundant on the Arduino.

Thank you so much.
It didn't work.

I tried to blink the LED via GPIO0, same issue.
const byte BUILTIN_LED1 = 0; //GPIO0

Any other suggestions please ?

May be HW issue ?

After flashing the code via Arduino IDE,

Pull up the GPIO0 and CH_PD pins
Vcc to 3.3V
Gnd to Gnd
RST - Floating
GPIO2 is connected to LED and grounded via 330 ohms resistor.

For flashing:
Pull up the CH_PD
Pull down the GPIO0 via R330
Vcc to 3.3V
Gnd to Gnd
RST - Floating
Pull up the GPIO2

  1. I want to interface the DHT11 temp sensor and want to send via MQTT using WiFi IP.
    Can you provide the example please ?

I am afraid that LED itself is not working.

Thought you were blinking the onboard LED. Now you're using a separate LED?

You can test it by connecting the leads to a 3V coin cell battery (CR2032, CR2016, etc)

You need to explain how you're uploading sketches. How do you have the ESP-01 connected to your PC? Are you using an FTDI board, cable, Arduino as ISP, what?

Yes, I have Serial to USB converter cable which is connected to PC.
Want to use separate LED on ESP-01 module (like GPIO0 or GPIO2)
Some times GPIO1 (on board blue LED) is blinking and some times not.

const byte BUILTIN_LED1 = 1; //GPIO0

void setup() {
pinMode(BUILTIN_LED1, OUTPUT); // Initialize the BUILTIN_LED1 pin as an output
}

void loop() {
digitalWrite(BUILTIN_LED1, LOW); // Turn the LED ON by making the voltage LOW
delay(2000); // Wait for a second
digitalWrite(BUILTIN_LED1, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for a seconds

}

WiFi code:

#include <ESP8266WiFi.h>

const char* ssid = “TitusMobile”;
const char* password = “tituswifi”;

void setup() {
Serial.begin(115200);
delay(10);

Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.mode(WIFI_STA); //We don’t want the ESP to act as an AP
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println(“WiFi connected.”);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}

void loop() {
delay(1);
}

I also tried to flash this code too and not able to connect to my network and didn’t see any message in serial port (TXD and RXD of ESP-01)

On whole, flashing is working good but not able to boot any code :frowning:

I left float all the pins except GND, VCC and CH_PD pins for booting purpose.

Can you please suggest me for boot settings ?

Hello,

I am getting the below errors in serial port whenever I flash the code into ESP-01 module and after set to boot mode.

ets Jan 8 2013,rst cause:2, boot mode:(3,3)

load 0x4010f000, «¹164, room 16
tail
chksum 0x0f
csum ÂÁf
~ld

Exception (0):
epc1=0x402056a0 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys
sp: 3ffff6e0 end: 3fffffb0 offset: 01a0

stack>>>
3ffff880: 40100bc1 40100bbe 309cbfff f6ac5105
3ffff890: 400005e1 f76d6d00 d114c9ae ab5aa18c
3ffff8a0: 402164c0 00000030 00000020 4d39de15
3ffff8b0: 00000000 60000a04 00000001 00000015
3ffff8c0: 00000000 00000052 e8000000 00000038
3ffff8d0: 0100157c 00000000 00000000 00000006
3ffff8e0: 00000000 00000000 0000006f 00000000
3ffff8f0: 00000000 00000000 00000001 40006545
3ffff900: 00000000 00000000 00000000 40006545
3ffff910: 00000000 3ffff9b0 3ffe9378 2e2c2927
3ffff920: 400069d9 00000000 00000000 00000000
3ffff930: 40217aa1 00000138 00000172 4021798d
3ffff940: 00000000 00000000 00000000 00000000
3ffff950: fffffff0 00000014 402164a7 00000006
3ffff960: 00000000 3ffe93ba 00000001 00000000
3ffff970: 3ffff9b0 3ffe93ba 00000001 0000001f
3ffff980: 00000040 00000010 00000001 00000033
3ffff990: 00000052 00000105 00000138 0000001f
3ffff9a0: 00000138 00000000 00000001 00000006
3ffff9b0: 402163e8 40213152 00000006 00000000
3ffff9c0: 3ffe93ba 00000001 00000006 00000064
3ffff9d0: 3ffe93ba 00000000 00000006 40006784
3ffff9e0: 00000001 3ffe9378 3ffe9378 00000008
3ffff9f0: 400061cc 3ffe8030 00000000 4021354b
3ffffa00: 00000000 3ffe9378 00000006 2e2c2927
3ffffa10: 0000512d 40214da0 3ffe9378 3ffe9388
3ffffa20: 40214db5 3ffe9378 3ffe9388 3ffe9378
3ffffa30: 3ffe9424 00000001 3ffe9388 3ffe9378
3ffffa40: 3ffe9378 60000600 60000200 00000000
3ffffa50: 40210b9b 00000000 3ffe9388 3ffe9378
3ffffa60: 40101e2a 60000e00 4c60f0c7 60000e00
3ffffa70: 40215a3d 60000e68 00000008 40203fea
3ffffa80: 00000000 40203fd5 00000000 3c18fe34
3ffffa90: b200cb23 000068ac 3ffefac4 00000000
3ffffaa0: 40201785 3ffefac4 3ffefac4 3ffe8b22
3ffffab0: 4022db50 00000001 00000000 00000000
3ffffac0: 00000001 3ffefac4 000002f4 003fc000
3ffffad0: 401010be 40100c3c 3ffe8b22 402053b3
3ffffae0: 40205a40 60000e00 3ffefac4 40205a1b
3ffffaf0: 40100e46 000003fd 40100c3c 3fffffb0
3ffffb00: 3fffff10 eac7895a 56a03db4 70f55fd0
3ffffb10: ffffffff ffffffff ffffffff ffffffff
3ffffb20: ffffffff ffffffff ffffffff ffffffff
3ffffb30: ffffffff ffffffff ffffffff ffffffff
3ffffb40: ffffffff ffffffff ffffffff ffffffff

After I modified the board manager settings (attached), not getting oops log in serial.

Can I use this code and will it work ?

void setup() {
Serial.begin(115200);
delay(10);
}

void loop() {
Serial.println(“Hello world”);
}

This code is also not running and not even LED blinking.
Not sure why :frowning: spent so many hours to run one LED blink and WiFi code on ESP-01 module.
Any help greatly appreciated.
Thanks.

I have the ESP8266 (ESP-01) black colored module.
Like below
http://www.esp8266.nu/index.php/Tutorial_ESPEasy_Firmware_Upload

Arduino_Board_Manager.png