Post topics, source code that relate to the Arduino Platform

User avatar
By Eric Mulder
#80315 New to esp8266, skilled arduino user.
To get the basics up and running I downloaded the libraries from the ESP8266 github page.
From the cloned repo I copied the ESP8266Wifi library (.\libraries\ESP8266WiFi) to my Arduino libraries folder and fired up Visual Micro (Visual Studio 2017 extension for Arduino).
I am trying to download the following sketch:
Code: Select all#include "ESP8266WiFi.h"

const char* ssid = "my-wifi-ssid"; //your WiFi Name
const char* password = "my-wifi-password";  //Your Wifi Password

WiFiServer server(80);

void setup() {
   Serial.begin(115200);
   delay(10);
   Serial.print("Connecting to ");
   Serial.println(ssid);
   WiFi.begin(ssid, password);
   while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
   }
   Serial.println("");
   Serial.println("WiFi connected");
}

void loop() {
   delay(1);
}


When I try to compile this simple piece of code the compiler gives me this:

Code: Select allWiFiClientSecureBearSSL.h: 28:29: fatal error: bearssl/bearssl.h: No such file or directory
   #include <bearssl/bearssl.h>
   compilation terminated


Ok, so it is missing a referenced class. Maybe something got corrupted while extracting the library or something, so I downloaded it again with the same result.
Eventually found the bearssl header files in .\tools\sdk\includes and copied the bearssl folder into the ESP8266WiFi\src folder. Ran the compiler again and now it is giving me this:

Code: Select allThe ESP8266WiFi library encountered an unknown path resolve error.D*: 30:24: fatal error: StackThunk.h: No such file or directory
   #include <StackThunk.h>
   compilation terminated


What else do I have to modify or copy to get the incomplete library working?
Have the same results with releases from the github repo.
Any help is appreciated.
User avatar
By Eric Mulder
#80323 Alright, got it. When I first messed around with the LoLin NodeMCU V3 board that I have, I installed the board libraries as pointed out on some website (can't remember which one). It seems that the URL for the board manager changed at some point and I didn't know about it. So my board definitions were out of date, which apparently has an effect on the compiler.
I think I was put on the wrong foot by the Github readme that mentions several install options. As I was browsing the Git repo already, I obviously chose "Using git version". That step never mentions setting/checking/updating the board manager URL for the ESP8266 boards.
To fix it, I uninstalled the old version (was using the wrong URL anyways) and reinstalled them using the correct URL. After restarting the IDE, compiling the code produced no errors anymore.
User avatar
By McChubby007
#80324 Firstly you need to fix your include paths as they are obviously not correct, either that or you are using the wrong sdk with the library. It's no good just copying .h files about willy-nilly as you will end up in a terrible mess. Take a deep breath, slow down, and ensure your configuration is correct. If you cannot compile one of the standard wifi examples that come with the esp8266 arduino core then you have got bigger issues. I assume you are using the esp8266 arduino core, are you? What is your setup, your environment, this is all important to check how you've got this problem. Do you use boards manager? Have you tried using arduino ide just to check your configuration? Remove as many uncertainties as possible to get it to work and then build up from there, especially as you are new to esp8266.
User avatar
By pfeerick
#80325 Why did you copy the ESP8266Wifi library into your Arduino library folder? If you installed the ESP8266Arduino core properly through the Boards Manager, the library files would be installed as part of the core. Otherwise, you will be playing a game of whackamole, chasing dependencies as you pull together all the different parts of the libraries.

http://arduino.esp8266.com/stable/packa ... index.json