FrameworkComputer / linux-docs

Linux Markdown Guides
134 stars 26 forks source link

The WiFi diagnostic does not work if there is another operational network interface #41

Open jeffsilverm opened 1 month ago

jeffsilverm commented 1 month ago

My WiFi controller is dead. I am fairly confident that this is so: jeffs@frmwrk16:~/nbmdt$ ip --stats link show dev wlp1s0 3: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DORMANT group default qlen 1000 link/ether fc:b0:de:18:10:61 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped missed mcast 0 0 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 jeffs@frmwrk16:~/nbmdt$ Framework customer suggested I run the WiFi diagnostic tool to see what happens. Why not? Nothing else I've tried has fixed or even identified the problem. So I ran it.

Integrated Wi-Fi Diagnostic Script

Starting Wi-Fi Diagnostics...
Performing ping test to 8.8.8.8...
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=71.1 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=70.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=55 time=70.6 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=55 time=70.2 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 70.224/70.575/71.068/0.309 ms

System Information:
Operating System: Ubuntu 24.04.1 LTS
Kernel Version: 6.8.0-44-generic
CPU: AMD Ryzen 9 7940HS w/ Radeon 780M Graphics
Total RAM: 30Gi
Last System Update: Oct 1 00:00
Wi-Fi Card installed: 01:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter
Wi-Fi Interface Information:
Interface: wlp1s0
Interface wlp1s0
    ifindex 3
    wdev 0x1
    addr fc:b0:de:18:10:61
    type managed
    wiphy 0
    txpower 3.00 dBm
    multicast TXQ:
        qsz-byt qsz-pkt flows   drops   marks   overlmt hashcol tx-bytes    tx-packets
        0   0   0   0   0   0   0   0       0
Not connected.
Power save: on

VPN (tun0) detected: Active (OpenVPN)
Network Speed Test:
Running speed test, please wait... (Note: The test may appear to hang at 98% for a few minutes. This is normal - wait patiently.)
[================================================= ] 98%
Ping: 87.201 ms                                                                                                                                                                    
Download: 73.97 Mbit/s
Upload: 65.07 Mbit/s

Checking network status with nmcli...
DEVICE           TYPE      STATE                   CONNECTION         
enx00e04c160379  ethernet  connected               Wired connection 1 
lo               loopback  connected (externally)  lo                 
tun0             tun       connected (externally)  tun0               
wlp1s0           wifi      disconnected            --                 
p2p-dev-wlp1s0   wifi-p2p  disconnected            --                 
IN-USE  BSSID  SSID  MODE  CHAN  RATE  SIGNAL  BARS  SECURITY 
No active Wi-Fi connection detected or speed not available.
Monitoring Wi-Fi signal and quality with nmcli...
No active Wi-Fi connection found.

Wi-Fi Diagnostic Summary
========================
Wi-Fi Interface:
- wlp1s0
Speed Test Results:
- Ping: 87.201 ms
- Download: 73.97 Mbps
- Upload: 65.07 Mbps
Network Environment
====================
- SSID: 
- Signal Strength:  dBm
- Signal level: N/A%
- Frequency:  MHz
- Power save: on
- VPN Active: Yes
- VPN Type: OpenVPN (tun0)

