Go Down

Topic: ESP8266WiFi.h not found even if present (Read 1 time) previous topic - next topic

riker1

Hi

I have an esay sketch to check.

ESP01s attached to an Arduino UNO.

Used example sketch.  BasicOTA

installed ESP8266  and libs are in
~/.arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi

BasicOTA/BasicOTA.ino:1:25: fatal error: ESP8266WiFi.h: No such file or directory

how do I have to config the arduino IDE that libraries are picked up !!


Strangewise when compiling for NodeMCU or ESP Generic no compile errors.  but can not upload  to the uno.
but for Arduino UNO it is.





Code: [Select]
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>


void setup() {
  Serial.begin(115200);
  Serial.println("Booting");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");
    delay(5000);
    ESP.restart();
  }

  // Port defaults to 8266
  // ArduinoOTA.setPort(8266);

  // Hostname defaults to esp8266-[ChipID]
  // ArduinoOTA.setHostname("myesp8266");




pert

The libraries bundled with the ESP8266 core for Arduino are only accessible when you have an ESP8266 board selected from the Tools > Board menu. The Uno is not one of those boards. Even if the library was accessible it would do you no good since that library is written for use when directly programming the ESP8266 and would never work on the Uno.

Please explain exactly what you're trying to accomplish.

Go Up