arduino-libraries / WiFi101

Wifi library for the Arduino WiFi 101 Shield
159 stars 128 forks source link

Using Adafruit Feather M0/Winc1500 loses data on GET #115

Closed HowardPWardinkle closed 7 years ago

HowardPWardinkle commented 7 years ago

I have the Feather M0 IoT kit and it works fine for the temp/humidity sample. I tried to use the WiFi101->WiFiWebClient sample and it connects to Wifi ok and gets part of the page, but not the entire page. It will get 3-7K of the google result in the sample. Not a consistent number of bytes. (I did call SetPins per Adafruit's doc at https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/using-the-wifi-module)

I tried reading data after disconnect and removing Serial.write and I could get more data, but never the full page. I tried other web pages with same results, partial data. Any ideas on getting the sample to work?

sandeepmistry commented 7 years ago

Hi @JimWatV1,

Could you please share a URL (and entire sketch that causes issues)?

For the google result sample, I get the following which is the whole page:

Starting connection to server...
connected to server
HTTP/1.1 302 Found
Location: http://www.google.ca/search?q=arduino&gws_rd=cr&ei=W2w3WPezPMHgjwSgrq-gCw
Cache-Control: private
Content-Type: text/html; charset=UTF-8
P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
Date: Thu, 24 Nov 2016 22:40:27 GMT
Server: gws
Content-Length: 278
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: NID=91=zs-DnN3FdI3FqVgTpgiWtokBbQfbRLMLNHktnz9fUNiqG8KSILGCIkQUer1TuUB04kRFoaC2xsiEdj3gDUGR-V37rRoGmcYPU-emwC_Zf2G8NxnihxSCnl9T4K20x6l0; expires=Fri, 26-May-2017 22:40:27 GMT; path=/; domain=.google.com; HttpOnly
Connection: close

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.ca/search?q=arduino&amp;gws_rd=cr&amp;ei=W2w3WPezPMHgjwSgrq-gCw">here</A>.
</BODY></HTML>

disconnecting from server.
HowardPWardinkle commented 7 years ago

Thanks for the reply. You are getting a 302 to redirect. Try a link that doesn’t redirect (gets http 200)

I’ve attached the ino I used. It’s the sample with the one line added, per Adafruit:

WiFi.setPins(8,7,4,2);

When running it here’s what I get back: If you hit www.google.com/search?q=arduinohttp://www.google.com/search?q=arduino with Postman or ARC and get a 200 result, you’ll get back much more data. Notice no closing or


Attempting to connect to SSID: Abbey Connected to wifi SSID: Abbey IP Address: 192.168.1.107 signal strength (RSSI):-54 dBm

Starting connection to server... connected to server HTTP/1.1 200 OK Date: Mon, 28 Nov 2016 13:31:07 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=ISO-8859-1 P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info." Server: gws X-XSS-Protection: 1; mode=block X-Frame-Options: SAMEORIGIN Set-Cookie: NID=91=iG8-QSe6TdVSxJTp9cQ6Kb9AU717aRGJRWp6_qouZ6iiacKbb0mSjJRdXwEsR0VtIo8E5xzhWPY1S9bwYLiRzfl6IlSJoRfToM1UV4pj9arkAkNAR95F8F3QBVQcTNoimJmfU-OUV432Kj0; expires=Tue, 30-May-2017 13:31:07 GMT; path=/; domain=.google.com; HttpOnly Accept-Ranges: none Vary: Accept-Encoding Connection: close

<!doctype html>

Please click here if you are not redirected within a few seconds.
arduino - Google Search