Wi-Fi connection dropping and can't be recovered

Hi,

We have an issue where a Wi-Fi connection drops and never reconnects until we power cycle the device.

We tried the following, when a connection is lost:
nmcli radio wifi off
nmcli radio wifi on
nmcli d connect [interface]
nmcli c reload
nmcli dev wifi list --rescan yes
nmcli c up [connection-id]

Nothing seems to help.

We also bumped into a separate issue (might be related, or might not) that if we “nmcli radio wifi off”, power cycle the device, next time it boots, if we do “nmcli radio wifi on”, it does not reconnect until we power cycle and then it comes up perfectly. Note that if we do “nmcli radio wifi off” and “nmcli radio wifi on” (with no power cycle) it works ok.

BTW, in some cases, when we do “nmcli c up [id]” it shows the following error:
Error: Connection activation failed: Secrets were required, but not provided
HOWEVER, if we power cycle, the same connection works great, so the nmcli profile is there and has the information it needs.

Is there any way, from a container, to:

  1. restart the wifi driver?
  2. restart network manager service?

Any other tips? ideas?

Thank you! :wink:

After dumping some logs (dmesg etc) it appears that if the device boots after nmcli radio wifi off was issued, wpa_suppliment does not load properly and cannot recover until nmcli radio on + reboot. radio on by itself does not recover wpa_supplicant.

Is there a way to reload network manager and wpa_supplicant from a container?

Hi,
You can restart services using DBus.

This is the call I use to restart ModemManager.

dbus-send --system --print-reply --type="method_call" --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.RestartUnit string:"ModemManager.service" string:"replace"

I’m pretty sure you can simply replace the ModemManager.service with NetworkManager.service.
See here for steps on how to enable DBus.
See here for more info on the systemd Manager interface.

2 Likes

Thank you! This is VERY helpful!

1 Like

Thanks for the assist @TJvV!

:slight_smile: