Go Down

Topic: ESP8266WiFi library "Missing File" (Read 4646 times) previous topic - next topic

Saylictron

In Arduino master library for ESP8266WiFi two file has been missing. I have do lot of Search for that but i didn't get it. following is compilation error for ESP8266WiFi library.

In ESP8266WiFiGeneric.h ,
#include <functional>
#include <memory>

these two files are included but while compiling

C:\Users\DSI\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27:22: fatal error: functional: No such file or directory

 #include <functional>

and also

C:\Users\DSI\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27:22: fatal error: memory: No such file or directory

 #include <memory>



PaulS

What board are you compiling for?
The art of getting good answers lies in asking good questions.

pert

Just to keep things linked, here's the original issue report from the arduino-builder repository where I requested that @Saylictron instead request assistance here on the forum as the problem is unlikely to be caused by a bug in arduino-builder:
https://github.com/arduino/arduino-builder/issues/224

@Saylictron, when you encounter an error in the Arduino IDE you'll see a button on the right side of the orange bar "Copy error messages". Click that button and then paste the error to the forum USING CODE TAGS (</> button on the toolbar). This will provide extra information, which would have answered PaulS's question and gotten you a faster resolution to your problem. The code tags are important because the forum software may interpret parts of error or warning messages or code as markup, causing problems similar to the one we saw in your GitHub issue report.

huutuannl

What board are you compiling for?
helo PaulS, My project use Arduino Uno with ESP8266 v1, i add library ESP8266wifi.h and error like Saylictron appear. How can i resolve this,please.

C:\Users\DSI\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27:22: fatal error: functional: No such file or directory

 #include <functional>
and also

C:\Users\DSI\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27:22: fatal error: memory: No such file or directory

 #include <memory>

Thanks

pert

You need to understand there are two different ways of using the ESP8266 with Arduino:
  • ESP8266 as a WiFi adapter controlled by a standard Arduino board. This is the way you're using it. This is most commonly done by controlling the ESP8266 running the AT firmware by sending serial commands but that is not the only option.
  • Directly programming an ESP8266.


The ESP8266WiFi library can only be used with the esp8266 Arduino core:
https://github.com/esp8266/Arduino
to directly program the ESP8266 used in the second way listed above. You cannot use it on the Arduino Uno.

There is a library with a confusingly similar name:
https://github.com/ekstrand/ESP8266wifi
(note capitalization difference!). That can be used on an Arduino Uno to control an ESP8266 running the AT firmware. The sketches written for the ESP8266WiFi library can not be used with the ESP8266wifi.

I actually recommend a different library for that configuration:
https://github.com/bportaluri/WiFiEsp

yowelf

I have the same issue.

Thank you pert for your info

You need to understand there are two different ways of using the ESP8266 with Arduino:
  • ESP8266 as a WiFi adapter controlled by a standard Arduino board. This is the way you're using it. This is most commonly done by controlling the ESP8266 running the AT firmware by sending serial commands but that is not the only option.
  • Directly programming an ESP8266.


The ESP8266WiFi library can only be used with the esp8266 Arduino core:
https://github.com/esp8266/Arduino
to directly program the ESP8266 used in the second way listed above. You cannot use it on the Arduino Uno.

There is a library with a confusingly similar name:
https://github.com/ekstrand/ESP8266wifi
(note capitalization difference!). That can be used on an Arduino Uno to control an ESP8266 running the AT firmware. The sketches written for the ESP8266WiFi library can not be used with the ESP8266wifi.

I actually recommend a different library for that configuratio n:
https://github.com/bportaluri/WiFiEsp
The problem is I have followed steps to use ESP8266 through Arduino/Genuino UNO as slave. I have install the ESP8266 board and I can compile without problems but I cant upload the object to the board, and viceversa.

So, the problem is IDE cant compile with special headers functional and memory from ESP8266WiFi.h

Code: [Select]

...

#ifndef ESP8266WIFIGENERIC_H_
#define ESP8266WIFIGENERIC_H_

#include "ESP8266WiFiType.h"
#include <functional>
#include <memory>

