Hi, I use github.com/me-no-dev/ESPAsyncWebServer library for WiFi, SSD1306 from Adafruit for lcd, I coded something like this, on request "/setAlarm" ESP prints on LCD string "testing", but that prints me weird characters, code lloks like that, calling the same function from any different class works, only doesnt work if called from asynwebserver library
void ManageWifi::setupServerHandling() {
server.on("/getTimeData", HTTP_GET, [] (AsyncWebServerRequest *request) {
request->send(200, "text/plain", R"({"currentTime":")" + wifiTimeManager.getTime() + "\"}");
Serial.print("received/get");
});
server.on("/setAlarm", HTTP_GET, [](AsyncWebServerRequest * request) {
if(request->hasParam("time")) {
AsyncWebParameter* p = request->getParam("time");
Serial.printf("Received %s with value %s from IP: \n", p->name().c_str(), p->value().c_str());
Serial.println(request->client()->remoteIP());
request->send(200, "text/plain", "OK");
wifiTimeManager.saveAlarmTime(String(p->value()));
String outputMsg = "New request!\n Time: " + String(p->value()) + "\n IP: " + request->client()->remoteIP().toString();
lcdManager.printTextLcd("testing", 1);
}
});
server.onNotFound(notFound);
server.begin();
}
I tried using xTaskCreate but that gave me same error.
void ManageLcd::printTextLcd(String lcdText, int fontSize){
clearLcd();
display.setTextSize(fontSize);
display.print(lcdText);
display.display();
delay(1000);
}
void ManageLcd::clearLcd() {
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.clearDisplay();
display.display();
}
- Screenshot 2020-04-09 at 18.19.45.png (218.64 KiB) Viewed 6112 times
that shows how it looks like for me