0
\$\begingroup\$

I am trying to flash an ESP8266-01. I connect GPIO0 to GND, and toggle reset to ground and back, to put the ESP01 into flash mode. The blue led on the ESP flashes once, not twice. It used to flash twice, and I could send AT commands via a serial monitor, and it worked well. I connected to my router and got online. All good.

I am using a 5v 1A wallwart to power the ESP via LM1117 3.3v.

After trying to upload a program to the ESP via Arduino IDE, things changed. Now it flashes once, and I get no response to AT commands. No echo at all.

When I put the ESP into flash mode (GPIO0 low), I just get:

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

When I toggle reset (GPIO0 high), I just get:

ets Jan 8 2013,rst cause:2, boot mode:(3,7)
ets_main.c

I tried the following:

Clinic:esptool-master fedfull$ sudo python esptool.py --baud 921600 --port /dev/tty.usbserial-A50285BI write_flash -fm dio 0x00000 /esptool-master/v20ATFirmwareESP.bin
esptool.py v1.3-dev
Connecting...
Auto-detected Flash size: 8m
Running Cesanta flasher stub...
A fatal error occurred: Timed out waiting for packet header

I have Tried changing the baud to 9600, 19200, 57600, 74880, 38400, 115200, and 345600. The lower rates don't include the 'Auto-detected Flash size: 8m' or 'Running Cesanta flasher stub...'

On further testing:

Clinic:~ fed$ esptool.py --baud 115200 --port /dev/tty.usbserial-A50285BI flash_id
esptool.py v1.3-dev
Connecting...
Manufacturer: e0
Device: 4014

Clinic:~ fed$ esptool.py --baud 115200 --port /dev/tty.usbserial-A50285BI chip_id
esptool.py v1.3-dev
Connecting...
Chip ID: 0x001eb645

Clinic:~ fed$ esptool.py --baud 115200 --port /dev/tty.usbserial-A50285BI read_mac
esptool.py v1.3-dev
Connecting...
MAC: 5c:cf:7f:1e:b6:45

Clinic:~ fed$ esptool.py --baud 115200 --port /dev/tty.usbserial-A50285BI erase_flash
esptool.py v1.3-dev
Connecting...
Running Cesanta flasher stub...
A fatal error occurred: Timed out waiting for packet header 

I have rechecked my connection many times.

Does the blue led flashing once only mean anything? Any idea what I've done wrong.

\$\endgroup\$
  • \$\begingroup\$ Are you sure about the baud rate? Have you tried different values? I think I remember that the default baud rate changed at some point, so depending on what model ESP8266 you've got and what version of firmware it has, it may not be 921600 baud. \$\endgroup\$ – Roger Rowland Nov 26 '16 at 14:27
  • \$\begingroup\$ Thanks for the suggestion. I tried several, and no change. At lower baud (9600), the Atu-detect Flash size does not appear. \$\endgroup\$ – Fed Nov 26 '16 at 14:54
  • \$\begingroup\$ Does the blue led flashing once only mean anything? It used to flash twice, and I could send AT commands via a serial monitor, and it worked well. Now it flashes once, and I get no response to AT commands. No echo at all. When I put the ESP into flash mode, I just get 'ets Jan 8 2013,rst cause:2, boot mode:(1,7)' \$\endgroup\$ – Fed Nov 26 '16 at 14:56
  • \$\begingroup\$ When I just toggle reset (ie non flash mode), I don't get the full startup sequence, but just 'ets Jan 8 2013,rst cause:2, boot mode:(3,7) ets_main.c' \$\endgroup\$ – Fed Nov 26 '16 at 15:02
  • \$\begingroup\$ Is your power suply sufficient? \$\endgroup\$ – Wouter van Ooijen Nov 26 '16 at 16:29
1
\$\begingroup\$

The blue LED is connected to the TXD line of the esp-01, it flashes when something is sent on the serial port. The shipped firmware that responded to AT commands is overwritten when you flash something else onto the chip, like another firmware or random garbage. If you are reading

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

Then the serial port baudrate is correct. It seems to me that all you require is some valid firmware or a copy of the firmware/program you deleted to begin with.

    esptool.py --baud 115200 --port /dev/tty.usbserial-A50285BI read_flash 0x0 1048576 backup.bin

will copy the contents of a new esp-01 to your hdd so you can write it back when your own program fails. That way you can still use the AT commands.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.