Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build warnings and errors #15

Merged
merged 4 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@
*.exe
*.out
*.app

# PlatformIO in VScode
.pio/
.vscode/
*.lnk
*.bak
10 changes: 5 additions & 5 deletions examples/customHTML/customHTML.ino
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bool loadOptions() {
Serial.println();
Serial.printf("LED pin value: %d\n", ledPin);
Serial.printf("Bool value: %d\n", boolVar);
Serial.printf("Long value: %ld\n",longVar);
Serial.printf("Long value: %ld\n",(long) longVar);
Serial.printf("Float value: %d.%d\n", (int)floatVar, (int)(floatVar*1000)%1000);
Serial.println(stringVar);
return true;
Expand Down Expand Up @@ -170,7 +170,7 @@ void setup() {
myIP = WiFi.softAPIP();
captiveRun = true;
}

// Add custom page handlers to webserver
server.on("/reload", HTTP_GET, handleLoadOptions);

Expand Down Expand Up @@ -209,9 +209,9 @@ void setup() {
server.addJavascript(custom_script, "fetch", /*overwite file*/ false);
server.addJavascript(thingsboard_script, "ts", /*overwite file*/ false);

Add custom page title to /setup
// Add custom page title to /setup
server.setSetupPageTitle("Test setup page");
Add custom logo to /setup page with custom size
// Add custom logo to /setup page with custom size
server.setLogoBase64(base64_logo, "128", "128", /*overwite file*/ true);

// Enable ACE FS file web editor and add FS info callback fucntion
Expand All @@ -223,7 +223,7 @@ void setup() {
// Start server
if (server.init()) {
Serial.print(F("\n\nWeb Server started on IP Address: "));
Serial.println(myIP);
Serial.println(myIP);
Serial.println(F(
"This is \"customHTML.ino\" example.\n"
"Open /setup page to configure optional parameters.\n"
Expand Down
2 changes: 1 addition & 1 deletion examples/highcharts/highcharts.ino
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void loop() {
doc["maxBlock"] = heap_caps_get_largest_free_block(0);
#elif defined(ESP8266)
uint32_t free;
uint16_t max;
uint32_t max;
ESP.getHeapStats(&free, &max, nullptr);
doc["totalHeap"] = free;
doc["maxBlock"] = max;
Expand Down
2 changes: 1 addition & 1 deletion examples/remoteOTA/remoteOTA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void setup(){

// Try to connect to flash stored SSID, start AP if fails after timeout
IPAddress myIP = server.startWiFi(30000, "ESP_AP", "123456789" );

(void) myIP; // return value is not used
// WiFi.persistent(true);
// WiFi.begin("PuccosNET", "Tole76tnt");
// uint32_t beginTime = millis();
Expand Down
41 changes: 30 additions & 11 deletions pio_ci_ex_ALL.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,36 @@ rem Build all listed examples of this library on PIO CLI; may take some time
rem Verifies that library and all examples still compile

setlocal EnableDelayedExpansion enableextensions
set CI_DIR=%~dp0\..\async-esp-fs-webserver.pio-ci
set CI_DIR=%~dp0..\async-esp-fs-webserver.pio-ci
set EXAMPLES=simpleServerCaptive simpleServer withWebSocket customHTML customOptions gpio_list handleFormData highcharts remoteOTA esp32-cam
::set EXAMPLES=simpleServerCaptive
:: simpleServer withWebSocket customHTML
FOR %%E IN (%EXAMPLES%) DO IF NOT EXIST %CI_DIR%\ci_ex_%%E MKDIR %CI_DIR%\ci_ex_%%E
@echo on
FOR %%E IN (%EXAMPLES%) DO (
pio ci -c platformio.ini --board=esp32dev --keep-build-dir --build-dir=%CI_DIR%\ci_ex_%%E --lib=. .\examples\%%E\*.* > %CI_DIR%\ci_ex_%%E\build.out.txt 2>%CI_DIR%\ci_ex_%%E\build.err.txt
@for /f %%i in ("%CI_DIR%\ci_ex_%%E\build.err.txt") do @set size=%%~zi && @echo ###ERROR in %%i && @type %%i
)
@echo off
:: type %CI_DIR%/ci_ex_%%E/build.err.txt
:: note activation pio verbose option '-v' outputs a lot of text (~25k/compile, ~2MB/pio-ci)
rem pio ci -c platformio.ini --board=esp32dev --build-dir=../ci_ex_simpleServer --keep-build-dir --lib=. .\examples\simpleServer\simpleServer.ino
set BOARDS= esp32dev esp12e
set OPT_esp12e=-O "[email protected]"
set OPT_esp32dev=-O "[email protected]"
set NOT_esp12e=esp32-cam
set NOT_esp32dev=esp8266-app
set EXCLIB= --exclude=lib\*\.git* --exclude=lib\*\.pio --exclude=lib\*\.vscode --exclude=lib\*\built-in-webpages --exclude=lib\*\examples

FOR %%B IN (%BOARDS%) DO (
FOR %%E IN (%EXAMPLES%) DO (
if %%E==!NOT_%%B! (
echo ### not compiling %%E for %%B
) else (
set CIEXDIR=%CI_DIR%\ci_ex_%%B_%%E
IF EXIST "!CIEXDIR!" RMDIR /s/q "!CIEXDIR!"
MKDIR "!CIEXDIR!"
set OPT=!OPT_%%B!
set OUT="!CIEXDIR!\build.out.txt"
set ERR="!CIEXDIR!\build.err.txt"
echo ### Compiling %%E for %%B
echo +pio ci -b %%B !OPT! --keep-build-dir --build-dir="!CIEXDIR!\" --lib=. %EXCLIB% .\examples\%%E\*.* 1^>!OUT! 2^>!ERR!
pio ci -b %%B !OPT! --keep-build-dir --build-dir="!CIEXDIR!" --lib=. %EXCLIB% .\examples\%%E\*.* >!OUT! 2>!ERR!
FOR /f %%i IN (!ERR!) DO IF EXIST %%i IF %%~zi GTR 0 ECHO ###ERROR in %%i && TYPE %%i
)
echo ### DONE
)
)

:: note activation pio verbose option '-v' generates a lot of output (~25k/compile, ~2MB/pio-ci)

12 changes: 11 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
; https://docs.platformio.org/page/projectconf.html

[env:esp32dev]
framework = arduino
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = bblanchon/ArduinoJson@^6.21.4
DNSServer@^2.0.0
ESPmDNS@^2.0.0
Expand All @@ -21,3 +21,13 @@ lib_deps = bblanchon/ArduinoJson@^6.21.4
Update@^2.0.0


[env:esp12e]
framework = arduino
platform = espressif8266
board = esp12e
board_build.mcu = esp8266
lib_deps = bblanchon/ArduinoJson@^6.21.4
DNSServer@^1.1.0
ESP8266mDNS@^1.2
ESP8266WiFi@^1.0
LittleFS
2 changes: 1 addition & 1 deletion src/AsyncFsWebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool AsyncFsWebServer::init(AwsEventHandler wsHandle) {
////////////////////// BUILT-IN HANDLERS ////////////////////////////
using namespace std::placeholders;

on("/favicon.ico", HTTP_GET, std::bind(&AsyncFsWebServer::sendOK, this, _1));
//on("/favicon.ico", HTTP_GET, std::bind(&AsyncFsWebServer::sendOK, this, _1));
on("/connect", HTTP_POST, std::bind(&AsyncFsWebServer::doWifiConnection, this, _1));
on("/scan", HTTP_GET, std::bind(&AsyncFsWebServer::handleScanNetworks, this, _1));
on("/wifistatus", HTTP_GET, std::bind(&AsyncFsWebServer::getStatus, this, _1));
Expand Down
2 changes: 1 addition & 1 deletion src/AsyncFsWebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define CONFIG_FILE "/config.json"

#define DBG_OUTPUT_PORT Serial
#define LOG_LEVEL 2 // (0 disable, 1 error, 2 info, 3 debug)
#define LOG_LEVEL 3 // (0 disable, 1 error, 2 info, 3 debug)
#include "SerialLog.h"
#include "CaptiverPortal.hpp"

Expand Down
Loading