Nickschaos81
Posts: 5
Joined: Thu Jun 14, 2018 1:21 am

Out dated information for setting wifi priority?

Fri Sep 14, 2018 4:11 am

I have a raspberry pi zero w and I am trying to setup my wifi connections so that they work based off of priority. So far I my pi connects to which ever network is on. Which is fine, but in the event they are both on I want it to choose the mobile network first. No matter what I do it always defaults to the home connection. As you can see I have placed them in the order and set priority, still not doing what i need it to.
This is how I have my etc/ wpa_supplicant/wpa_supplicant.conf set up

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="Mobile"
        psk="****"
        key_mgmt=WPA-PSK
        priority=1
        id_str="mobile"
}

network={
        ssid="Home"
        psk="****"
        key_mgmt=WPA-PSK
        priority=2
        id_str="home"
}

I have seen people referring to /etc/network/interfaces and that what "Should" be in there is this.

Code: Select all

auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface location1 inet dhcp
iface location2 inet dhcp

Mine does not in fact contain that at all , mine has this...

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
 
The interfaces.d is an empty directory. I am at a loss. Any help would be greatly appreciated.
Thanks :D

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Out dated information for setting wifi priority?

Fri Sep 14, 2018 4:45 am

I have seen people referring to /etc/network/interfaces and that what "Should" be in there is this.

auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface location1 inet dhcp
iface location2 inet dhcp
That's out of date information. Your /etc/network/interfaces file is correct for Raspbian Stretch.

A higher number = a higher priority. So your Home network has a higher priority than Mobile and so it is the one connected.

User avatar
bensimmo
Posts: 4654
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Out dated information for setting wifi priority?

Fri Sep 14, 2018 7:57 am

Just to confirm, you are saying

2 or 5 is 'higher' than 1.
5 here being the highest.
As in 5 biscuits is more than 2 biscuits or just 1 biscuits.


*Not*
1 is higher than 2 or 5, as in 1st, 2nd, 5th


What an odd priority setup, I would default to 1st, 2nd, 3rd,..., 100th myself.

User avatar
bensimmo
Posts: 4654
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Out dated information for setting wifi priority?

Fri Sep 14, 2018 8:03 am

A quick read and it doesn't make it clear, no wonder people get it wrong.
They are assuming you know what they mean by higher. It just tells you the default is 0 (which to many general people may mean that's the highest priority, everything else is must be lower).


https://www.freebsd.org/cgi/man.cgi?wpa ... nt.conf(5)
Last edited by bensimmo on Sun Sep 16, 2018 7:52 am, edited 1 time in total.

Nickschaos81
Posts: 5
Joined: Thu Jun 14, 2018 1:21 am

Re: Out dated information for setting wifi priority?

Sun Sep 16, 2018 2:06 am

thank you so much, ill give this a shot tonight and let you know if it worked. Thank you!

Return to “Troubleshooting”