Hi guys,
I try to “transfer” a Arduino Project to VSCode / PlatformIO but I get allways over 100 errors.
I think I have big problems with der Includefiles. I don’t know what I do wrong.
I use the big great work from this webpage: Esp8266 Nodemcu Webserver. (Thank you su much fipsok!)
In deail I would like to create a ESP8266 WebServer with the following sourcecodes:
The LittleFS-part I put it on a new file (.cpp) where is the mainfile (.cpp) too and include all neccessary libraries . Then I create a include file (*.h)
//LittleFStest_h
#ifndef LittleFStest_h
#define LittleFStest_h
#include <Arduino.h>
void setupFS();
bool handleList();
void deleteRecursive();
bool handleFile();
void handleUpload();
void formatFS();
void sendResponce();
const String formatBytes();
#endif //LittleFStest_h
A abstract from the LittleFStest.cpp file:
#include <LittleFStest.h> //
#include <littleFS.h>
#include <ESP8266WebServer.h>
#include <list>
#include <tuple>
const char WARNING[] PROGMEM = R"(<h2>Der Sketch wurde mit "FS:none" kompilliert!)";
const char HELPER[] PROGMEM = R"(<form method="POST" action="/upload" enctype="multipart/form-data">
<input type="file" name="[]" multiple><button>Upload</button></form>Lade die fs.html hoch.)";
void setupFS() { // Funktionsaufruf "setupFS();" muss im Setup eingebunden werden
LittleFS.begin();
server.on("/format", formatFS);
server.on("/upload", HTTP_POST, sendResponce, handleUpload);
server.onNotFound([]() {
if (!handleFile(server.urlDecode(server.uri())))
server.send(404, "text/plain", "FileNotFound");
});
}
bool handleList() { // Senden aller Daten an den Client
FSInfo fs_info; LittleFS.info(fs_info);
With the commands
lib_deps =
# Using a library name
https://github.com/JAndrassy/ArduinoOTA.git
https://github.com/PaulStoffregen/LittleFS.git
in the platfrom.ini file I download the libraries.
But I get over 100 errors…
I was able to unit the sourcecode from the webserver-part and the connectpart an it works fine.
The webserver-part I put it on the mainfile. The connect-part I put it on a new file (.cpp) where is the mainfile too and include all neccessary libraries . Then I create a include file (.h)
//Esp8266ConnectTab_h
#ifndef Esp8266ConnectTab_h
#define Esp8266ConnectTab_h
void connectWifi();
#endif //Esp8266ConnectTab_h
The same project (webserver, connect, littleFS) with Arduino IDE works fine.
Hope someone can help me and explane where is my misconception…
Thank you for your help!
By.