balena-os / wifi-connect

Easy WiFi setup for Linux devices from your mobile phone or laptop
Apache License 2.0
1.27k stars 354 forks source link

Wifi forgetting network settingd #414

Open mishave opened 2 years ago

mishave commented 2 years ago

Installed on RPI3 Bv1.2 running Buster

In general, the package works fine, installed okay and when ran it connects to wifi.

But having an issue every now and then on reboot, it will forget the wifi credentials and ask to reconnect. Any tips on making sure the details are saved?

Cheers

aomanchuria commented 2 years ago

same here with buster. it doesn't actually start, but when manually started it asks for root and it doesn't remember the credentials from the previous connection.

Nidhiup commented 2 years ago

can anybody suggest a solution to this?

aomanchuria commented 2 years ago

I ended up just following the instructions here: https://www.raspberryconnect.com/projects/65-raspberrypi-hotspot-accesspoints/157-raspberry-pi-auto-wifi-hotspot-switch-internet you get a lot more control and the connection is automatic. The only down side is that there isn't a way to change the wifi you connect to unless you change the files in the pi. I think this would be easily solved using something like a plotly sever to pick wifi spots.

nettlep commented 1 year ago

I thought the same, but it turned out not to be the case.

It seems that when the device starts up, it doesn't always find the configured SSID right away, so it ends up starting the access point. That access point will be there until the ACTIVITY_TIMEOUT expires. Upon timeout, it will again try to connect to Wifi.

The problem (aside from not being able to connect to the wifi in the first place) is that the default for ACTIVITY_TIMEOUT is infinity. This means it will forever be trapped in access point mode until the wifi is reconfigured or the device is turned off.

Try setting this to something reasonable (perhaps 60 or 120 seconds.) The thing to be aware of is that when the timeout expires, the captive portal will disappear. So be sure to give yourself enough time to locate the access point, connect to it, and configure your wifi.

keenanjohnson commented 1 year ago

Just a +1 that the behavior @nettlep described was common on my balena wifi connect devices and resolved the issue for me!