Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SSID, channel and regulatory country display more robust #32

Open
martignoni opened this issue Nov 8, 2017 · 6 comments
Open

Make SSID, channel and regulatory country display more robust #32

martignoni opened this issue Nov 8, 2017 · 6 comments
Assignees
Labels
Type: enhancement New feature or request
Milestone

Comments

@martignoni
Copy link
Member

martignoni commented Nov 8, 2017

Make the display of the SSID, Wi-Fi channel and regulatory country robust, by asking directly the system (instead of reading the config files).

@martignoni martignoni added the Type: enhancement New feature or request label Nov 8, 2017
@martignoni martignoni self-assigned this Nov 8, 2017
@martignoni
Copy link
Member Author

martignoni commented Nov 8, 2017

For this issue, we'll make use of iwcommand, e.g.:

iw wlan0 info | awk '/ssid/{print $2}'
iw wlan0 info | awk '/channel/{print $2}'
iw reg get | awk '/country/{print $2}' | cut -d':' -f1

@martignoni
Copy link
Member Author

If needed, interface name can be obtained with

iw dev | awk '/^\s*Interface/{print $2}'

@martignoni
Copy link
Member Author

Better idea for interface name: look inside directory /sys/class/net.

@martignoni martignoni added the Status: test started Test started for feature or fix label Feb 17, 2018
@martignoni martignoni changed the title SSID and channel display is not robust Wireless SSID, channel and regulatory country display is not robust Feb 18, 2018
@martignoni martignoni changed the title Wireless SSID, channel and regulatory country display is not robust Make SSID, channel and regulatory country display more robust Mar 16, 2018
@martignoni
Copy link
Member Author

martignoni commented Mar 17, 2018

This will take care of SSID with a space inside:

iw wlan0 info | awk '/ssid/{$1=""; print substr($0,2)}'

Edit, better yet:

iw wlan0 info | grep ssid | cut -d\  -f2-

@martignoni martignoni removed the Status: test started Test started for feature or fix label Mar 18, 2018
@martignoni
Copy link
Member Author

martignoni commented Mar 18, 2018

This will print SSID with accented chars:

printf $(iw wlan0 info | awk '/ssid/{$1=""; print substr($0,2)}')

@martignoni martignoni added this to the 1.11.0 milestone Jun 15, 2018
@martignoni martignoni modified the milestones: 1.11.0, 1.11.1 Jul 9, 2018
@martignoni
Copy link
Member Author

martignoni commented Jul 13, 2018

To get Wi-Fi interface name (source: https://unix.stackexchange.com/a/417845):

find /sys/class/net -follow -maxdepth 2 -name wireless 2> /dev/null | cut -d / -f 5

martignoni added a commit that referenced this issue Jul 13, 2018
martignoni added a commit that referenced this issue Jul 13, 2018
@martignoni martignoni modified the milestones: 1.12, Future version Aug 14, 2018
@martignoni martignoni modified the milestones: 2.0.0, 2.5.0 Feb 28, 2019
@martignoni martignoni modified the milestones: 2.1.0, 2.5.0 May 15, 2019
@martignoni martignoni modified the milestones: 2.5.0, 2.6.0 Feb 8, 2020
@martignoni martignoni removed this from the 2.6.0 milestone May 28, 2020
@martignoni martignoni added this to the 2.7.0 milestone May 28, 2020
@martignoni martignoni modified the milestones: 2.7.0, 2.8.0 Jul 23, 2020
@martignoni martignoni modified the milestones: 2.8.0, 3.0.0 Oct 29, 2020
@martignoni martignoni modified the milestones: 3.0.0, 3.1.0 Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant