Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » Bug in webserver Plugin

Author: Blueforcer
14/04/2022 13:47:16
For my latest project i found your awesome lib, thank you for your huge work!

Maybe i found a small "bug" in the Webserver Plugin.

My device only has 4 Buttons, so it could be a bit hard to enter SSID and Password smilie
From a purely logical point of view, I would use the web server plugin, since there is currently no smartphone app.
So on fresh device, there is of course no wifi settings available, so the ESP need to open a hotspot where i can enter SSID and password in the webserver.

I found the example https://github.com/davetcc/tcMenuLib/blob/master/examples/esp8266WifiOled/esp8266WifiOled.ino. Wich opens a hotspot when there is no SSID.

For that i needed to remove line 78
"if(!WiFi.isConnected()) return false;"
in tcMenuEspAsyncWEbserver.cpp
because at this point the esp is of course not connected and the webserver will never be started.

Maybe this could be fixed in the next verion?



Author: davetcc
16/04/2022 07:29:57
 
"if(!WiFi.isConnected()) return false;"
in tcMenuEspAsyncWEbserver.cpp
because at this point the esp is of course not connected and the webserver will never be started.


attemptInitialisation is constantly called until it succeeds, to avoid freezing up the task queue.

This is the runLoop for remote connections:

void BaseRemoteServerConnection::runLoop() {
    if(!initialisation.isInitialised()) {
        initialisation.attemptInitialisation();
    }
    else if (!connected()) {
        initialisation.attemptNewConnection(this);
    } else {
        tick();
    }
}


From BaseRemoteServerConnection::runLoop. Is it not working as intended?

Author: davetcc
16/04/2022 07:35:26
BTW - any other feedback you have on the webserver version would be really useful as it's still an experimental plugin at the moment. So I'm trying to determine stability and usefulness.

Author: Blueforcer
17/04/2022 20:21:31
attemptInitialisation is called the whole time
but
WiFi.isConnected() can only be true in WIFI_STA Mode.
->"is STA interface connected?"

in WIFI_AP mode it will be always false, no matter if a device ist connected to the AP

Author: Blueforcer
17/04/2022 20:32:13
 
davetcc wrote:BTW - any other feedback you have on the webserver version would be really useful as it's still an experimental plugin at the moment. So I'm trying to determine stability and usefulness.


Should i open a new post for every feedback?

Author: davetcc
19/04/2022 09:16:05
Agreed I’ll change the example to work a different way

For any feedback - https://www.thecoderscorner.com/jforum/posts/list/0/196.page




Register / Login  |  Desktop view  |  Jump to top of page