INSIGHTS
========
System Information:
- Your system specifications are important for Wi-Fi performance. A recent kernel version often includes the latest Wi-Fi drivers and features.
Wi-Fi Interface:
- Connected to network: 
(standard_in) 1: syntax error
Wifi-Diagnostic.sh: line 401: [: : integer expression expected
(standard_in) 1: syntax error
Wifi-Diagnostic.sh: line 403: [: : integer expression expected
(standard_in) 1: syntax error
Wifi-Diagnostic.sh: line 405: [: : integer expression expected
- Unknown frequency band. Characteristics are unknown.
(standard_in) 1: syntax error
Wifi-Diagnostic.sh: line 412: [: : integer expression expected
(standard_in) 1: syntax error
Wifi-Diagnostic.sh: line 414: [: : integer expression expected
(standard_in) 1: syntax error
Wifi-Diagnostic.sh: line 416: [: : integer expression expected
- Poor signal strength. Consider moving closer to your router or checking for obstacles.
(standard_in) 1: syntax error
Wifi-Diagnostic.sh: line 423: [: : integer expression expected
- Lower transmission rate. You might experience slowdowns with high-bandwidth activities.
Speed Test:
- Higher ping time. You might experience lag in real-time applications.
- Good download speed. Suitable for most online activities and HD streaming. Note: Speed test results should be compared to other services such as Fast.com and Google Speed Test if the results feel wrong.
- Good upload speed. Suitable for video calls, uploading large files, and online backups.
Network Environment:
- Power save mode is on. This may improve battery life but could potentially impact Wi-Fi performance.

VPN Status:
- A VPN (OpenVPN) is active on interface tun0. This may impact your internet speed and latency, but provides increased privacy and security.
- OpenVPN is known for its strong security features but may have slightly higher overhead compared to WireGuard.

Wi-Fi Diagnostics completed. For a full diagnostic report, check the log file at /home/jeffs/wifi_diagnosis.log
jeffs@frmwrk16:~/nbmdt$ 

I thought that maybe the pings and other things were going in and out the ethernet. Since my WiFi is dead, I have a kludged an Ethernet connection. So I pulled the plug on the USB and tried again.

jeffs@frmwrk16:~/nbmdt$ bash Wifi-Diagnostic.sh
Integrated Wi-Fi Diagnostic Script
---------------------------------

Starting Wi-Fi Diagnostics...
Performing ping test to 8.8.8.8...
ping: connect: Network is unreachable

No network detected. Exiting.
rfkill Status:
0: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
Final Recommendations
=====================
rfkill status explanation:
- Wi-Fi is not blocked by rfkill. The issue might be related to drivers or hardware.
- After addressing these issues, rerun the script to perform a full diagnosis.

jeffs@frmwrk16:~/nbmdt$ 

Please do not feel bad about this. I am working on a network boot monitor and diagnostic tool (https://github.com/jeffsilverm/nbmdt) (except I haven't made a commit in 5 years) and it would have the same flaw that your scripts have. So this has been a teachable moment for me. Thank you from the bottom of my heart.

The solution for the ping command is to use the -I option to the ping command. For the other tests, verify that the WiFi interface is working, and then and only then disable the other interface(s). Use the trap bash command to catch any errors and enable the other interface(s).

ctsdownloads commented 3 weeks ago

Ah ha! I was bound to miss a use case scenario. Appreciate it. Confirming, there are two network interfaces on this unit? You title "The WiFi diagnostic does not work if there is another operational network interface" indicated there may be? Ethernet? I can adapt the script accordingly, but just wanted to clarify.

Appreciate it. :)

jeffsilverm commented 3 weeks ago

Don't feel bad. I'll bet that it never occurred to the guys who designed the 737 MAX that the angle of attack sensors would fail. That oversight led to the deaths of 384 people. Funny, sometimes, how the real world breaks our software.

In my case, the WiFi is broken. I have a USB to Ethernet adapter that looks like an Ethernet and that is working. The WiFi looks like a WiFi in a place where is no WiFi, none at all. It thinks it's working, but it isn't. So it depends on your definition of "operational". The WiFi think it is working, but because the RF side is broken, it isn't/

One way to test the WiFi is to run the iw dev wlp2s0 scan | fgrep SSID: command. If it sees 2 or more SSIDs, then the WiFi is probably working. Similarly, if the ip --stats link list command shows that the counters are incrementing in, say, 10 seconds, then the Ethernet is probably good. The ip link list command will also tell you if the NIC sees a carrier.

I hope this answers your question. I'd love to beta test it for you.

Jeff

On Thu, Oct 31, 2024 at 6:26 PM Matt Hartley @.***> wrote:

Ah ha! I was bound to miss a use case scenario. Appreciate it. Confirming, there are two network interfaces on this unit? You title "The WiFi diagnostic does not work if there is another operational network interface" indicated there may be? Ethernet? I can adapt the script accordingly, but just wanted to clarify.

Appreciate it. :)

— Reply to this email directly, view it on GitHub https://github.com/FrameworkComputer/linux-docs/issues/41#issuecomment-2451122023, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGDBYRZD3H5SPA4XG2L7DZ6LKEZAVCNFSM6AAAAABQIKVT76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRGEZDEMBSGM . You are receiving this because you authored the thread.Message ID: @.***>

ctsdownloads commented 1 week ago

Have not forgotten about this, but it may be a bit before I can circle back to this. Just updating I have not forgotten.

jeffsilverm commented 1 week ago

No worries, thanks for the update!

Jeff

On Tue, Nov 12, 2024 at 5:59 PM Matt Hartley @.***> wrote:

Have not forgotten about this, but it may be a bit before I can circle back to this. Just updating I have not forgotten.

— Reply to this email directly, view it on GitHub https://github.com/FrameworkComputer/linux-docs/issues/41#issuecomment-2472167163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGDBZOU374ZLKS4RRXZKL2AKW6VAVCNFSM6AAAAABQIKVT76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZSGE3DOMJWGM . You are receiving this because you authored the thread.Message ID: @.***>