jrgp / linfo

Linfo PHP Server Health Status
MIT License
361 stars 73 forks source link

Wifi interfaces are show as Ethernet #123

Closed Saentist closed 2 years ago

Saentist commented 2 years ago

Wifi card show as Ethernet image

jrgp commented 2 years ago

Interesting. I wonder how we can fix this.

Saentist commented 2 years ago

Guess result ot iwconfig can help.

https://www.cyberciti.biz/faq/linux-list-network-cards-command/ https://www.2daygeek.com/linux-find-out-wireless-network-wifi-speed-signal-strength-quality/

SudosFTW commented 2 years ago

A dirty way to do it would be an if-then of "if interface name starts with W, then define as Wireless instead of Ethernet." As, to my knowledge, most distros using both old style and predictable naming will still set a wireless interface name with a wl* at the front, be it wl(macaddresshere) or wl(port here) or wlan0, wlan1 etc.

Dropping it down to just w lets it reach over a broader scope past that, but wl might be safer.

Saentist commented 2 years ago

This cannot be practical because lot of modern OS decide to name interface by port irq etc. not as in old time eth0-x wlan0-x Now inserting new adapter chang name of lan interfaces

$iwconfig
lo        no wireless extensions.

enp2s0    no wireless extensions.

wlp1s0f0  IEEE 802.11  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry short  long limit:2   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
jrgp commented 2 years ago

Ideally there is a file within /sys we can use to distinguish WiFi devices from Ethernet devices. (I haven't checked yet)

Going off of the Nic names alone is risky as they can be arbitrarily set.

Saentist commented 2 years ago

image

Isn't Bluetooth devices must be show also be in this section?

jrgp commented 2 years ago

I'm not sure. Is your computer currently using network over Bluetooth?

When connecting a Linux machine to the network using Bluetooth tethering, I'm not sure what the network devices then look like.

If a Bluetooth dongle is present but not being used to connect to a network, I don't think it will appear as a network device.

Gemorroj commented 2 years ago

@jrgp https://github.com/jrgp/linfo/blob/2f6ff8401df687f1dd21481dd7147425e66ac952/src/Linfo/OS/Linux.php#L986-L988 now we can delete this

Saentist commented 2 years ago

I'm not sure. Is your computer currently using network over Bluetooth?

When connecting a Linux machine to the network using Bluetooth tethering, I'm not sure what the network devices then look like.

If a Bluetooth dongle is present but not being used to connect to a network, I don't think it will appear as a network device.

I use bluetooth to collect data from bluetooth sensors to Home assistant.

jrgp commented 2 years ago

@jrgp

https://github.com/jrgp/linfo/blob/2f6ff8401df687f1dd21481dd7147425e66ac952/src/Linfo/OS/Linux.php#L986-L988

now we can delete this

Deleted

I'm not sure. Is your computer currently using network over Bluetooth? When connecting a Linux machine to the network using Bluetooth tethering, I'm not sure what the network devices then look like. If a Bluetooth dongle is present but not being used to connect to a network, I don't think it will appear as a network device.

I use bluetooth to collect data from bluetooth sensors to Home assistant.

I'm not sure how this should be shown within Linfo as I'm unsure if those become network interfaces.