No such file or directory #include <bearssl/bearssl.h>

Hi,

Using win 7, Arduino 1.6.5 ive come accross this problem when i try to compile, i'm new to Arduino (my first try) so please take this into consideration when answering.

br.Burgy

In file included from LEDclockPori.ino:1:0:
C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src/BearSSLHelpers.h:26:29: fatal error: bearssl/bearssl.h: No such file or directory
#include <bearssl/bearssl.h>
^
compilation terminated.

bearssl/bearssl.h: No such file or directory

The error message is very explicit. Do you have such a file and if so where is it located ?

bearssl.h is in --> C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src ?

Burgy:
bearssl.h is in --> C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src ?

Is that a question or a statement?

A Statement, the questionmark because i don't understand why the file is not recognised/found by the system.

You will need to post your sketch as well as a link to the BearSSLHelpers library.

The Sketch:

#include <BearSSLHelpers.h>
#include <CertStoreBearSSL.h>
#include <CertStoreSDBearSSL.h>
#include <CertStoreSPIFFSBearSSL.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiAP.h>
#include <ESP8266WiFiGeneric.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266WiFiScan.h>
#include <ESP8266WiFiSTA.h>
#include <ESP8266WiFiType.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <WiFiClientSecureAxTLS.h>
#include <WiFiClientSecureBearSSL.h>
#include <WiFiServer.h>
#include <WiFiServerSecure.h>
#include <WiFiServerSecureAxTLS.h>
#include <WiFiServerSecureBearSSL.h>
#include <WiFiUdp.h>

#ifdef ESP32
#include <WiFi.h>
#else
#include <ESP8266WiFi.h>
#endif
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
#include <time.h>

int pinCS = D4; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf SPI - Arduino Reference )
int numberOfHorizontalDisplays = 4;
int numberOfVerticalDisplays = 1;
char time_value[20];
const char* ssid = "Rose"; //ssid = "Pirate";
const char* password = "wood"; //password = "Ship";
// LED Matrix Pin -> ESP8266 Pin
// Vcc -> 3v (3V on NodeMCU 3V3 on WEMOS)
// Gnd -> Gnd (G on NodeMCU)
// DIN -> D7 (Same Pin for WEMOS)
// CS -> D4 (Same Pin for WEMOS)
// CLK -> D5 (Same Pin for WEMOS)

Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);

int wait = 70; // In milliseconds (Scroll speed)

int spacer = 1;
int width = 5 + spacer; // The font width is 5 pixels

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
configTime(0 * 3600, 0, "pool.ntp.org", "time.nist.gov");//
setenv("TZ", "GMT-2BST,M3.5.0/01,M10.5.0/02", 1);
matrix.setIntensity(0); // Use a value between 0 and 15 for brightness
matrix.setRotation(0, 1); // The first display is position upside down
matrix.setRotation(1, 1); // The first display is position upside down
matrix.setRotation(2, 1); // The first display is position upside down
matrix.setRotation(3, 1); // The first display is position upside down
}

void loop() {
matrix.fillScreen(LOW);
time_t now = time(nullptr);
String time = String(ctime(&now));
time.trim();
Serial.println(time);
time.substring(11, 19).toCharArray(time_value, 10);
matrix.drawChar(2, 0, time_value[0], HIGH, LOW, 1); // H
matrix.drawChar(8, 0, time_value[1], HIGH, LOW, 1); // HH
matrix.drawChar(14, 0, time_value[2], HIGH, LOW, 1); // HH:
matrix.drawChar(20, 0, time_value[3], HIGH, LOW, 1); // HH:M
matrix.drawChar(26, 0, time_value[4], HIGH, LOW, 1); // HH:MM
matrix.write(); // Send bitmap to display
delay(20000);
display_message(time); // Display time in format 'Wed, Mar 01 16:03:20 2017 // remove the "//" before "display_message(time);" to let scroll
}

