Hello,
When I'm trying to upload my sketch to arduino, everything works seems to go smoothly, however at the end of the uploading, there is usually an error.
Sketch uses 241,952 bytes (55%) of program storage space. Maximum is 434,160 bytes.
Global variables use 46,880 bytes (57%) of dynamic memory, leaving 35,040 bytes for local variables. Maximum is 81,920 bytes.
Uploading 246096 bytes from /tmp/build1487447564622711308.tmp/ESPdriver.cpp.bin to flash at 0x00000000
............................................................................................................................................................................................................................................warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed
warning: espcomm_send_command: didn't receive command response
After this happens, i cannot even attempt to upload sketches, because i immediately get the following error
warning: espcomm_sync failed
error: espcomm_open failed
Then i have to unplug USB-to-serial from my PC, plug it again and try uploading, which usually results in getting error during FLASH_DOWNLOAD_DATA again.
I should add that sometimes, in about 1 per 20 or so tries i can flash, also monitoring Serial, both sending and receiving data works fine. Every time this error happens, it appears at about the same moment (judging by the amount of dots).
I have tried both Arduino IDE with installed ESP8266 from the Board Manager and compiled one from the git by myself, same error.
I am using ESP8266-01 and MicroFTX to communicate with PC (http://jim.sh/ftx/). ESP8266 is powered by YwRobot. My OS is Ubuntu 14.04.
Because my MicroFTX doesn't support DTR I'm manually resetting and setting GPIO0 low.
Any suggestions on how could I fix this problem?
Thanks
Any suggestions?
EDIT: Using esptool.py, it seems that uploading always stops at 87%. Am I correct that this means the ESP is broken?
EDIT2: However, i managed to flash it using the .bin from arduino esp (not from esptool.py elf2image) and using esptool.py write_flash 0x00000
EDIT3: It didnt start working sadly, but I have noticed that the moment of error is persistent among the same binary. So while it was always at 87% before, later it happened at address 0x0003b000 which was 90% and then at 0x00007400 at 90% (it was while writing first file of two into flash). The error from esptool.py is always:
Traceback (most recent call last):
File "esptool.py", line 547, 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 have also noticed that almost all sources on the internet use two binary files: 0x00000 and 0x40000 and the file I get from Arduino IDE is 1 binary file .bin, while esptool.py elf2image on the elf generated by IDE generates one file at 0x00000 and one file at 0x01010. Could this be related to the issue?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I have semi-resolved this issue by editing esptool.py to be
ESP_RAM_BLOCK = 0x180
#ESP_RAM_BLOCK = 0x1800
ESP_FLASH_BLOCK = 0x40
#ESP_FLASH_BLOCK = 0x400
Instead of the commented lines. Granted, the upload is a lot slower now, however it always finishes without any errors. Any insight about why doesn't the default IDE uploader work for me?
Credit: http://www.esp8266.com/viewtopic.php?f=6&t=2791#p16082
General question? What upload speed are you using? I had mine set to ~512kbps but hat some errors now and then and set it down to 256kbps .. just asking as you never said a word about it.
I tried all of them, mostly 115200, but none worked.
Interestingly, no matter which speed i chose, the error always occured at the same % of upload.
I also get this occasionally. When I do I try again, if that does not work I exit the Arduino IDE completely and restart it. This forces a full compile, not sure if that is significant, but then routinely my upload works.
All my problems were gone as soon as I set upload speed lower. I am using the esp03 models from which I own like 5 I think. I guess it would be best to try an other unit if you have one at hand or at least order a backup unit for comparising/debugging reasons. Otherwise I dont have too much insight in the uploading process, can only hope one of da real pros read this thread ;-)
Same issue here. I can't use my esp8266-01 with Arduino IDE (1.6.5.)
I am using 1.6.5 with no problems, see http://www.forward.com.au/pfod/CheapWifiShield/ESP2866_01_WiFi_Shield/index.html for my hardware setup.
I tried to modify esptool.py like in the comments above, but I couldn't do that, because in my esptool.py is only the following:
#!/usr/bin/python
# EASY-INSTALL-SCRIPT: 'esptool==0.1.0','esptool.py'
__requires__ = 'esptool==0.1.0'
import pkg_resources
pkg_resources.run_script('esptool==0.1.0', 'esptool.py')
I found this file in /usr/local/bin (Mac OS X) should I search anywhere else?
I fix this issue increasing the current of the 3V3 power supply. the esp8266 requires more current while in programming.
I sometimes get this as well, and it seems I just need to reboot to fix it. Not really sure what that's about.
Closing per #3655 .
I succeeded after setting Serial Monitor baud rate to 115200 (default was 9600)
Most helpful comment
I sometimes get this as well, and it seems I just need to reboot to fix it. Not really sure what that's about.