Hello!
I am having trouble with the ESP8266 ESP-01 Wi-Fi module (bought it from Anodas.lt if that helps).
The problem is uploading sketches to the module. I can't upload anything for the life of me. I'm using an Arduino to connect to the module. I don't have any fancy USB converters or anything and I can't order one because it will take too long. I need this thing working ASAP, it's for a qualification paper.
I've tried a bunch of things and none of them seem to have a stable upload result.
Currently my aim is to upload the standard Blink example for the ESP8266.
With the 2.5.0 board drivers I always get:
Arduino: 1.8.13 (Linux), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled, nodemcu, 26 MHz, 40MHz, DOUT (compatible), 1M (64K SPIFFS), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Sketch uses 264164 bytes (27%) of program storage space. Maximum is 958448 bytes.
Global variables use 27296 bytes (33%) of dynamic memory, leaving 54624 bytes for local variables. Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
With the 2.7.4 (newest) drivers it's:
Arduino: 1.8.13 (Linux), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled (new can abort), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Executable segment sizes:
IROM : 233748 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26888 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1248 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 1028 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 25112 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 262912 bytes (27%) of program storage space. Maximum is 958448 bytes.
Global variables use 27388 bytes (33%) of dynamic memory, leaving 54532 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port /dev/ttyACM0
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
File "/home/ansis/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/upload.py", line 65, in <module>
esptool.main(cmdline)
File "/home/ansis/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 2890, in main
esp.connect(args.before)
File "/home/ansis/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 483, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
My setup is as follows:
RXD ---> Arduino RX (digital 0)
TXD ---> Arduino TX (digital 1)
CH_PD ---> 2AA batteries + end
VCC ---> 2 AA batteries + end
GND ---> 2 AA batteries - end (I think most people call it GND)
GPIO0 ---> 2 AA batteries - end
RST ---> button ---> 2AA batteries - end
GPIO2 ---> None
My upload/program/flash procedure is as follows:
- Open Arduino IDE
- Plug in Arduino
- Plug in ESP power.
- ESP blue light flashes
- Press RST button to reset ESP into flash mode (with GPIO0 plugged into GND/-).
- The blue light flashes upon button release.
- Pull out GPIO0 or not, both methods return the same error.
- Hit "Upload" in the example sketch.
- The blue ESP light keeps blinking while uploading:
- Arduino IDE returns the errors seen above.
I've tried quite a few different setups. The interesting thing is that the upload does not fail if I connect VCC, CH_PD to the Arduino 3.3V pin and GND, GPIO0, RST (button) to the Arduino GND. It fully uploads the sketch. The thing is that even after a successful upload it does not work correctly.
For example, the standard Blink (1000ms on, 2000ms off) sketch:
On Arduino 3.3V power it just weakly flashes constantly (I mean mayybe 100ms on and 100ms off).
On AA battery power it is dimly lit, even though I know it can supply enough power to be fully lit (the blue light flashes in full brightness if I press RST).
What do I do? I just want to be able to upload programs to the module.
P.S. I also noticed that I can never get the AT commands to work. I'm not sure why.
P.P.S. I know I have to put GPIO0 to GND for it to go into Flash mode. As I mentioned, I power it up with GPIO0 grounded and also RST it with GPIO0 connected. That seems to be the most common suggestion in forums.