0

I used platformio IDE

I did "platformio lib install 1101" (http://platformio.org/lib/show/1101/ESP8266wifi),

I installed this: http://platformio.org/lib/show/549/WebSockets (follow instructions)

I did similar things to other libraries.

When I click the platformio:build button, it still complains:

fatal error: ESP8266WiFi.h: No such file or directory fatal error:

ESP8266WiFiMulti.h: No such file or directory fatal error:

ESP8266Webserver.h: No such file or directory

1

While Bhushan Patil's answer should work, it would still make future projects tedious. Instead you can add the header files to the hardware library, and use them at will, with the #include <library> syntax every other library uses in C/C++.

The PlatformIO IDE has a config file you can modify that tells the IDE where to look for libraries. You could read this file, and determine where to put your header files, such that PlatformIO could find them, or add a location to look for header files in. See this page from the PlatformIO documentation:
http://docs.platformio.org/en/latest/projectconf.html

Beyond that, you could also use the absolute path for the header file (library) you are trying to use, by doing something like

#include "/home/user/path/to/user/library.h"
0

Make sure ESP8266WiFi.h, ESP8266WiFiMulti.h, ESP8266Webserver.h files are located in the same directory where your *.uno file present.

  • I symbolic link them. It seems getting over compiled errors. Do you know how I can install arduino into platformio ide? Currently, I git clone: github.com/esp8266/Arduino and symbolic link in my project. Not a good idea. – kenpeter May 3 '16 at 4:15
0

Have you overridden lib_dir in platformio.ini? If yes, please remove it.

-1

Note the different capitalization: ESP8266wifi vs ESP8266WiFi. Confusing as it may be, these are actually two completely different libraries.

ekstrand/ESP8266wifi is a library that is to be used when you are controlling an ESP8266 running the AT firmware over a serial connection from another microcontroller board such as a more traditional Arduino. The code does not run on the ESP8266.

ESP8266WiFi is a library bundled with the ESP8266 core for Arduino. It is used for controlling the WiFi functionality of the ESP8266 when you are directly programming the ESP8266.

The WebSocket sketch you were attempting to compile was written for use with the latter library. The WebSockets library can not be used with the ekstrand/ESP8266wifi library or generally any configuration that uses the ESP8266 as a WiFi module running the AT firmware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.