-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HandleWiFi() Sometimes Doesn't Send Parameters (Question) #1302
Comments
no idea use the latest version |
I merged the latest master with my version and am still seeing similar issues. Where can I look to try to understand this better? There seem to be two related but different issues
Is there somewhere I can look to better understand what's going on here? Like a wireshark view into the requests that the webserver is actually getting and a log of the responses it's sending? |
Why the fork ? Yeah mine does that, flood, you are supposed to disconnect other connections when using captive portals. I was looking into adding better filtering for specific cp checks, but they are such a moving target and there is no standard, right now we redirect everything. Also page variable is on heap and not allocated, so it can overflow, I have been meaning to try to pre allocate its size or use a better buffer Also make sure you are not remembering the ssid for the device, forget network etc From my understanding the cp check has to get an ip and a response fast enough or it closes, usually it will open back up. But why it is so flaky I have no idea. I think if we specifically listed for apples cp check maybe it will help. There are some other cp projects that have attempted this, might be worth checking, maybe espeasy or something I forget |
I forked it just because I'm not a good enough programmer to make everything elegant so I hack my way through my forked copy making WM work to suit my needs by just modifying things directly, changing HTML directly, etc. I do understand most of these concepts, just not elegant in making them simple and minimum. If a number of simultaneous requests come in that get redirected, are they handled sequentially and then destroyed before the next request is handled? Or are they more concurrent causing memory issues? |
As further troubleshooting, here is my code and output. I had the problem when using getParamsOut() before, then I removed the params altogether to embed my HTML config directly into WM (not elegant, but easier to edit the HTML directly rather than build through params). Sometimes pitem gets added in, then sometimes it doesn't!!! How can this be? I added size checks below to show that pitem is not empty but somehow doesn't get added to page via page += pitem
Then here is the output: *wm:[2] AP: -86 Deathstar |
I think changing it to chunked response solved the problem! |
Ah you seem to be hitting some kind of packet resp limit maybe? |
I don't think it's a limit at the packet level, but rather a memory limit when trying to concat large strings when building the response string with a lot of adding onto the end of page. Chunking it allows to first send the wifi scan results, then send the parameters (if there are any) and then whatever is left after that. That way, String page can be reset to page = "" periodically so that it doesn't grow to be too large. I submitted a pull request based upon how I fixed it. This will actually be my first PR, so let me know if I didn't do that correctly. |
Can you show me your code? I thought I saw it but cant find it |
oh nm, #1319 |
What webserver has these methods? Not compiling for me |
ESP8266Webserver... What compile errors are you getting? Has the master changed webservers? |
Esp32 does not have chunked methods it seems |
I see that now. I'll look into how to reconcile that for ESP32 as well and then push that. |
I forked this a while back this year off the master (at the time). It's worked flawlessly using a smartphone, but I've recently noticed that when using a Windows computer to connect that it seems to flood the captive portal server and somehow my params are getting dumped out of the html response back to user which allows them to configure my params. Has there been a fix or anything about this? Any insight?
The text was updated successfully, but these errors were encountered: