-
Notifications
You must be signed in to change notification settings - Fork 46
Disable pm for join #10
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
base: main
Are you sure you want to change the base?
Disable pm for join #10
Conversation
Note: This has a dependency on #8 |
Is this the right way to solve the problem? Is there any precedence for this in the Broadcom/Cypress/Infineon driver? I'm concerned that by disabling PM during join, it won't send the AP the correct DTIM values and the sleep mode won't work correctly when PM is enabled (after joining). Did you test that power saving still works with this patch? |
I don't think there's a precedent, but I'm not sure the Infineon example will be very well tested.
No - I just checked that the pm2_sleep_ret value was restored. I'll have to have a think about how to check if power management is affected. |
148b250
to
7556b96
Compare
The way have done this in the past is to attach a current/power measuring device to the target board and set the DTIM high (eg 5, or even 9) and monitored the power usage over time when it's connected to the AP. You need a relatively quiet WiFi network to see it go into low power mode. |
ef28a70
to
acc810a
Compare
Apologies - I got confused a few times and pushed the wrong version. It should be correct now. I've done some testing. Disabling power management makes a big difference of around 8-10mA. I tried messing around with dtim and do see a small difference if I use a large value for dtim - maybe 0.5mA. As far as I can tell the power values are as expected after the pm is restored after a join so the change looks ok as far as I can tell. |
I have a slight concern based on WiFi actually being down for a period, and that running batteries down. I think maybe at least this should be optional (many don't have problems joining WiFi), and maybe should be periodically applied |
The caller can set the pm value themselves to disable power management already. It would be useful if they had the function to query the value if we expected them to do that. |
This is a good point. Maybe an alternative solution to disabling PM during join is to just increase the Do we know which APs have trouble when PM is enabled? If I can source one of these APs then I could test the fix. |
Original report is here raspberrypi/pico-sdk#912 I believe I asked Floris (Maxnet) to test with 2000ms and it didn't seem to improve things. |
It doesn't look like I can easily obtain one of those.
OK... Looking at some WICED examples, they do disable PM briefly during DHCP. Also PM is not enabled until after connecting to WiFi, it seems. |
Shall I close this as "not going to fix"? No one's moaned at me about it recently, so it can't be that important. Power management can be disabled by the caller if required. |
Had a few reports that joining wifi can be very slow. Disabling power management seems to fix the problem. The PM mode is cleared when a join is started and restored when complete on success or failure. Fixes georgerobotics#9
acc810a
to
c0316da
Compare
cyw43_wifi_join queries the PM value and saves it, before clearing the PM mode. This is then restored when the connection has completed with success or failure.