Hi.
I am trying to build this ESPAsyncServer example (for Wemos D1) on PlatformIO IDE. (Win10)
The program is copied from techtutorialsx.com (and builds & Compiles/Run with no problem in Arduino IDE).
But in PlatformIO, (when building) I get a lot of errors related to the ESP8266WiFi module i.e.
lib\ESP8266WiFi\src/BearSSLHelpers.h:149:34: error: 'virtual const unsigned char* BearSSL::HashSHA256::oid()' marked override, but does not override
lib\ESP8266WiFi\src/BearSSLHelpers.h:149:34: error: 'virtual const unsigned char* BearSSL::HashSHA256::oid()' marked override, but does not override
There is no need to install ESP8266WiFi locally. Itās part of the basic Arduino libraries and therefore part of the PlatformIO. In fact, it might even be the cause of the problem (a conflict between installed and downloaded version),
Furthermore, you donāt need to manually download the other libraries. You can just copy the GitHub link and add it to platform.ini. PlatformIO will take care of the rest. Iāve successfully built the code with these settings (and with an empty lib directory):
I removed all three locally installed libraries and added the lib_deps section to platform.ini.
After that I got a complaint that I was missing Git.
I downloaded Git and accepted all default settings.
After restart the program seems to accept ESPAsyncTCP & ESPAsyncWebServer
but it complains that it cant find ESP8266WiFi.h
>Executing task in folder ESP_AsyncWebServer-POST:
C :\Users\gunna\.platformio\penv\Scripts\platformio.exe run <
Processing d1_mini (framework: arduino; platform: espressif8266; board: d1_mini)
-------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 2.2.2 > WeMos D1 R2 and mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy
1.20600.0 (2.6.0), framework-arduinoespressif8266 2.20502.0 (2.5.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 38 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESPAsyncTCP> 1.2.0 #7e9ed22
|-- <ESP Async WebServer> 1.2.2 #b0c6144
| |-- <ESPAsyncTCP> 1.2.0 #7e9ed22
| |-- <Hash> 1.0
|-- <Hash> 1.0
Compiling .pio\build\d1_mini\src\main.cpp.o
Archiving .pio\build\d1_mini\lib14e\libHash.a
Compiling .pio\build\d1_mini\lib16c\ESP Async WebServer\AsyncEventSource.cpp.o
src\main.cpp:21:27: fatal error: ESP8266WiFi.h: No such file or directory
Compiling .pio\build\d1_mini\lib16c\ESP Async WebServer\AsyncWebSocket.cpp.o
*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:ESP8266WiFi.h"
* Web > https://platformio.org/lib/search?query=header:ESP8266WiFi.h
*
*********************************************************************
#include <ESP8266WiFi.h>
^
compilation terminated.
*** [.pio\build\d1_mini\src\main.cpp.o] Error 1
In file included from .pio\libdeps\d1_mini\ESP Async WebServer\src\AsyncEventSource.h:29:0,
from .pio\libdeps\d1_mini\ESP Async WebServer\src\AsyncEventSource.cpp:21:
.pio\libdeps\d1_mini\ESP Async WebServer\src/ESPAsyncWebServer.h:35:25: fatal error:
ESP8266WiFi.h: No such file or directory
*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:ESP8266WiFi.h"
* Web > https://platformio.org/lib/search?query=header:ESP8266WiFi.h
*
*********************************************************************
#include <ESP8266WiFi.h>
^
compilation terminated.
*** [.pio\build\d1_mini\lib16c\ESP Async WebServer\AsyncEventSource.cpp.o] Error 1
In file included from .pio\libdeps\d1_mini\ESP Async WebServer\src\AsyncWebSocket.h:32:0,
from .pio\libdeps\d1_mini\ESP Async WebServer\src\AsyncWebSocket.cpp:22:
.pio\libdeps\d1_mini\ESP Async WebServer\src/ESPAsyncWebServer.h:35:25: fatal error:
ESP8266WiFi.h: No such file or directory
*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:ESP8266WiFi.h"
* Web > https://platformio.org/lib/search?query=header:ESP8266WiFi.h
*
*********************************************************************
#include <ESP8266WiFi.h>
^
compilation terminated.
*** [.pio\build\d1_mini\lib16c\ESP Async WebServer\AsyncWebSocket.cpp.o] Error 1
*** [.pio\build\d1_mini\lib16c\ESP Async WebServer\AsyncEventSource.cpp.o] Error 1
*** [.pio\build\d1_mini\lib16c\ESP Async WebServer\SPIFFSEditor.cpp.o] Error 1
===========================================================================
[ERROR] Took 4.18 seconds
===========================================================================
The terminal process terminated with exit code: 1
I have tried different locations when saving the sourcefile, ( as I struggled with a lot of problems earlier, when trying to be smart & save the file to a folder that is synced via OneDrive). (That caused a lot of problems with locked CS Code files etc.)
But the error persists, even when I save the file to my own local folderā¦
I get a different result. The dependency finder identifies ESP8266WiFi as a dependency and includes into the dependency graph. Are you using the latest PlatformIO version?
I Stopped my OneDrive Sync (which synchronizes āMy Documentsā folder, plus other folders),
I uninstalled VS Code, and manually uninstalled the folders in My Documents (.platformio, Apps/Local/programs/Microsoft VS Code etc. etc.), restarted the PC & reinstalled VS Code.
but the problem persisted (compile errors regarding a missing ESP8266WiFi.h file etc.)
I tried deleting the .pio folder in my project & started a new build, but no change,
BUT when I deleted the .vscode folder in my project and started a new build, the compiler errors about a missing ESP8266WiFi.h etc. disappearedā¦
I dont know if this is a bug in VS Code / PlatformIO, or if I caused the problem by installing VS Code with OneDrive sync runningā¦
Maybe someone who has more experience of VS Code/PlatformIO than me, can sort this outā¦
File look fine. You donāt need the square brackets around the 3 for the com port unless you want to specify a range. And the lines after lib_deps should be indentedā¦ but thatās probably something that was lost in the copy 'n pasteā¦ as you canāt even build a project until the indent is correct
It could have been something out of sync with one drive, or perhaps the compiler needed a kick in the backside so that it updated the include pathsā¦ removing the .vscode folder can often liven that part of it upā¦ Anyway, itās workingā¦ so all good!
As you say the indentation in platformio.ini disappeared during copy/paste hereā¦
Does anybody know if there are any problems regarding installing VS Code /PlatformIO in its default location (C:\users\billy\Documentsā¦etc.), if you also have OneDrive installed and OneDrive is set to synchronize your C:\users\billy\Documentsā¦ tree ??)
This has given me a lot of strange problems.
It seems like OneDrive and the VS Code/platformio database .browse.c_cpp.db (that is created in every project), is not a good combo.
Any ideas how to avoid this problem ??
.
/Regards: Gurra
I would suspect since the .browse.c_cpp.db C++ IntelliSense database is constantly updated by the C++ extension whilst youāre working on your code, itās not good to have it somewhere where any ārealtimeā file sync (Dropbox, Google Drive, OneDrive) operates on it whilst VSCode is open. You could use selective sync and ignore the entire .vscode folder, as neither it or the .pio/.piolibdeps folders are needed, nor should be synced onto another machineā¦ and will be rebuild on other machines as needed.
Note: when I say .vscode shouldnāt be synced, itās predominatley because platformio auto-generates the c_cpp_properties.json and launch.json files, extensions.json would only change if you had workspace specific extensions, and settings.json if you had workspace specific settings. Unless there is something else Iāve missed, I donāt know of a good reason to sync that folder onto other machines.
The problem is if I want a partial sync of the default folder where my projects are created,
to get a backup of the src folder of the projects, but no backup of the subfolders ( .pio, .vscode etc.).
It will be a real pain if I have to change settings of OneDrive sync folder settings, every time I create a new projectā¦(so the sync includes the projects src folder & excludes the subfolders for the project).
I hope the PlatformIO developers (or Microsoft) will find a solution to this as both VS Code/PlatformIO & OneDrive are quite popular programsā¦
Trueā¦ and itās a problem Microsoft as the developers of VSCode and the C++ extension will need to determine if itās worth doing something about (as all sync software will be prone to issues, doubly so if you use git source control as well) or stating itās not a supported use case. There are configuration options that make IntelliSense used a different/common folder, which is the subject of a github issue as I believe that doesnāt work due to how PlatformIO hooks into the C++ extension to configure it.