-
Notifications
You must be signed in to change notification settings - Fork 128
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
WiFi.status() == WL_CONNECTED although connection lost and WiFi.RSSI() == 0 #86
Comments
This maybe related to what I see in issue: 80. Sometime I can run for a day or two, sometimes just for 10 minutes or less... I'm testing with both the Feather M0 and MKR1000 board, same issue... |
Closed via #85. Please try out the master version the library. |
Oops, closed the wrong issue, re-opening. |
@michael71 could you please share an example sketch to reproduce the issue. Also, it would be great if you could try out #77 (comment). |
here is my example code: (I started 3 MKR1000s yesterday evening - 2 are still running after 32000 seconds, 1 has "rssi=0" since 2 hours ago)
|
I will now start a test with the "Wifi101-Socket-Buffer" lib. |
sorry, hit the wrong button |
@michael71 thanks. I don't see a |
sorry, sandeepmistry, I added the loop() to the listing ... |
I did some more long term experiments, with the #77 lib and with the standard WiFi101 library. I experienced rssi=0 both with and without the "#77" patch - and with and without running the board from battery or from a 5V-USB power source. 1 board still runs o.k. after 194700 seconds - others stop sending multicast UDP messages to the network (with WiFi.status() = WL_CONNECTED and WiFi.rssi()=0 ) after only 14000 secs. (I also had "Serial" used and "Serial" not used - also made no difference) So I cannot (with my 4 MKR1000s) conclude a root cause for this phenomenon. It happens with different (attached) hardware, with different power supplies and with different WiFi101 libs (see above). However, reconnecting (I have a "config" mode in my full SW, with a "reconnect" command) seems to work, therefore I will call this "reconnect" function whenever RSSI is zero:
(I also added a watchdog with 8secs, reset in my loop() function - but this doesn't seem to reset the processor - because the "loop()" just runs fine all the time.) |
Thanks, I'll setup a similar test here to see if I can reproduce it. Just to confirm, I should be able to reproduce if I only setup 2 MKR1000's to broadcast? For now, let's avoid using the |
The re connection process, is working on my test code, but if an external UDP or WEB access was process, then they are dropped. This requires the external device to re establish the connection... Not good. This is only a PATCH, we need to discover the root cause of these issues... I have connections that run fine for a few days, other drop in 2 minutes... thanks |
Looking at
I'm wondering if the request for the RSSI is timing out. This might be caused by the socket RX queue getting full and blocking all communication with the WINC1500 firmware for all other operations until it is cleared. I'll try some tests where I setup a UDP socket on a board and blast some UDP packets from my Mac. |
If you could enable the debug print facilities in the stack, it might help in tracing this issue. ~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~ On Aug 16, 2016, at 12:34 PM, Sandeep Mistry [email protected] wrote: Looking at WiFi::RSSI(): int32_t WiFiClass::RSSI()
} — |
I'll push a branch with them enabled, it's not super useful from what I remember unfortunately. |
Info. on enabling debug mode on SAMD (MKR1000) can be found here: #83 (comment) |
thanks for the DEBUG prints - however, besides start up messages this is the only debug-message within a few hours of operation: (APP)(ERR)[nm_clkless_wake][174]clocks still OFF. Wake up failed this messages appeared during (what I thought) normal operation. |
@michael71 @trlafleur another branch for you to try out for me: https://github.com/sandeepmistry/WiFi101/tree/samd-debug-enable_socket-buffer-experiments This should prevent the RSSI from being set to zero if there is pending received UDP data. @michael71 please also see my reply in #86 (comment) - did do you disable deep sleep mode? |
thanks for the new test version - any special messages/events which I should look for? Concerning the deep sleep: I made some tests with and some without "deep sleep" - however, I experienced the same result (after some hours: rssi=0) with both of them, therefore I don't think the problem is located there. (but I can switch off "deep sleep" for the new tests, just to exclude a problem with this mode) |
and here we already have a nice ERROR: ERROR: wifi connection lost, rssi low or zero // output from my program (APP)(DBG)[hif_send][414]Failed to alloc rx size (this was still with deep sleep enabled, will now repeat the test without deep sleep) |
this "Failed to alloc rx size" is also reported once right after the start of the WiFi module: trying connect to ssid=lonstoke pass=*** #=0 // output of my program (APP)(DBG)[hif_send][414]Failed to alloc rx size |
After 44000 seconds the MKR1000 is still running well (with https://github.com/sandeepmistry/WiFi101/tree/samd-debug-enable_socket-buffer-experiments and without deep sleep). However, another MKR1000 with the original WiFi101 SW and with deep-sleep enabled is also running for so long. |
@michael71 do you have any more updates on your testing? |
I had to stop the test at ~160000 seconds (two days) without any problems with the software. I can restart it today to see if I can confirm this. |
the WiFi101/samd-debug-enable_socket-buffer-experiments software looks very promising, @sandeepmistry ! |
@michael71 thanks for the feedback. I'll submit a PR with just sandeepmistry@c2be9f6 for more testing. Stay tuned ... It will have the debug output disabled just to make sure that wasn't affecting the timing. |
I am getting this exact issue with WiFi101 0.14.3, WINC1501 19.5.2 firmware on a WINC1500 breakout connected to an Arduino Mega. WiFi.RSSI() called once in the program loop (loop time ~1 second) guarantees dropping off the network with WiFi.status() == 3 and RSSI == 0 within 2 hours. When I removed the WiFi.RSSI() call I immediately was able to extend uptime to 12+ hours. It seems like this was not completely resolved. It should probably be noted in the documentation that WiFi.RSSI() should not be called in the program loop. |
I'm also experiencing this problem WiFi.status() == 3 and RSSI == 0. I've attempted to add code to reset the connection if this condition exists, but I'm unable to reset using WiFi.end(), or WiFi.disconnect(). Ultimately, it would be nice if this event never occurred, or would automatically trigger some sort of reset, or there would be a way for me to reset the connection. Anyone have a suggestion? BTW... I have 10 devices running 24/7 and they all exhibit this symptom. Generally, they need to be manually rebooted between a few times a day, to every couple days. Adafruit Feather MO board, 19.5.2 firmware, WiFi101 0.14.3 |
Keith, Then I reconnect to the WPA/WPA2 network:
This fixed the "RSSI=0" problem for me - without having to reset the main processor. |
Michael, Thanks for the tip. This does seem to work. I've added code in various locations to check for a non-responsive network connection, then call the reset code you suggest. This solves the problem, but I wish the problem didn't exist in the first place. -- Keith |
I'm using the MKR1000 with the WiFi101 lib (and WiFiiUDP) to send Multicast UDP messages. (which works fine in principle).
But after some time (this can be after 30 min or after 2..4 hours), the UDP messages are no longer sent to the network.
When this happens, the WiFi.status() is still equal to WL_CONNECTED (!), but WiFi.RSSI() is equal to 0 (I'm using a Serial(USB) debug output). Calling WiFi.begin() and upd.beginMulti(..) again does not result in a new, working connection. (and it happens if I connect a Serial-USB connection or not). Power supply is either via PC/USB or with the 800mAh battery - this also makes no difference.
thx, michael.
P.S.
I uploaded a similar test SW to both the
and also to the
and both these boards do not seem to have this problem.
P.S.2
My WiFi RSSIs are in the -55 to -40 range - the AP is in the same room with the boards.
The text was updated successfully, but these errors were encountered: