Not an issue but a support
Today my application is running fine with Blynk and WebServer for ESP32
I can see a huge benefit in term of reliability to use your Blynk_Async_WM library (mainly autoconnect/autoreconnect of WiFi/Blynk). My understanding is that this library is compliant only with AsyncWebServer
Here is the program extract related to Webserver with RTOS mutitask (thank you for your example Async_ESP32_MultiTask.ino), can you help to convert with AsyncWebServer ? (I tried without success !!)
Thank you
//******************************************************************************************************************************
#include <Arduino.h>
#include <WebServer.h>
WebServer server (81);
String json_grid;
void sendGrid() {
server.send(200, "application/json", json_grid); // send json_grid values
}
void handle_NotFound(){
server.send(404, "text/plain", "Not found");
}
void BlynkRun( void * pvParameters ) // essential housekeeping command that keeps the background Blynk library “running”.
{
#define BLYNK_RUN_INTERVAL_MS 250L
for (;;)
{
Blynk.run(); // SYNC BLYNK
client.loop(); // SYNC MQTT
vTaskDelay(BLYNK_RUN_INTERVAL_MS / portTICK_PERIOD_MS);
}
}
void ServerRun( void * pvParameters ) // monitors the presence of a client and delivers the requested HTML page
{
#define SERVER_RUN_INTERVAL_MS 2000L
for (;;)
{
server.handleClient(); // SYNC SERVER
vTaskDelay(SERVER_RUN_INTERVAL_MS / portTICK_PERIOD_MS);
}
}
//***** setup******//
xTaskCreatePinnedToCore(BlynkRun, "BlynkRun", 50000, NULL, BlynkRun_Priority, NULL, USING_CORE_2);
xTaskCreatePinnedToCore(ServerRun, "ServerRun", 50000, NULL, ServerRun_Priority, NULL, USING_CORE_2);
SPIFFS.begin();
server.on("/grid.json", sendGrid); // sendGrid() send grid.json in javascript file $.getJSON('/wes.json', function(data))
server.onNotFound(handle_NotFound);
server.serveStatic("/js", SPIFFS, "/js"); // Makes index page and images available
server.serveStatic("/css", SPIFFS, "/css");
server.serveStatic("/png", SPIFFS, "/png");
server.serveStatic("/", SPIFFS, "/index.html");
server.begin();
//*****************//
void loop() {
process_data(); // process data for json_grid. Main code USING_CORE_1
}
//******************************************************************************************************************************