Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By PaulRB
#26052
Barnabybear wrote:You should only get 10 to 20 char of garbage on the serial whilst the baud rate is established, more than that sugests that it has booted into SD card mode (which keeps slowly producing garbage char).

Its hard to say how many characters it is, given I can't get anything to read it at the correct baud. At the wrong baud, 20 characters could turn into 5 or 50 garbage characters.

There is only one quick spurt of garbage, immediately after reset. Nothing after that.

Barnabybear wrote:to prevent this I connected RST (or GPIO 15 as its sometimes silk screened on boards, but visably doesnt appear to be) directly to VCC (infact on most of my boards its soldered to VCC the pin next to it to prevent random resets) and used CH_PD or disconected the power to force a reboot. Basicaly just swap the connections to the ESP pins 4 & 6 on the schematic on the first page of posts.


With the ESP-01 connected like you suggest, I can't get it into program upload mode. If I use the reset line (+GPIO2 low) to get it into program upload, load up my simple sketch, then put reset to high and use CH_PD or cycle the power to restart the ESP, I just get the spurt of garbage again.

I have re-installed IDE 1.6.5 and the ESP package from Board manager. No change.

Is anyone out there successfully getting programs to run on ESP-01 with Arduino IDE 1.6.5 and the latest ESP8266 board on Linux rather than Windows?
User avatar
By Barnabybear
#26056 Hi, other than bad connections this works everytime for me.
Image
Use 3.3v switch to power off hold GPIO0 switch and power back on. Should boot in to flash mode (blue led flashes once), at the end of the flash the sketch should run regardless of the GPIO 0 switch postion. I use a jumper rather than a switch so that I can leave it on and just power cycle to enter flash mode. Power cycled with the GPIO 0 switch open it should boot into run mode (blue led flashes twice).
User avatar
By PaulRB
#26073 @BarnabyBear, thanks for your continued attempts to help.

I just connected the esp as in your diagram, except for the 2 10K pullup resistors, I just connected GPIO2 to 3.3V and GPIO0 to either 3.3V or 0V. I don't think that makes any difference, except to protect the GPIO lines from shorting if the sketch makes them outputs, which my simple sketch does not.

Its just the same. I put the ESP into program mode by connecting GPIO0 to 0V, cycle the power and get the single blue flash. I can then upload the sketch, which seems to complete ok. I then connect GPIO0 to 3.3V and cycle the power. I only get one blue flash, not two, the garbage on the serial monitor and the sketch does not run.

Does the single blue flash in what is supposed to be run-mode mean something? Despite the single flash, the esp is not in program mode, because if I attempt to upload the sketch, I get:
Code: Select allSketch uses 205,612 bytes (47%) of program storage space. Maximum is 434,160 bytes.
Global variables use 32,920 bytes (40%) of dynamic memory, leaving 49,000 bytes for local variables. Maximum is 81,920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed


Next I tried connecting GPIO2 to 0V and GPIO0 to 0V and cycle the power. No blue flash, just the red power led comes on as normal.

If I connect GPIO2 to 0V and GPIO0 to 3.3V and cycle the power, the blue led comes on steady a fraction of a second after the red led, and stays on as long as the power is on.

I don't know what the above 2 tests mean, if anything.

I have seen on another thread, I forget where, not this forum, that it might be worth a try using esptool to re-flash the AT command firmware back onto the ESP. If that works, I can re-try my Arduino sketch.

Where do I get the AT firmware binary? I googled, but the links I found to the binary were broken.
User avatar
By PaulRB
#26075 OK, I found a link to what I hope is a suitable binary here.

Next I downloaded esptool.py and ran the following command:
Code: Select allpaul@paulsLaptop:~/esp_flasher$ ./esptool.py -p /dev/ttyUSB1 write_flash 0x000000 ESP8266_9.0_AT_BIN.bin
Connecting...
Erasing flash...
Writing at 0x00002800... (2 %)
Traceback (most recent call last):
  File "./esptool.py", line 570, in <module>
    esp.flash_block(block, seq)
  File "./esptool.py", line 204, in flash_block
    struct.pack('<IIII', len(data), seq, 0, 0)+data, ESPROM.checksum(data))[1] != "\0\0":
  File "./esptool.py", line 107, in command
    raise Exception('Invalid head of packet')
Exception: Invalid head of packet


I repeated this more than a dozen times. Once it got to 37%, but most times does not get past 1% or 2%.

Help? I just can't seem to get a break here!