IDE 1.6.4 compiler stalls on ESP8266 example...no errors...just sits n spins

The ESP8266 example below won't finish compiling - it just stops part of the way through and the little blue Windows ghost chases its tail forever. I left it overnight and it was still chasing its tail in the morning.

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

const char* ssid = "........";
const char* password = "........";

ESP8266WebServer server(80);

const int led = 13;

void handleRoot() {
  digitalWrite(led, 1);
  server.send(200, "text/plain", "hello from esp8266!");
  digitalWrite(led, 0);
}

void handleNotFound(){
  digitalWrite(led, 1);
  String message = "File Not Found\n\n";
  message += "URI: ";
  message += server.uri();
  message += "\nMethod: ";
  message += (server.method() == HTTP_GET)?"GET":"POST";
  message += "\nArguments: ";
  message += server.args();
  message += "\n";
  for (uint8_t i=0; i<server.args(); i++){
    message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
  }
  server.send(404, "text/plain", message);
  digitalWrite(led, 0);
}

void setup(void){
  pinMode(led, OUTPUT);
  digitalWrite(led, 0);
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  Serial.println("");

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  if (MDNS.begin("esp8266")) {
    Serial.println("MDNS responder started");
  }

  server.on("/", handleRoot);

  server.on("/inline", [](){
    server.send(200, "text/plain", "this works as well");
  });

  server.onNotFound(handleNotFound);

  server.begin();
  Serial.println("HTTP server started");
}

void loop(void){
  server.handleClient();
}

The troubleshooting link was of no help, and I have found nothing on Google.

I'm running Windows 7-64 Home Premium.

Is it time to install 1.6.x x > 4 ?

Screenshot attached showing final message from compiler...

(I can compile other examples, including the WiFiClient example.)

DaveEvans:
Is it time to install 1.6.x x > 4 ?

I would recommend at least using 1.6.5-r5. I encountered similar issues with 1.6.4(IDE 1.6.4 Compiler warnings setup · Issue #3124 · arduino/Arduino · GitHub). There were some issues with ESP8266WiFi introduced in 1.6.6 but I think they have those all worked out in Arduino IDE 1.6.9.

Um. Doesn't the ESP board support package (whichever one you're using) install it's own version of gcc for the Tensilica CPU that it uses? It's an entirely different chip than any of those supported by the official Arduino compilers...

From my very limited limited understanding of the fix of #3124(CollectStdOutExecutor and CollectStdOutStdErrExecutor were plain wron… · arduino/Arduino@8a1e6c8 · GitHub) it seemed that this was a general IDE bug rather than compiler specific but I could be wrong.

pert:
I would recommend at least using 1.6.5-r5.

Ok, thanks - I'll give 1.6.5-r5 a try.

Well, at least now with 1.6.5-r5 it gives me error messages (attached)! It looks like a conflict in libraries, but I'm not sure which to delete (if any).

errorMsg.txt (19.8 KB)

You need to move the folder C:\Users\NewStdUser\Documents\Arduino\libraries\WiFi somewhere else, not in the libraries folder. I'm not sure what that library is but it's causing the wrong version of WiFiClient.h to be included. The one that should be included is at C:\Users\NewStdUser\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi.

Is there a particular reason you're using version 2.0.0 of the ESP8266 core? The latest is 2.2.0, might be worth an upgrade.

Fantastic - it works! Thank you! +1

pert:
Is there a particular reason you're using version 2.0.0 of the ESP8266 core? The latest is 2.2.0, might be worth an upgrade.

Um... because it's what I first downloaded when I bought the ESP8266?

I'll do the upgrade - thanks for the suggestion.

In the FWIW and hope-it-helps-someone-else category:

I updated the ESP8266 library to 2.2.0 but, when I "undeleted" C:\Users\NewStdUser\Documents\Arduino\libraries\WiFi, I got the same error message.

I then updated the C:\Users\NewStdUser\Documents\Arduino\libraries\WiFi library from the Arduino master-library on Github and it compiled without errors.

So I guess some (or all) of the problem was the old (2014-ish) WiFi library.

Apologies for not thinking of this until now.

Hello,

I write this with the idea that it could save time to others that get this kind of problem ...

I started with Arduino and ESP8266 2 months ago when I received the NodeMcu v.3. I used the IDE compiler available at that time (1.6.11 or 1.6.12?) and the latest ESP6288 core. I was using a Windows 7 Home Premium. I wrote 2 sketches of medium complexity and stopped the development for about one week. During this period I received the board Arduino Pro Mini and the board Wemos D1 Mini. I wanted to change from the NodeMcu v.3 to the Wemos D1 Mini. For the first time I changed boards and selected the Arduino Pro Mini in the Arduino Ide. I observed compiler problems but gave no importance. Then 2 days ago I returned to my projects and tried to upload them to the new Wemos Di Mini ... and my problems started!

... the compiler started to stop about in the middle of the compilation giving no error. I start to test the blink sketch or even a null sketch. On some occasions the compiler finish the job and, on other occasions, it just stopped. In the last 48 hours I googled and experimented all the available suggestions that I found, including:

  • removing all the antivirus
  • removing all Java
  • going back to previous releases of the IDE and of the ESP8266 core
  • using the portable installation

and no solution. When I started the compilation either verifying (1st button on the top left) or uploading (2nd button) and after about 1 minute the compiler stops the verbose and nothing happens if I left the computer for about 15 minutes (I am very patient to wait so long! :slight_smile: ). And the button stays in orange color. So what I was doing was: quit the IDE and after changing something, on a typical trial and error procedure, start again. I used to terminate the processes (related to the IDE) in the Task Manager that were running even after closing the IDE.

At the moment of writing I have 2 (portable) installations:

1.6.5 IDE + 2.2.0 ESP core
1.8.0 IDE + 2.3.0 ESP core

I was experimenting with the second one and when the compiler frozen, instead of shut down the IDE, I just press again the orange button. To my surprise the compiler restarted. After stopping again, I pressed again the orange button et voila - it compiled until the end! So I loaded my medium complexity sketch and, doing the same, I was able to get it compiled. After the first compile, the following ones are very rapid even if I make changes. It looks like I am OK now. When I have to program the other board (the Arduino Pro Mini) I will use a separate portable installation.

This seems rather non technical but was a solution for me!

Regards, Vladis

@ Vladis

There is no need to remove either Java or antivirus

As far as the AV and other security software goes just add the correct Arduino folders to the white or exclusions list. Adding the temp folders is one I would not recommend outright unless you know you are secure and careful though.

Not yet seen an issue with Java and the IDE (1.6.5r5 1.6.12 1.8.0) on win XP, 7, 8, 8.1, 10 or Server 2012 either in VM's or otherwise.

Hi again,

4 months after my post and the problem persists! However I got a workaround! In Windows I created another user and called it "Arduino". When I need to work with the Arduino IDE, I just terminate my usual session as "Vladis" and I start a session as "Arduino". It works fine and no compiler stops. The only problem is that I only try just to use the Arduino IDE when I am logged in as "Arduino" as I am afraid that running another programme I may enter the same problem!

Regards, Luis