Programming ESP8266-12E with Arduino Compile Error


#1

I have installed and imported the Cayenne library but keep getting the below error. I am using Arduino IDE 1.6.5.
What am I missing here?

C:\Users****\Documents\Arduino\libraries\Cayenne-Arduino-Library-master/BlynkSimpleEsp8266.h:25:25: fatal error: ESP8266WiFi.h: No such file or directory
#include <ESP8266WiFi.h>
^
compilation terminated.
Error compiling.


#2

Could you share the code you’re trying to compile, and let us know which board you have selected from Tools > Board: in the Arduino IDE?


#3

NodeMCU 1.0 (ESP-12E Module)
https://smile.amazon.com/gp/product/B01IK9GEQG/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1

//#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space

#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"
#define VIRTUAL_PIN 1

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "*******";
// Your network name and password.
char ssid[] = "**********";
char password[] = "***********";

void setup()
{
  Serial.begin(9600);
  Cayenne.begin(token, ssid, password);
}

void loop()
{
  Cayenne.run();
}

#4

I am able to compile and upload anything that doesn’t include the Cayenne library. I tried a couple of esp8266 examples (Not Cayenne examples) and they compiled and uploaded properly. I have tried removing the Cayenne library, restarting the IDE, then reinstalling the library. I have installed the library through the Sketch->include library-> add .ZIP library as well as just extracting the ZIP to the Arduino library. neither way works so far.


#5

I can reproduce your error message, but only when I purposefully choose an Arduino board instead of an ESP8266 one from this menu:

Perhaps worth updating your IDE? The latest is 1.8.3 – my tests were done on 1.8.1 so there could be some incompatibility: https://www.arduino.cc/en/Main/Software

I’d also check the Boards Manager and the Libraries Manager in the IDE for anything that is ‘Updateable’ and apply those updates before trying again.


#6

That did it! I updated to the latest version of Arduino and it compiled and uploaded like it should. Now I just need to figure out why it won’t connect to my wifi or output any serial.
Thanks!!!


#7

:slight_smile: no worries, glad to be of some help. If you run into another brick wall let us know and we can try to help with that as well.