Closed mariolukas closed 2 years ago
I'm sorry I don't have the special Co2 Ampel
+ WiFi101 to test, duplicate. So you're on your own.
Post your issue somewhere else, such as Arduino Forum, Wii101 library or Co2 Ampel
-related forum, and ask for help.
Possibly some issue with WiFi101
library or that special Co2 Ampel board (core, library, bootloader, etc.)
Help yourself by using the more popular, yet much cheaper boards such as Nano-33-IoT, Nano-RP2040-Connect, ESP32/ESP8266, etc.
I'm closing the issue now, and won't reopen until you prove this is caused by a bug of this library, not the underlying library and/or boards.
Good Luck,
Just have a quick 5-min look at your code at Watterott-CO2-Ampel-Plus-Firmware, I have some notes for you to improve / check
delay(100);
seems to long, what for and why ?
WiFiWebServer
, and use too many server.sendContent
repeatedly. For example NetworkManager.cpp#L168-L256and certainly more to improve. Certainly these have nothing to do with the ERR_EMPTY_RESPONSE
issue, which depends on how the core / your code handle the USB-Serial port communication.
First of all i have to thank you for all the work on this lib and of course for the fast response.
- CO2-Ampel_Plus/NetworkManager.cpp#L510
You are right. I just removed this line. I think this was a left over from my testings.
- You don't take full advantage of the WiFiWebServer, and use too many server.sendContent repeatedly. For example NetworkManager.cpp#L168-L256
I also know that this is ugly. I used this as a workaround. It seems that MKR1000 is not able to handle more than 1400 bytes at once. Is there an other way to send content in chunks?
Certainly these have nothing to do with the ERR_EMPTY_RESPONSE issue, which depends on how the core / your code handle the USB-Serial port communication.
I am even not really sure if my issue only behaves on the serial monitor. But this was the way on how i was able to reproduce it. I realised that the behaviour didn't occur when i was investigating the debug logs.
Anyway finally i got it working (reliable) after checking #9 and #3 again. I tried to add a delay like described in these two issues. I also tried to use yield instead of a delay, but like the others already mentioned it doesn't work for me too. https://github.com/khoih-prog/WiFiWebServer/blob/23215024c85eb0410a3cfd7aa790156f28a0a201/src/WiFiWebServer-impl.h#L198
Is there a chance to add this fix permanently to the lib?
Describe the bug
Same or similar behaviour as described in #9 I am using this lib for my Co2 Ampel (see #10) Firmware now Everything works as expected until the serial monitor of the Arduino IDE is open. After closing the monitor, i am getting "ERR_EMPTY_RESPONSE" in the Browser.
Steps to Reproduce
Code: https://github.com/mariolukas/Watterott-CO2-Ampel-Plus-Firmware/blob/main/CO2-Ampel_Plus/NetworkManager.cpp
Even this does not work:
Same behaviour in AP mode and when connected to WPA network.
Information
Additional context
Already tried some delays like described in #9 but this does not change anything. ( by the way the character limit to 1400 chars might be solved by sending the content in chunks).