lisztfr
Posts: 8
Joined: Sun Nov 16, 2014 1:18 pm

Fallback to alternate Wifi network ?

Thu Jun 11, 2020 12:59 pm

Hi,

I'm googling since a while and maybe i don't phrase my question correctly, but i would like a simple fallback strategy to another Wifi network if the main network isn't available. Since i always have a nano-router near by, no need to fall back to AP mode.

Thanks very much for support !

Lh

pidd
Posts: 586
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Fallback to alternate Wifi network ?

Thu Jun 11, 2020 1:14 pm

Sorry to not give details but if you look at https://www.raspberrypi.org/documentati ... ess-cli.md Adding multiple wireless network configurations. (which is at the very bottom of the page)

lisztfr
Posts: 8
Joined: Sun Nov 16, 2014 1:18 pm

Re: Fallback to alternate Wifi network ?

Thu Jun 11, 2020 2:35 pm

Ok, but it says , "On recent versions of Raspberry Pi OS"... i'm on Buster.

Well it's maybe work for Buster :

viewtopic.php?t=254526

After testing, it's not : I added 2 entries, switched of the main router, but it doesn't connect to the nano router. Well i can't figure out it anyway....

pidd
Posts: 586
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Fallback to alternate Wifi network ?

Thu Jun 11, 2020 11:10 pm

Did you reboot or restart dhcpd after adding the new wifi settings?

I've got to admit, on my Pi4s I never found reconnections on WifI robust and ended up going ethernet but my PiZeroW has always been ok.

The instructions were there before RPIOS came out so should be good for Buster.

bjtheone
Posts: 863
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Fallback to alternate Wifi network ?

Thu Jun 11, 2020 11:24 pm

lisztfr wrote:
Thu Jun 11, 2020 2:35 pm
Ok, but it says , "On recent versions of Raspberry Pi OS"... i'm on Buster.

Well it's maybe work for Buster :

viewtopic.php?t=254526

After testing, it's not : I added 2 entries, switched of the main router, but it doesn't connect to the nano router. Well i can't figure out it anyway....
and this is why the great renaming is going to be bumpy for some time. Raspberry Pi OS is the renaming of Raspbian. Currently it is exactly the same thing as Raspbian Buster. The are going to be bringing out a 64 Bit version soon as well.

lisztfr
Posts: 8
Joined: Sun Nov 16, 2014 1:18 pm

Re: Fallback to alternate Wifi network ?

Fri Jun 12, 2020 7:56 am

Thanks, i tried also this (editing the /etc/network/interfaces) :

http://www.geothread.net/multiple-wifi- ... pberry-pi/

I couldn't test it thoroughly now, but as i had the 2 WiFi available, the PI couldn't connect and when i switched one off, it did. BUT it overrides the static IP i set in the dhcpcd.conf file.

A bit OT, but my default wlan is wlan1, and not wlan0 ? It's a PI 3 B , version :

Hardware : BCM2835
Revision : a22082
Serial : 0000000016b582ef
Model : Raspberry Pi 3 Model B Rev 1.2

It's a new version with the BCM2837B0, but imho there is no onboard Wifi, so i wonder why he doesn't make use of the wlan0 ?

TIA, Lh

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Fallback to alternate Wifi network ?

Fri Jun 12, 2020 10:48 am

Well no. Interfaces is not to be used anymore on Raspios.
It’s been like that for something like 3 releases.
Don’t trust any random, obsolete post you find on the internet.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

lisztfr
Posts: 8
Joined: Sun Nov 16, 2014 1:18 pm

Re: Fallback to alternate Wifi network ?

Fri Jun 12, 2020 2:58 pm

Thank you.... !

I'm just aware that i have soft-blocked Wifi onboard :

Code: Select all

rfkill list all
0: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
1: phy1: Wireless LAN
        Soft blocked: no
        Hard blocked: no
2: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

That's why this onboard Wifi remains sort of hidden for me, by default... (fresh Buster install)

Found in this topic :

viewtopic.php?t=146198

The few tests i did regarding switching between WiFi networks, 1) if i set 2 routers ON, then PI can't connect to anyone, i have to shutdown the nano router and Pi will connect to the main router. I can't shut down the main router all the time since someone is doing serious teleworking on it ! While i'm just wasting time fooling around with PI's.

Also i have one network on which the Pi is set to STATIC IP since it's a dnsserver.

The only thing i want is to have access to my PI on travel.. i guess i will take a TP-Link router in AP mode and a cable.

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Fallback to alternate Wifi network ?

Fri Jun 12, 2020 3:26 pm

Again. You won't find the answers to your setup problems with a current copy of raspios in a 4 year old thread.

AFAIK Wifi is soft blocked on raspios for every 5GHz-capable Pis.
2.4GHz-only Pis are not soft-blocked out of the box.

To unblock wifi use raspi-config and define the wifi country of your machine. (sets rfkill to unblock wlan0)
Then reboot. (saves rfkill state)

It's all in the current install documentation of the current OS.

On the the main topic, if your set multiple networks and priorities (as per the link posted by user pidd) then wpa_supplicant will choose to connect to the AP w/ the highest priority among those found.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Beginners”