FAQ¶
The purpose of this FAQ / Troubleshooting is to respond to questionscommonly asked inIssuessection and onESP8266 Community forum.
Where possible we are going right to the answer and provide it withinone or two paragraphs. If it takes more than that, you will see a link:arrow_right: to more details.
Please feel free to contribute if you believe that some frequent issuesare not covered below.
I am getting “espcomm_sync failed” error when trying to upload my ESP. How to resolve this issue?¶
This message indicates issue with uploading ESP module over a serialconnection. There are couple of possible causes, that depend on the typeof your module, if you use separate USB to serial converter.
Why esptool is not listed in “Programmer” menu? How do I upload ESP without it?¶
Do not worry about “Programmer” menu of Arduino IDE. It doesn’t matterwhat is selected in it — upload now always defaults to using esptool.
My ESP crashes running some code. How to troubleshoot it?¶
The code may crash because of s/w bug or issue with your h/w. Beforeentering an issue report, please perform initial troubleshooting.
This Arduino library doesn’t work on ESP. How do I make it working?¶
You would like to use this Arduino library with ESP8266 and it does notperform. It is not listed among libraries verified to work with ESP8266.
In the IDE, for ESP-12E that has 4M flash, I can choose 4M (1M SPIFFS) or 4M (3M SPIFFS). No matter what I select, the IDE tells me the maximum code space is about 1M. Where does my flash go?¶
The reason we cannot have more than 1MB of code in flash has to do witha hardware limitation. Flash cache hardware on the ESP8266 only allowsmapping 1MB of code into the CPU address space at any given time. Youcan switch mapping offset, so technically you can have more than 1MBtotal, but switching such “banks” on the fly is not easy and efficient,so we don’t bother doing that. Besides, no one has so far complainedabout 1MB of code space being insufficient for practical purposes.
The option to choose 4M or 1M SPIFFS is to optimize the upload time.Uploading 3MB takes a long time so sometimes you can just use 1MB. Other2MB of flash can still be used withESP.flashRead andESP.flashWrite APIs if necessary.
I have observed a case when ESP.restart() doesn’t work. What is the reason for that?¶
You will see this issue only if serial upload was not followed by aphysical reset (e.g. power-on reset). For a device being in that stateESP.restart will not work. Apparently the issue is caused byone ofinternal registers not being properly updated until physicalreset.This issue concerns only serial uploads. OTA uploads are not affected.If you are usingESP.restart, the work around is to reset ESP onceafter each serial upload.
How to resolve “Board generic (platform esp8266, package esp8266) is unknown” error?¶
This error may pop up after switching betweenstaging andstable esp8266/ Arduino package installations, or after upgrading the package versionRead more.
How to clear TCP PCBs in time-wait state ?¶
This is needed with lwIP-v1.4, less needed with lwIP-v2 but timeout is stilltoo high.
Time-wait PCB state helps TCP not confusing two consecutive connections with thesame (s-ip,s-port,d-ip,d-port) when the first is already closed but stillhaving duplicate packets lost in internet arriving later during the second.Artificially clearing them is a workaround to help saving precious heap.
The following lines are compatible with both lwIP versions:
//noneedfor#includestructtcp_pcb;externstructtcp_pcb*tcp_tw_pcbs;extern"C"voidtcp_abort(structtcp_pcb*pcb);voidtcpCleanup(void){while(tcp_tw_pcbs)tcp_abort(tcp_tw_pcbs);}
Ref.#1923