After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698236 - "nmcli dev wifi list" should be prettier and more useful
"nmcli dev wifi list" should be prettier and more useful
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmcli
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: tracker-nmcli
 
 
Reported: 2013-04-17 19:56 UTC by Dan Winship
Modified: 2013-05-31 07:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan Winship 2013-04-17 19:56:55 UTC
In an 80-column terminal, "nmcli dev wifi" is a mess, because the line gets split 2/3 of the way across. It would be nice if the default scanning command gave output that was both maximally useful for the common cases, and also maximally user-friendly and readable.

#define NMC_FIELDS_DEV_WIFI_LIST_COMMON        "SSID,BSSID,MODE,FREQ,RATE,SIGNAL,SECURITY,ACTIVE"

Obviously we want the SSID, and I guess that column's width is based on the maximum length of an SSID? We can save 2 characters by dropping the quotes though.

I have never once in my life needed to know the BSSID of a router. I think we can remove that from the defaults.

The mode is good to know, but we don't need it fully spelled out. If we just showed "I" or "A" we'd save 13 characters. (Even "Infra" / "AdHoc" would save 9.)

The frequency is also useless to me; we should be showing that as the channel instead, which is both more user-comprehensible and 6 characters shorter.

Rate is semi-useful if you have multiple choices, but I feel like showing A/B/G/N instead would be just as good. (Is that true? Or are there often different rates in some of the types? Of the 22 networks I can see currently, all are "54 MB/s".

Signal is definitely important, but it's unclear what the numbers mean (other than high being good and low being bad)... We could use random unicode characters to build signal bars:  ▂___  ▂▄__  ▂▄▆_  ▂▄▆█ ? (Either in addition to or instead of the numbers.)

I could go either way on the security column; years ago it was important to me to know exactly which encryption type a network was using because some devices didn't support WPA2, or WPA at all. But these days everything supports WPA2, and I'm not sure that seeing "WEP" vs "WPA WPA2" is really useful...

Active is important, but it only needs to be a single column with a "*" for the active network.

So...

* SSID                            MODE   CHAN   PROTO   SIGNAL     SECURITY
  Blakes Upstairs                 Infr      6     G     35  ▂___   WPA WPA2
  Belkin.58F8                     Infr      2     G     32  ▂___   WPA WPA2
  DUTCHGUY                        Infr      6     G     22  ▂___   WPA2
* netnet                          Infr      3     G     59  ▂▄▆_   WPA2
  2WIRE260                        Infr      7     G     34  ▂___   WPA
  ryu                             Infr      6     G     40  ▂▄__   WEP
  CableWiFi                       Infr    149     N     27  ▂___   --
  Cisco_2602D63A                  Infr    157     N     20  ▂___   WPA2
  KyleForrest                     Infr      4     G     44  ▂▄__   WPA2
  HOME-7EE2                       Infr      1     G     32  ▂___   WPA
  EmeraldSycamore                 Infr      6     G     32  ▂___   WPA WPA2
  EmeraldSycamore-guest           Infr      6     G     35  ▂___   --
  Shallotte                       Infr      6     G     30  ▂___   WPA WPA2
  WiFiRSU_87056                   Infr      8     G     20  ▂___   WPA2
  Shallotte-guest                 Infr      6     G     25  ▂___   --
  belkin.63e                      Infr      3     G     34  ▂___   WPA WPA2
  Ground Control                  Infr     11     G     37  ▂___   WPA2
  2WIRE141                        Infr     10     G     22  ▂___   WPA WPA2
  xfinitywifi                     Infr      1     G     45  ▂▄__   --
  HOME-8CC2                       Infr      1     G     25  ▂___   --
  Blakes Upstairs                 Infr    157     N     20  ▂___   WPA WPA2
  Shai-Hulud                      Infr      9     G     19  ▂___   WPA2

or something...
Comment 1 Pavel Simerda 2013-04-18 07:43:02 UTC
POV comment: I don't like aligned table view as the default with basic system view at all. I'm more into output like that from iproute2 package with just indentation (to group information under one section).

Example (most of you know that):



1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
5: bond0: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
7: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN 
    link/ether ae:62:6a:b0:33:37 brd ff:ff:ff:ff:ff:ff
116: testbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether f0:de:f1:b8:6a:ee brd ff:ff:ff:ff:ff:ff
    inet 84.246.161.87/28 brd 84.246.161.95 scope global testbridge
    inet6 2a00:1268:1ff:f001:f2de:f1ff:feb8:6aee/64 scope global dynamic 
       valid_lft 86395sec preferred_lft 14395sec
    inet6 fe80::f2de:f1ff:feb8:6aee/64 scope link 
       valid_lft forever preferred_lft forever
117: testbond: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::200:ff:fe00:0/64 scope link 
       valid_lft forever preferred_lft forever
Comment 2 Dan Winship 2013-04-18 13:14:20 UTC
(In reply to comment #1)
> POV comment: I don't like aligned table view as the default with basic system
> view at all. I'm more into output like that from iproute2 package with just
> indentation (to group information under one section).

That might be good for views with more information (although I think if we do that, you really have to put the labels inline with the data, like ip does, rather than just at the top like nmcli does now).

But a view where each item is a single row and the data is all aligned is easier to take in all at once, and easier to find things in. (As long as the information you want to find managed to make it into that view...)
Comment 3 Dan Winship 2013-05-02 15:59:53 UTC
NM bugzilla reorganization... sorry for the bug spam.
Comment 4 Jiri Klimes 2013-05-28 12:06:43 UTC
Enhancements for "nmcli dev wifi list" have been done in jklimes/nmcli-wifi-list branch.
It is based on global changes of output that ensure proper alignment and also save space, because real string lengths are used, not the maximal ones.
Comment 5 Jiri Klimes 2013-05-28 12:07:41 UTC
(In reply to comment #4)
> Enhancements for "nmcli dev wifi list" have been done in
> jklimes/nmcli-wifi-list branch.
> It is based on global changes of output that ensure proper alignment and also
> save space, because real string lengths are used, not the maximal ones.
That's bug 699503.
Comment 6 Jiri Klimes 2013-05-28 12:41:55 UTC
(In reply to comment #0)
> Obviously we want the SSID, and I guess that column's width is based on the
> maximum length of an SSID? We can save 2 characters by dropping the quotes
> though.
> 
I'm not sure why I introduced the quotes in the first place. Anyway, they are not
much useful, so I've removed them.
And added SSID-HEX for cases SSID uses non pritable characters (not in default). 

> I have never once in my life needed to know the BSSID of a router. I think we
> can remove that from the defaults.
> 
User might use it e.g. for locking to the BSSID in order to disable roaming when
they are problem with the roaming. And also to visually distinguish among APs when
there are many with the same SSID.
But I agree BSSID need not be displayed by default.

> The mode is good to know, but we don't need it fully spelled out. If we just
> showed "I" or "A" we'd save 13 characters. (Even "Infra" / "AdHoc" would save
> 9.)
> 
Used "Infra"; "I", "A" don't save much because we have "MODE" column anyway.

> The frequency is also useless to me; we should be showing that as the channel
> instead, which is both more user-comprehensible and 6 characters shorter.
> 
Added "CHAN" to defaults.

> Rate is semi-useful if you have multiple choices, but I feel like showing
> A/B/G/N instead would be just as good. (Is that true? Or are there often
> different rates in some of the types? Of the 22 networks I can see currently,
> all are "54 MB/s".
> 
I see sometimes different rates. For 80.2.1b APs there is 11 MB/s and some APs may
set different too.
It would be nice to show 802.1abgn... protocol. But we don't have A/B/G/N Wi-Fi
technology information available. We could probably guess it according
to rate and channels/frequencies. If we are going to do something like that, it would
be better to implement it in NM or libnm-utils.

> Signal is definitely important, but it's unclear what the numbers mean (other
> than high being good and low being bad)... We could use random unicode
> characters to build signal bars:  ▂___  ▂▄__  ▂▄▆_  ▂▄▆█ ? (Either in addition
> to or instead of the numbers.)
> 
A good idea. "BARS" added with the semi-graphical indication.
SIGNAL is 0 - 100 percent. We might add '%' sign? 

> I could go either way on the security column; years ago it was important to me
> to know exactly which encryption type a network was using because some devices
> didn't support WPA2, or WPA at all. But these days everything supports WPA2,
> and I'm not sure that seeing "WEP" vs "WPA WPA2" is really useful...
> 
I think it is useful to know whether the AP is open, WEP or WPA.
"Enterprise" changed to "802.1X"

> Active is important, but it only needs to be a single column with a "*" for the
> active network.
Added * (IN-USE) column with '*' for the active AP.

> 
> So...
> 
> * SSID                            MODE   CHAN   PROTO   SIGNAL     SECURITY
>   Blakes Upstairs                 Infr      6     G     35  ▂___   WPA WPA2
>   Belkin.58F8                     Infr      2     G     32  ▂___   WPA WPA2
>   DUTCHGUY                        Infr      6     G     22  ▂___   WPA2
> * netnet                          Infr      3     G     59  ▂▄▆_   WPA2
>   2WIRE260                        Infr      7     G     34  ▂___   WPA
>   ryu                             Infr      6     G     40  ▂▄__   WEP
>   CableWiFi                       Infr    149     N     27  ▂___   --
>   Cisco_2602D63A                  Infr    157     N     20  ▂___   WPA2
>   KyleForrest                     Infr      4     G     44  ▂▄__   WPA2
>   HOME-7EE2                       Infr      1     G     32  ▂___   WPA
>   EmeraldSycamore                 Infr      6     G     32  ▂___   WPA WPA2
>   EmeraldSycamore-guest           Infr      6     G     35  ▂___   --
>   Shallotte                       Infr      6     G     30  ▂___   WPA WPA2
>   WiFiRSU_87056                   Infr      8     G     20  ▂___   WPA2
>   Shallotte-guest                 Infr      6     G     25  ▂___   --
>   belkin.63e                      Infr      3     G     34  ▂___   WPA WPA2
>   Ground Control                  Infr     11     G     37  ▂___   WPA2
>   2WIRE141                        Infr     10     G     22  ▂___   WPA WPA2
>   xfinitywifi                     Infr      1     G     45  ▂▄__   --
>   HOME-8CC2                       Infr      1     G     25  ▂___   --
>   Blakes Upstairs                 Infr    157     N     20  ▂___   WPA WPA2
>   Shai-Hulud                      Infr      9     G     19  ▂___   WPA2
> 
> or something...

So, now we have something like this by default:
*  SSID              MODE   CHAN  RATE     SIGNAL  BARS  SECURITY 
   globalcom.cz_wpa  Infra  8     54 MB/s  20      ▂___  WPA WPA2 802.1X 
   N24PU1            Infra  7     11 MB/s  25      ▂___  --              
   Red Hat           Infra  6     54 MB/s  22      ▂___  WPA2 802.1X     
   Red Hat           Infra  1     54 MB/s  64      ▂▄▆_  WPA2 802.1X 
*  Red Hat Guest     Infra  11    54 MB/s  40      ▂▄__  WPA2        
   MARTINA           Infra  4     54 MB/s  30      ▂___  WEP
Comment 7 Dan Williams 2013-05-29 21:16:54 UTC
I'd change "WPA" -> "WPA1" just to be clear about it.

Also I could go either way on the BSSID.  I think we can leave it out for now, but we may want to add it back in later.

The rest looks good to  me.
Comment 8 Jiri Klimes 2013-05-30 08:32:19 UTC
(In reply to comment #7)
> I'd change "WPA" -> "WPA1" just to be clear about it.
Done.
Comment 9 Dan Winship 2013-05-30 12:14:28 UTC
looks great to me too. I can't decide if the "*" in the header row is confusing or not though... maybe it would be better to have that column just not have a title?
Comment 10 Jiri Klimes 2013-05-31 07:56:20 UTC
I left "*" in the header for now. It can be changed easily later, if we decide.

Pushed to master:
e8ee5bd cli: 'dev wifi list': change default displayed columns
dca3584 cli: 'dev wifi list': change SECURITY values
5f93c43 cli: 'dev wifi list': add IN-USE (*) field
e949365 cli: 'dev wifi list': 'Infrastructure' -> 'Infra', 'Unknown' -> 'N/A' in MODE
e339a25 cli: 'dev wifi list': add BARS column displaying signal semi-graphically
ac4c3f3 cli: 'dev wifi list': add CHAN column
28704d1 cli: 'dev wifi list' use nm_utils_ssid_to_utf8() to display SSID; add SSID-HEX