Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arduino IDE can't find ESP8266WiFi.h file

Tags:

I am trying to use NOD MCU ESP8266WiFi with Arduino IDE

When I run this code:

#include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> char auth[] = "YourAuthToken"; char ssid[] = "YourNetworkName"; char pass[] = "YourPassword";  void setup(){   Serial.begin(9600);   Blynk.begin(auth, ssid, pass); } void loop() {   Blynk.run(); } 

I get the following error:

fatal error: ESP8266WiFi.h: No such file or directory       #include <ESP8266WiFi.h>                              ^ compilation terminated.  exit status 1 Error compiling for board Arduino/Genuino Uno. 
like image 374
Abuwesam Avatar asked Apr 28 '18 19:04

Abuwesam


People also ask

What is ESP8266WiFi H?

ESP8266 is all about Wi-Fi. If you are eager to connect your new ESP8266 module to a Wi-Fi network to start sending and receiving data, this is a good place to start.


2 Answers

When programming the NODEMCU card with the Arduino IDE, you need to customize it and you must have selected the correct card.

Open Arduino IDE and go to files and click on the preference in the Arduino IDE.

Add the following link to the Additional Manager URLS section: "http://arduino.esp8266.com/stable/package_esp8266com_index.json" and press the OK button.

Then click Tools> Board Manager. Type "ESP8266" in the text box to search and install the ESP8266 software for Arduino IDE.

You will be successful when you try to program again by selecting the NodeMCU card after these operations. I hope I could help.

like image 95
gokhan Avatar answered Sep 21 '22 00:09

gokhan


Starting with 1.6.4, Arduino IDE can be used to program and upload the NodeMCU board by installing the ESP8266 third-party platform package (refer https://github.com/esp8266/Arduino):

  • Start Arduino, go to File > Preferences
  • Add the following link to the Additional Boards Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json and press OK button
  • Click Tools > Boards menu > Boards Manager, search for ESP8266 and install ESP8266 platform from ESP8266 community (and don't forget to select your ESP8266 boards from Tools > Boards menu after installation)

To install additional ESP8266WiFi library:

  • Click Sketch > Include Library > Manage Libraries, search for ESP8266WiFi and then install with the latest version.

After above steps, you should compile the sketch normally.

EDIT: the lib might have already been included in the later version of Arduino IDE, so firstly, check if it is included, then if not yet, install it, you can refer below link for a systematic guidance on how to debug such kind of issue: https://www.programmingelectronics.com/no-such-file-error/

like image 33
Steven Lee Avatar answered Sep 17 '22 00:09

Steven Lee