Add support for the "priority=" field in wpa_supplicant.conf

Suggest new features here
Locked
ke8dpf
Posts: 5
Joined: Fri Jun 29, 2018 10:43 pm

Add support for the "priority=" field in wpa_supplicant.conf

Post by ke8dpf »

The pi-star web interface presently does not support the wpa_supplicant.conf "priority" field, and it really should.

Many users configure both their mobile phone, and their home wifi router, as wifi access points, in the wpa_supplicant file. A few of us (such as myself) have even more entries than that.

The problem comes when multiple configured access points are within range. According to the man page for the wpa_supplicant.conf file, when multiple configured access points are available at the same time and are equally weighted in the context of the file, factors other than simply the order in which they appear in the file (such as signal strength and security characteristics) will determine which one the hotspot latches on to, making any advanced "knowing" of where you'll end up connected, a crap-shoot.

Additionally, it is difficult to manually add the "priority=" field to a stanza in the web GUI's "expert - wifi" text editor, as a "TAB" key does not insert a tab character, it merely moves the browser's "focus" out of the text entry area of the page, and down to the "Apply changes" button at the bottom of the screen. This leaves either an SSH client (such as PuTTY), or the "ShellInABox" SSH client, as the only means of directly editing the file (both of which require you to remount the rootfs as RW before you can actually edit the file manually, and then remounting it RO again (or rebooting.)

It would be far better, easier, safer, and less error prone, for the GUI to add support for the "priority=" field in each wpa_supplicant.conf stanza. Connecting to one of multiple configured and available networks should not be a crap-shoot based on characteristics outside of the user's control. If I'm in a place where multiple such networks are present, configured, and available, I want to *know* where my unit will connect. Not leave it to chance or other factors I can't control.
KE7FNS
Pi-Star Team
Posts: 1805
Joined: Wed Apr 17, 2019 11:11 pm

Re: Add support for the "priority=" field in wpa_supplicant.conf

Post by KE7FNS »

ke8dpf wrote: Wed May 05, 2021 12:28 pm The pi-star web interface presently does not support the wpa_supplicant.conf "priority" field, and it really should.
The priority IS currently supported. It is handled automatically in the dashboard by the network position.

Network 1 has priority over Network 2. Network 2 has priority over Network 3, and so on.

In technical terms.

Code: Select all

Network N = 100-(N-1) priority.
If someones previous actions are any indication of their future actions, then I predict the deletion and removal of access will happen at any moment. 7-11-2020.

"07/13/20 This Website Has Been Taken Down" ... again :lol:
ke8dpf
Posts: 5
Joined: Fri Jun 29, 2018 10:43 pm

Re: Add support for the "priority=" field in wpa_supplicant.conf

Post by ke8dpf »

The problems are these:

If no "priority" field is listed, simple order of stanzas within the file is no guarantee that the correct/desired/intended network will be the one actually chosen by the selection algorithm (which is not controllable via pistar). Other factors outside of the user's control (and outside of simple order in the file) can come into play. Signal strength, security mechanisms, and so on, can, at times, override mere order in the file.

The "priority=" field allows the user to dictate, with concrete predictability, which network the system will select, when in the presence of multiple, otherwise equally (non)-prioritized networks, regardless of their order in the file.

Those who oppose the use of the priority feature and declare it unnecessary tend to be folks who have never encountered the need, in their own specific use case. But to assume that such functionality isn't needed simply because they themselves don't need it, is naive.
ke8dpf
Posts: 5
Joined: Fri Jun 29, 2018 10:43 pm

Re: Add support for the "priority=" field in wpa_supplicant.conf

Post by ke8dpf »

Consider the following snippets from the man pages...

This first is what everyone thinks of when they assert that order in the file is the be-all/end-all solution...

NETWORK BLOCKS
Each potential network/access point should have a "network block" that
describes how to identify it and how to set up security. When multiple
network blocks are listed in a configuration file, the highest priority
one is selected for use or, if multiple networks with the same priority
are identified, the first one listed in the configuration file is used.


But no one seems to be aware of, consider valid, or chooses to ignore, the assertion immediately preceding that...

NETWORK BLOCKS
Each potential network/access point should have a "network block" that
describes how to identify it and how to set up security. When multiple
network blocks are listed in a configuration file, the highest priority
one is selected for use or
,
if multiple networks with the same priority
are identified, the first one listed in the configuration file is used.

And then there's (from the same documentation)...

priority
The priority of a network when selecting among multiple networks;
a higher value means a network is more desirable. By default
networks have priority 0. When multiple networks with the same
priority are considered for selection, other information such as
security policy and signal strength are used to select one
.
KE7FNS
Pi-Star Team
Posts: 1805
Joined: Wed Apr 17, 2019 11:11 pm

Re: Add support for the "priority=" field in wpa_supplicant.conf

Post by KE7FNS »

ke8dpf wrote: Thu May 06, 2021 3:05 pm If no "priority" field is listed, simple order of stanzas within the file is no guarantee that the correct/desired/intended network will be the one actually chosen by the selection algorithm (which is not controllable via pistar). Other factors outside of the user's control (and outside of simple order in the file) can come into play. Signal strength, security mechanisms, and so on, can, at times, override mere order in the file.

The "priority=" field allows the user to dictate, with concrete predictability, which network the system will select, when in the presence of multiple, otherwise equally (non)-prioritized networks, regardless of their order in the file.

Those who oppose the use of the priority feature and declare it unnecessary tend to be folks who have never encountered the need, in their own specific use case. But to assume that such functionality isn't needed simply because they themselves don't need it, is naive.
I explained this already. If you use the dashboard to enter your network information the PRIORITY IS ASSIGNED AUTOMATICALLY. Network 1 has a higher priority over Network 2, and so on.

I do not OPPOSE the use of the priority feature as you are claiming. I have explained it is ALWAYS in use if you use the tools provided by Pi-star to create your networks. If you don't use the included Pi-star tools then it is the users responsibility.

If the user wants a network to have a higher priority than another network, enter it into the dashboard first.

Your request has been noted, if the Pi-star team feels it is something beneficial then it will be added.
If someones previous actions are any indication of their future actions, then I predict the deletion and removal of access will happen at any moment. 7-11-2020.

"07/13/20 This Website Has Been Taken Down" ... again :lol:
Locked