#ifdef DEBUG_ESP_WIFI
....


the framework I am using is https://github.com/tinkerspy/Automaton/wiki/Machine-building-tutorial-2

Thanks to all

pert

I can compile without problems but I cant upload the object to the board, and viceversa.

So, the problem is IDE cant compile with special headers functional and memory from ESP8266WiFi.h
First you say you can compile, then you say you can't compile. Which is it?

the problem is IDE cant compile with special headers functional and memory from ESP8266WiFi.h

Code: [Select]

...

#ifndef ESP8266WIFIGENERIC_H_
#define ESP8266WIFIGENERIC_H_

#include "ESP8266WiFiType.h"
#include <functional>
#include <memory>

#ifdef DEBUG_ESP_WIFI
....


the framework I am using is https://github.com/tinkerspy/Automaton/wiki/Machine-building-tutorial-2
There's no mention of ESP8266WiFi.h anywhere in that library or that wiki page.

Please read this again:
You need to understand there are two different ways of using the ESP8266 with Arduino:
  • ESP8266 as a WiFi adapter controlled by a standard Arduino board. This is the way you're using it. This is most commonly done by controlling the ESP8266 running the AT firmware by sending serial commands but that is not the only option.
  • Directly programming an ESP8266.


The ESP8266WiFi library can only be used with the esp8266 Arduino core:
https://github.com/esp8266/Arduino
to directly program the ESP8266 used in the second way listed above. You cannot use it on the Arduino Uno.

yowelf

#7
Aug 13, 2017, 03:12 am Last Edit: Aug 13, 2017, 03:25 am by yowelf
Quote
First you say you can compile, then you say you can't compile. Which is it?
Sorry I did a mistake writing. I wanted to say if I select the board as esp8266 in the preferences of the IDE, the sketch compiles fine, but logically i cant upload to the board because fails when try to communicate with it. esp not sync. The IDE uses the library charged with the board update and c++ functional and memory calls run.

When I select the Arduino/Genuino UNO board i cant compile although I copy the library "locally" for this project. I understand this a mad solution, beacuse the differences of the chips are widely and for that exist the special repository to use esp8266 from the arduino core, but the example code says the opposite..

Quote
There's no mention of ESP8266WiFi.h anywhere in that library or that wiki page.
the last point of the example shows how to manage the machine with a web browser. To add this functionality, we need to include this header

<Atm_esp8266.h>

and start an instance

Atm_esp8266_httpd_simple server( 80 )

the header Atm_esp8266.h just calls to ESP8266WiFi.h and others,

https://github.com/tinkerspy/Automaton-Esp8266/blob/master/src/Atm_esp8266.h

Code: [Select]

#pragma once

#include <Automaton.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <WiFiUdp.h>
#include <Hash.h>

#include <Atm_esp8266_httpd_simple.hpp>
#include <Atm_esp8266_httpc_simple.hpp>
#include <Atm_esp8266_wifi.hpp>

extern Atm_esp8266_wifi wifi;



I understand both ways to use ESP8266, but this example have to use the ESP8266 board as slave and Arduino/Genuino UNO as main. We can compile and run code directly to de esp8266 board, but this code with IO pins needs this structure or similar,

thanks for the help

pert

#8
Aug 13, 2017, 03:25 am Last Edit: Aug 13, 2017, 03:25 am by pert
the last point of the example shows how to manage the machine with a web browser.
OK, that's a different library and it is written only for use directly on the ESP8266.

have to use the ESP8266 board as slave and Arduino/Genuino UNO as main. We can compile and run code directly to de esp8266 board, but this code with IO pins needs this structure or similar
You'll either need to find different code to use or you'll need to rewrite the Automaton-Esp8266 library to work for your application.

yowelf

very thanks pert.

I am trying to contact with the developer of this framework to take advice.

yowelf

Finally,

The code was suitable for a non regular ESP8266. The code works perfect using a Wemos D1 board. It has the connection capabilty of the ESP8266 and i/o pins to interact with it.

Thanks to de developer (tinkerspy)

Go Up