-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Set "disabled" PM at reset, provide PM constants and better documentation #6976
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on a couple of days of uP testing, and today with CP, I think this is the way to go, at least for now. Connections will be more reliable, and users will have less grief.
I've been running side-by-side power modes 0
and 2
for a couple of hours based on the prior merge (automatically re-connecting to the AP after an OSError: 2
), and the 0
(power-save OFF) has been successively doing requests every 10 minutes without any disconnections or failures. The 2
(prior PR, and uP, default power save) output is:
Connected? 192.168.6.199
2022-09-30T12:26:15-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
2022-09-30T12:36:19-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
2022-09-30T12:46:22-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T12:56:42-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
2022-09-30T13:06:46-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
2022-09-30T13:16:51-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T13:27:12-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T13:37:34-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T13:47:55-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T13:58:16-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T14:08:37-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T14:18:58-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T14:29:19-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
[Errno 2] No such file/directory
Connected? 192.168.6.199
2022-09-30T14:39:40-05:00 600 200 OK b'This is a test of Adafruit WiFi!\nIf you can read this, its working :)'
Frequent OSError, but recoverable with reconnection to the AP. I'll restest the modes with artifacts from this PR when available, and let it go overnight or longer. But I'm good with this approach. Thank you!
I think maybe this doesn't do its intended purpose, because |
Is that |
My plan is to keep the value given to |
In uP, the pm config is a method on the network.WLAN which had already been activated. In my CP testing above (and continuing consistent with that report), results may be depending on the fact that they both started with a reload not a reset. |
Updated version maybe sets power management off by default as intended. |
.. and provide 4 preset values
.. the value actually needs to be enforced each time the STA or AP is enabled, because internally there's a call to cyw43_wifi_pm with the library's defaut power management value, not ours. Add a getter, though it only returns our idea of what the power management register is set to, it doesn't read out from the actual hardware, sadly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good after 60 minutes. Hard-reset, then requests at 10-minute intervals. The board running the new CircuitPython default (no power-save; no calls to cyw43.set_power_management()
) has had no disconnections.
@jepler Could you fix the two typos I noted above, and possibly address the other comment above? |
Done @dhalbert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for merge after this? I can stop the unnecessary rebuilds, since this is only a doc change.
Yes I think it's ready! |
Sets the
0x00a11140
power saving mode at reset time, which is calledPM_DISABLED
.The following PM constants are provided:
"STANDARD" is what was called "DEFAULT" in cyw43 documentation, except we're overriding the default.
Closes: #6958 (pending testing from @anecdata)