khoih-prog / ESPAsync_WiFiManager

This is an ESP32 (including ESP32-S2 and ESP32-C3) / ESP8266 WiFi Connection Manager, using ESPAsyncWebServer, with fallback web configuration portal. Use this library for configuring ESP32, ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson 6.0.0+ as well as 5.13.5- . Using AsyncDNSServer instead of DNSServer now.
MIT License
290 stars 73 forks source link

ESPAsync_WiFiManager and ArduinoIoTCloud libraries are incompatible. #59

Closed kirk-clendinning closed 3 years ago

kirk-clendinning commented 3 years ago

Describe the bug

When trying to use an access point provided by ESPAsync_WiFiManager with the ArduinoIoTCloud functionality in the same Sketch, simply adding #include to an ESPAsync_WiFiManager example project causes the access point web server to hang. This issue has been filed against ArduinoIoTCloud as well.

Steps to Reproduce

Add #include to an ESPAsync_WiFiManager example. When the AP is accessed, the web server hangs.

Expected behavior

I expected to be able to use ESPAsync_WiFiManager to maintain a wifi connection, and when the connection was active, use ArduinoIoTCloud to control an ESP8266 node.

Actual behavior

When the Captive Portal is accessed by a web browser, the web server hangs and a blank page results.

Debug and AT-command log (if applicable)

It appears that the page is rendered correctly, but the web server hangs when it is served.

Screenshots

It's a blank page.

Information

Take any ESPAsync_WifiManager example and put the header #include into the .ino and the captive web page will hang.

Please ensure to specify the following:

Steps to reproduce:

  1. Get the most recent ArduinoIoTCloud and ESPAsync_WiFiManager libraries.
  2. Set up an ESPAsync_WifiManager manager project such as Async_AutoConnectWithFeedbackLED
  3. add #include to the project.
  4. It will compile, load to the ESP8266 and run.
  5. When you try to connect to the Captured Portal, the browser will connect, the correct content appears to be delivered by viewing the source in the browser's development mode, but the page will be blank.
kirk-clendinning commented 3 years ago

If NTP config is enabled in the ESPAsync_WifiManager, the captured portal web page does not render. So this comment is also advisable when using ArduinoloTCloud with ESPAsync_WiFiManager.

// Use false to disable NTP config. Advisable when using Cellphone, Tablet to access Config Portal. // See Issue 23: On Android phone ConfigPortal is unresponsive (khoih-prog/ESP_WiFiManager#23)

define USE_ESP_WIFIMANAGER_NTP false

khoih-prog commented 3 years ago

Hi @kirk-clendinning

Thanks for your interest in the library.

You have to understand that ArduinoIoTCloud library is a complete ecosystems for many boards, besides ESP8266, to manage the connection to ArduinoIoTCloud, including local SSID / PWD, and many more complex features

Nobody can expect this library, managing Async WebServer and connection, to co-exist with the complex synchronous ArduinoIoTCloud library. I don't think even the synchronous ESP_WiFiManager library can do this, without spending lots of time to study / debug and have many modifications to make them working together.

Anyway, this is redundant and I won't spend time on this, and don't expect anybody will do so.

Good Luck,

kirk-clendinning commented 3 years ago

In the end, it appears that the conflict had to do with the NTP implementations. By disabling that in both libraries, the combination worked correctly.

Thanks for responding.

-kirk-

On Aug 3, 2021, at 15:23, Khoi Hoang @.***> wrote:

Closed #59 https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/59.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/59#event-5106702046, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCLV3ME4RYQOVCLFWMZSALT3A63ZANCNFSM5BDMAJAA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

khoih-prog commented 3 years ago

I'm amazed that you figure out the solution.

Thanks for your information and research, which will help many other users.

Best Regards,

kirk-clendinning commented 3 years ago

Sadly, I did not have time to go into depth. Since the ESP8266 has no RTC, it may be that both of the libraries were trying to replace that in some way with NTP, and so there was some sort of conflict. I find the Arduino development environment a bit tedious since one cannot step for debugging. It is sometimes difficult to find issues in asynchronous libraries.

Thank you for your contributions to the community.

-kirk-

On Aug 3, 2021, at 15:35, Khoi Hoang @.***> wrote:

I'm amazed that you figure out the solution.

Thanks for your information and research, which will help many other users.

Best Regards,

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/59#issuecomment-892110340, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCLV3I4P4SM3U2B6FV47Z3T3BAHRANCNFSM5BDMAJAA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.