Comments (11)
Hi @mamama1,
I've been able to reproduce the issue with WiFi101 v0.10.0 + WiFiWebServer example + Chrome on OS X and pounding CMD-R to refresh the browser.
I tried with the changes in #77 and could not reproduce. In any case, I've pushed some new changes to my socket-buffer branch. Could you please download the latest and try again?
from wifi101.
@mamama1 could you also provide more details on what hardware you are using (MKR1000, WiFi101 shield + Uno, etc).
The testing I mentioned above was done on a MKR1000 board.
from wifi101.
Thanks for investigating!
As commented in your #77, I did try this with your socket rework initially (unsuccessfully).
However, I'll try again with the most recent version and report back as soon as I find some time.
I'm using the Adafruit WINC1500 Breakout Board + Atmega2560 (Arduino Mega). I also tried with the Uno, same results.
from wifi101.
Hi @mamama1,
The latest version of #77 seems ok with my WiFi101 Shield + Uno. Looking forward to hearing about your test results.
I will see if there's a smaller fix we can do in the mean time.
from wifi101.
A quick update, I've pushed another change to #77. Things seem better when I hold CMD-R for ~30s on OS X + Chrome.
It doesn't look we can do a smaller fix to resolve it.
from wifi101.
Hi @sandeepmistry,
I've tried https://github.com/sandeepmistry/WiFi101/archive/socket-buffer.zip and I've tried https://github.com/sandeepmistry/WiFi101/archive/master.zip
Both with no luck, unfortunately. Basically the same behaviour.
This is the serial monitor output of the last two requests, before the code hangs:
client disonnected
new client
GET / HTTP/1.1
Host: 192.168.25.161
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4client disonnected
new client
GET / HTTP/1.1
Host: 192.168.25.161
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: client disonnected
from wifi101.
i did this (Serial.println("a"); and Serial.println("c");) to know the status when it hangs, and again the serial monitor is spammed with c characters so I guess "client" is still/again connected but not "available".
while (client.connected()) {
Serial.println("c");
if (client.available()) {
Serial.println("a");
char c = client.read();
Serial.write(c);
....
from wifi101.
Hi @sandeepmistry,
i was wondering if this will ever get resolved. is it related to the atmel firmware?
thanks
from wifi101.
@mamama1 if you are still interested in this, could you please try the changes in PR #204. Thanks.
from wifi101.
I'm closing this for now due to lack of feedback, please re-open if you are still interested and have tried the changes for PR #204 which have been merged.
from wifi101.
The problem is that some web browsers request for favicon.ico. Chrome requests it every reload but Firefox, Safari and IE don't.
And the sample code does not check the second request for favicon.ico. So I edited some of them.
This question is posted in 2016. However, the sample code and the library ESP8266Wifi have not fixed. So I hope this code helps someone.
void WaitWebClient()
{
WiFiClient client = server.available();
// wait for a client (web browser) to connect
if (client)
{
Serial.println("\n[Client connected]");
// <<<<<<<<< Added
// In chrome browser, if you close the tab or window opened during a request
// client.connected() will be true and client.available() will be zero.
int cntToBreak = 0;
while (client.connected())
{
// available() returns the size of message.
if(client.available())
{
String line = client.readStringUntil('\r');
client.readStringUntil('\n'); // <<<<< Added
Serial.print(line);
// wait for end of client's request, that is marked with an empty line
// <<<<<<<<<<< Modified
if(line.length() == 0)
{
client.println(prepareHtmlPage());
break;
}
Serial.println();
Serial.println(line.length());
}
// <<<<<<<<<<<<< Added
// Client is connected but no message.
// then count the times of this loop.
else
{
if(cntToBreak++ > 20)
{
cntToBreak = 0;
break;
}
}
}
delay(1); // give the web browser time to receive the data
// close the connection:
if(client.stop())
{
Serial.println("[Client disonnected]");
}
}
}
from wifi101.
Related Issues (20)
- Green LED does not light when connecting using static IP on board rev b
- Compiler warning about buffer overflow in firmwareVersion() HOT 1
- 'if' statement at WifiClient.cpp:149 is useless HOT 1
- Wifi101 doesn't work once add the freeRTOS library HOT 3
- AP mode with WPA
- Modernize CI system
- HTTPS to sites using LetsEncrypt certificates with MKR1000 fails HOT 1
- Progressively slower transmission and potential buffer handling issue. HOT 5
- AP SSID goes back to default wifi101-xxxx after re-entering provision mode
- Add GitHub Actions workflow to synchronise with shared repository labels
- WiFi.ping(ip) freezes mkr1000 if WiFiUdp.h included
- Infinite stall on WiFiWebServer sample / MKR 1000 HOT 1
- WiFiServer simple improvements
- WiFi.hostname("MKR1000") function has no effects
- Multiple compilation problems on ESP8266 HOT 4
- Library does not work with WINC1500 and Mega2560 HOT 9
- Adafruit Feather M0 WiFi with uFL - ATSAMD21 + ATWINC1500 - fw 19.4.4
- Tx Power Mode
- Turn on WiFi hardware once turned off with WiFi.end()
- MKR1000 no connection with SSL (https) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifi101.