Skip to content

Instantly share code, notes, and snippets.

@Astro36
Created February 24, 2026 01:41
Show Gist options
  • Select an option

  • Save Astro36/b97f9c981182a7bd60bb8ad280f72f6a to your computer and use it in GitHub Desktop.

Select an option

Save Astro36/b97f9c981182a7bd60bb8ad280f72f6a to your computer and use it in GitHub Desktop.
Raspberry PI Wi-Fi Config

1. Disable Wi-Fi Power Saving

1.1 Concept

NetworkManager may enable Wi-Fi power saving by default. To ensure stable networking, set wifi.powersave = 2 to disable power saving.

NetworkManager Power Save Values

Value Meaning
0 Default
1 Enable power saving
2 Disable power saving
3 Force enable

1.2 Create or Modify Configuration File

Open the configuration file:

sudo nano /etc/NetworkManager/conf.d/wifi-powersave.conf

Insert the following content:

[connection]
wifi.powersave = 2
  • [connection] defines the NetworkManager connection configuration section.
  • wifi.powersave = 2 disables Wi-Fi power saving.

1.3 Restart NetworkManager

Apply the changes by restarting the service:

sudo systemctl restart NetworkManager

Check service status:

systemctl status NetworkManager

2. Enable Automatic Wi-Fi Reconnection

2.1 Verify Connection Profile Name

List available connections:

nmcli connection show

Example output:

NAME       UUID                                  TYPE      DEVICE
mywifi     xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  wifi      wlan0

Ensure the connection name is exactly mywifi.

2.2 Enable Autoconnect

sudo nmcli connection modify mywifi connection.autoconnect yes

Function

  • Automatically reconnect when Wi-Fi disconnects.
  • Automatically connect at system boot.

2.3 Set Autoconnect Priority

sudo nmcli connection modify mywifi connection.autoconnect-priority 20

Priority Behavior

If multiple Wi-Fi profiles exist, NetworkManager selects the highest priority value.

Default priority: 0 Higher value = Higher connection preference.

Example:

Profile Priority
home 10
mywifi 20
mobile 5

In this case, mywifi connects first.

2.4 Verify Configuration

nmcli connection show mywifi | grep autoconnect

Expected output:

connection.autoconnect:                 yes
connection.autoconnect-priority:        20

3. Troubleshooting

3.1 Confirm Configuration File

cat /etc/NetworkManager/conf.d/wifi-powersave.conf

3.2 Check Current Power Save Status

iw dev wlan0 get power_save

Expected output:

Power save: off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment