Closed pgeremia closed 2 years ago
HI @pgeremia
Thanks for your interest in the library and investigation.
I'm sorry I don't have the too-old MKR1000 to test and help you, so you're on your own.
Some suggestions
I have to close the issue now, and only reopen when you prove this is a bug of this library
Good Luck,
Thank you for the help. I really appreciate the guidance. I use the Nano 33 IoT in many other projects. Unfortunately for this project I have to use a Uno form factor. So I need to use MKR1000 with MKR2UNO adapter. I will get it working and let you know the solution. Again thank you for your help!!
Yes!! That is a great idea. Ordering now and will give it a go! Thanks!!!
So while I am waiting for the new board to come in I did a little more digging and I think I found something. If the length of the web page is greater than around 1400 bytes it hangs and the web page is never displayed. So I went into the wifiwebserver code and instead of sending the entire web page, I decided to call the wifi client write method that takes a single byte. It is a little slower but it now works! But as expected other network functions in my program are not working and hanging. So like you said it probably is the buggy wifi101 library. I will just wait for the new board!
/////////////////////////////////////////////////////////////////////////
//PG
void WiFiWebServer::sendContent(const String& content, size_t size)
{
const char * footer = RETURN_NEWLINE;
if (_chunked)
{
char * chunkSize = (char *) malloc(11);
if (chunkSize)
{
WS_LOGDEBUG(F("sendContent: _chunked"));
sprintf(chunkSize, "%x%s", size, footer);
_currentClient.write(chunkSize, strlen(chunkSize));
free(chunkSize);
}
}
WS_LOGDEBUG1(F("sendContent: Client.write content: "), content);
///////////////////////////////
//Write data a byte at a time
//////////////////////////////
for (int i = 0 ; i < size ; i++ )
{
_currentClient.write(content[i]);
}
//_currentClient.write(content.c_str(), size);
if (_chunked) {
_currentClient.write(footer, 2);
}
}
The limit 1400
is defined by
as
#define SOCKET_BUFFER_MAX_LENGTH 1400
You can try to send by chunk
by modify the code somewhere to enable it. I don't have time now to look at it.
I think I will wait for the other board and go from there. I did try to increase the max length but I then had other odd things happen like the web page was not rendered correctly. Maybe some kind of corruption? Anyway the espduino-32 boards have been shipped and are on their way. Thank you!
I got the new ESPDUINO-32 board. I am using ESP_WiFiManager_Lite. It works much better and WiFi seems to work. The only thing I cannot figure out is an issue accessing the onboard file system. I get this error:
When I start up: (26) SPIFFS: mount failed, -10025
Then a little while later:
LittleFS_esp32/1.0.6/src/lfs.c:1076:error: Corrupted dir pair at {0x1, 0x0} E (36025) esp_littlefs: mount failed, (-84) E (36073) esp_littlefs: Failed to initialize LittleFS
If I use ESP_WiFiManager everything works great. So I may just rewrite my application to use that instead unless you know what may be the issue. I have spent a lot of time trying to figure it out with not a lot of luck.
Thank You.
I'm glad you're doing much better now with the new ESPDUINO-32 board.
I don't have any issue using ESP_WiFiManager_Lite with that same ESPDUINO-32 board.
Be sure to start with the ESP_WiFi example to have a good feeling before moving on.
Check if you
LittleFS
, not SPIFFS
Good Luck,
Starting ESP_WiFi using LittleFS on ESP32_DEV
ESP_WiFiManager_Lite v1.8.2
ESP_MultiResetDetector v1.3.1
LittleFS Flag read = 0xFFFE0001
multiResetDetectorFlag = 0xFFFE0001
lowerBytes = 0x0001, upperBytes = 0x0001
No multiResetDetected, number of times = 1
LittleFS Flag read = 0xFFFE0001
Saving config file...
Saving config file OK
[WML] Hdr=ESP_WM_LITE,SSID=HueNet1,PW=password
[WML] SSID1=HueNet2,PW1=password
[WML] BName=ESP32_WMLite_v105
[WML] WiFi networks found:
[WML] 1: HueNet1, -40dB
[WML] 2: HueNetTek, -42dB
[WML] 3: HueNet2, -56dB
[WML] 4: El khoury, -80dB
[WML] 5: ESP151CD5, -81dB
[WML] 6: DECO-5655, -88dB
[WML] 7: rogers786, -89dB
[WML] 8: Guest5655, -89dB
[WML] 9: house, -90dB
[WML] 10: Jessie, -91dB
[WML] 11: Rogers 786, -91dB
[WML] 12: Jasmine, -93dB
[WML] 13: Access, -94dB
[WML]
stConf:SSID=your_customized_ssid,PW=your_customized_pwd
[WML] IP=192.168.4.1,ch=8
C
Your stored Credentials :
Blynk Server1 = blank
Token1 = blank
Blynk Server2 = blank
Token2 = blank
Port = blank
MQTT Server = blank
Stop multiResetDetecting
Saving config file...
Saving config file OK
CC
All I had to do is grab the defines in the example you provided and everything worked perfectly! Turns out my defines (from another example) did not have the circled section so it was using SPIFFS. Thanks again for all of your help!! I really appreciate it!!!
Describe the bug
Using example code for MKR1000 the config portal will not come up.
Steps to Reproduce
Load example MKR1000_WiFi101 sketch and run. Connect to Wifi AP Run curl with -v and point to 192.168.4.1 to see web portal. There is a connection but it is immediately closed before config portal shows up.
Expected behavior
Config portal is displayed allowing you to set up wifi access.
Actual behavior
Config portal is never displayed.
Screenshots
** This is run when it failed with debugging level 4 enabled
Connect to serial port /dev/cu.usbmodem1444101 at 115200
Information
Arduino IDE version: 1.8.13 MKR1000 Hardware (just purchased) updated to latest WIFI firmware (19.6.1) Using Eclipse IDE with Sloeber Arduino Env Running on MacOS
Additional context
I turned on debugging and played around with the different parameters. I have found that when I turn off
USE_DYNAMIC_PARAMETERS
andSCAN_WIFI_NETWORKS
The config portal then works.
I will do more debugging after work and see if I can isolate it any further.
The test I did took the stock example with almost no changes running on a MKR 1000 with the LATEST wifi firmware.