void display_message(String message) {
for ( int i = 0 ; i < width * message.length() + matrix.width() - spacer; i++ ) {
//matrix.fillScreen(LOW);
int letter = i / width;
int x = (matrix.width() - 1) - i % width;
int y = (matrix.height() - 8) / 2; // center the text vertically
while ( x + width - spacer >= 0 && letter >= 0 ) {
if ( letter < message.length() ) {
matrix.drawChar(x, y, message[letter], HIGH, LOW, 1); // HIGH LOW means foreground ON, background off, reverse to invert the image
}
letter--;
x -= width;
}
matrix.write(); // Send bitmap to display
delay(wait / 2); // to scroll, replace 0 with 2
}
}

The Link:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\bearssl.h

The Sketch was written by G6EJD, he has helped me a lot.

The Link:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\bearssl.h

Do you really expect us to be able to click on that link? That is NOT where you got the library from.

Sorry, i aquired the library through putting this (http://arduino.esp8266.com/stable/package_esp8266com_index.json) in prefrences and then downloading ESP8266, as mentioned above i'm a newbe.

If the file is in:
C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src

but it's being included as
#include <bearssl/bearssl.h>

of course it won't find it.

It would need to be in:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\bearssl

If that's the case, it's a bug with the ESP8266 core that should be reported to the maintainers so that they can correct the package.

I don't recall ever seeing an include library where the header file name didn't match the library subdirectory name. Is this truly and exception to that rule?

DrAzzy:
If the file is in:
C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src

but it's being included as
#include <bearssl/bearssl.h>

of course it won't find it.

It would need to be in:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\bearssl

If that's the case, it's a bug with the ESP8266 core that should be reported to the maintainers so that they can correct the package.

DrAzzy:
If the file is in:
C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src

but it's being included as
#include <bearssl/bearssl.h>

of course it won't find it.

It would need to be in:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\bearssl

If that's the case, it's a bug with the ESP8266 core that should be reported to the maintainers so that they can correct the package.

DrAzzy:
If the file is in:
C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src

but it's being included as
#include <bearssl/bearssl.h>

of course it won't find it.

It would need to be in:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\bearssl

DrAzzy, it worked. but now i get this :

LEDclockPori.ino:28:26: fatal error: Adafruit_GFX.h: No such file or directory
compilation terminated.

Burgy:
DrAzzy, it worked. but now i get this :

LEDclockPori.ino:28:26: fatal error: Adafruit_GFX.h: No such file or directory
compilation terminated.

Install the adafruit graphics library.

adafruit graphics library installed, now i get:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\CertStoreSDBearSSL.cpp:20:16: fatal error: SD.h: No such file or directory
#include <SD.h>
^
compilation terminated.

and what does 20:16: mean?

thank you for your patience.

and what does 20:16: mean?

Line 20, character 16

Line 20, character 16 thank you, now the main problem:

C:\Users\Steve\Documents\Arduino\libraries\ESP8266WiFi\src\CertStoreSDBearSSL.cpp:20:16: fatal error: SD.h: No such file or directory
#include <SD.h>
^
compilation terminated.

So, line 20 of CertStoreSDBearSSL.cpp tries to #include the file SD.h and can't find it. Sound familiar ? Have you got the file on your PC and if so where is it located ?

yes here, C:\Users\Steve\Documents\Arduino\esp8266wifi\src\SD.h
CertStoreSDBearSSL.cpp is in the same folder

C:\Users\Steve\Documents\Arduino\esp8266wifi\src\SD.h

that seems a bit odd. Normally SD card support is a separate library, and that's not where libraries should be...
Because of the way that the Arduino IDE "manages" libraries, you are probably doomed to failure if you try to just add new modules (like SD) to existing library source directories (like ESP8266wifi)
In my "modern" 1.8.5 install, the esp8266wifi library gets installed off in "AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries" (SD is a separate directory there), not in "Documents" It's possible that you have "ancient" copy of esp8266 support; unless you KNOW you have important stuff there, I would start by cleaning out all the old libraries and executables, and starting fresh with v1.8.5 of the IDE. (this means deleting all of your "Documents\Arduino\Libraries" files, and everything that looks like a library (rather than a sketch) in "Documents\Arduino". It can actually be fairly difficult to track down all the things in the wrong place...)

Ok, thanks to you and all that helped. if no one says anthing to the contrary, it not a good idea, i will save the sketches (.INO) and delete everthing else (.h, cpp etc. etc.) and then start afresh with IDE 1.8.5