Closed sid4084 closed 4 years ago
Hi @sid4084
The WiFiWebServer library is written specifically for WiFiNINA and other WiFi libraries using the standard #include
The WiFiWebServer v1.0.3 currently does not support MKR1000 running WiFi101.
This is the quick fix to enable MKR1000 to use this library (will be included in new v1.0.4)
// Modify to use new WiFiNINA_Generic library to support boards besides Nano-33 IoT, MKRWiFi1010, Adafruit MetroM4, etc.
#if USE_WIFI_NINA
#include <WiFiNINA_Generic.h>
#else
#include <WiFi.h>
#endif
to
// Modify to use new WiFiNINA_Generic library to support boards besides Nano-33 IoT, MKRWiFi1010, Adafruit MetroM4, etc.
#if USE_WIFI_NINA
#include <WiFiNINA_Generic.h>
#elif USE_WIFI101
#include <WiFi101.h>
#else
#include <WiFi.h>
#endif
#define DEBUG_WIFI_WEBSERVER_PORT Serial
#undef USE_WIFI_NINA
#undef WIFI_USE_NRF528XX
.....
void setup(void) { // Open serial communications and wait for port to open: Serial.begin(115200); while (!Serial);
Serial.println("\nStarting HelloServer on " + String(BOARD_TYPE));
// check for the presence of the shield
if (WiFi.status() == WL_NO_MODULE)
if (WiFi.status() == WL_NO_SHIELD)
{ Serial.println(F("WiFi shield not present")); // don't continue while (true); }
String fv = WiFi.firmwareVersion(); if (fv < WIFI_FIRMWARE_LATEST_VERSION) { Serial.println("Please upgrade the firmware"); }
....
Please try the modified code and let me know so that I can update the release.
I also post the updated code on Master.
The above fix did work, WiFi now connects and the HTTP server is working on MKR1000. Excellent! Thank you!
Good news. I'll post new release v1.0.4 to provide support to MKR1000. Your contribution will be noted. Regards,
Hi @sid4084
Please test the new v1.0.4 library and inform it's all OK now for you.
Thanks,
I have tested with library v1.0.4 and this issue is fixed.
I currently am unable to use Transfer-Encoding: chunked, which is needed for HTTP responses larger than 1400 chars. In my handleRoot() function I have: server.setContentLength(CONTENT_LENGTH_UNKNOWN); server.send(200, "text/html", temp); and the response header includes 'Transfer-Encoding: chunked', but the connection never completes. There may be some problem with the format of the last chunk. But I think this will be a topic for a new Issue.
I think that is the issue of the W101 library the MKR1000 is using. If so, you can post the issue there to ask for help.
The WiFiWebServer library is based on many other libraries (ESP8266-AT, WiFiNINA, W101, etc.), and the performance / behaviors depend on those underlying libs. The find out exactly what happening, you can
You can also post the total test code here so that somebody or I can have a look. I'm sorry I don't have any MKR1000 to know what's happening. Hope someone can help testing.
This does not work on MKR1000. Serial monitor shows: Starting HelloServer on SAMD MKR1000
But then hangs up on WiFi.begin