bigtreetech / bigtreetech/CB2

Slow SSH due to WiFi power-saving; if disabled, power saving re-enables itself every 20 seconds

Open
#59 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
149
Forks
19
PR merge metrics
No merged PRs in 30d

Description

新年快乐! 🏮🎆 I hope you are enjoying the Spring Festival.

I'd like to report a bug on Pi2 V1.0.5 image. Please take a look when you're back.

My OS is fully updated to the current Armbian bullseye, except of course the “bigtree legacy” packages that came with the image.

SSH to the board is very sluggish. It often takes several seconds for a key press to take effect. Setting MTU to 1280 (the lowest value that seems to be allowed) doesn't help. Disabling power-saving for `wlan0` with `iw dev wlan0 set power_save off` does help (and I don't think a mains-powered board needs power-saving), immediately fixing the SSH slowness. However, a few seconds later, I notice that power-saving is re-enabled, as shown by `watch iw dev wlan0 get power_save`, causing SSH to slow down once more. Something seems to set the power-saving to enabled every 20 seconds, so depending on when in the cycle I turn it off, I might enjoy between 0 and 20 seconds of fast SSH.

I have no idea what is enabling the power-saving. Nothing appears in syslog or dmesg when it happens.

Things I have tried:

- `iwconfig wlan0 power off`,
- setting `wifi.powersave` to 2 under `[connection]` in `/etc/NetworkManager/conf.d/zz-20-override-wifi-powersave-disable.conf`,
- changing `/sys/class/net/wlan0/device/power/control` from `auto` to `on`,
- adding `mcp=0` to `/lib/firmware/nvram_ap6256.txt`,
- adding `options bcmdhd dhd_slpauto=0` to modprobe config and rebuilding the initramfs.

All these various settings seem to be saved and applied, but they have no effect on the unexplained 20-second power-saving re-enabling cycle.

I am currently “fixing” it with `while true; do iw dev wlan0 set power_save off; sleep 1; done`, which is extremely stupid. And I can't do it just once every 20 seconds because the phase is unknown, so I'd end up with fast WiFi some random fraction of every 20-second cycle.

Maybe this is something that the upcoming new kernel is going to fix?

万事如意! I hope you have some time to look at it after the holiday. 🏵️🍊

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported `iw dev wlan0 get_power_save` cycle and review the mentioned NetworkManager override at `/etc/NetworkManager/conf.d/zz-20-override-wifi-powersave-disable.conf`. Compare it with the `/sys/class/net/wlan0/device/power/control`, firmware, and `bcmdhd` settings described in the report. Done means identifying what re-enables power saving and confirming that the setting remains disabled without the loop workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, linux
Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.