mr-canoehead / network_performance_monitor

Network Performance Monitor - a portable tool for troubleshooting performance issues with home networks
GNU General Public License v3.0
84 stars 21 forks source link

Issue with TP-Link Archer T3U Dual WiFi Adapter #15

Closed christasich closed 4 years ago

christasich commented 4 years ago

I recently purchased TP-Link Archer T3U Dual WiFi Adapter to set up 2.4GHz monitoring on my network. I'm using the RPi4 internal antenna to monitor the 5GHz channel. I had to install drivers for the adapter (per this guide), but I was able to connect it to my network. I reran the configuration per the wiki. After bringing the system back online, I tried manually issuing a network test and received this error.

/usr/bin/python /home/pi/network_performance_monitor/netperf/netperf/test_network.py isp
Traceback (most recent call last):
  File "/home/pi/network_performance_monitor/netperf/netperf/test_network.py", line 322, in <module>
    ping_results = pingtest(test_exec_namespace,"8.8.8.8",dbq)
  File "/home/pi/network_performance_monitor/netperf/netperf/test_network.py", line 43, in pingtest
    avg = ping_stats[1]
IndexError: list index out of range

After some debugging, I determined the issue was assigning an IPv4 to the interface which caused the configure_interfaces.py script to fail on startup. Hence, no interfaces to test. When I manually run configure_interfaces.py, I get this error.

ERROR: Unble to assign IPv4 address for interface wlx98482735bed7

I've tried the configuration in a number of different ways including changing the USB port, making it the only wlan interfaces, changing the assigned IP, etc. All signs point to an issue with the adapter. Also, the adapter does not support network namespaces and was assigned to "root". I'm unsure why it's having trouble grabbing an IP. When it's not part of the configuration for this project, I see it on my network at an IP assigned by my DHCP. Any advice? For context, here is the non-working interfaces.json

{
        "configure_interfaces" : true,
        "test_exec_namespace" : "ns_eth0",
        "interfaces" : {
                "wlan0" : {
                        "type" : "wireless",
                        "wpa_supplicant_config" : "/etc/wpa_supplicant/wlan0.conf",
                        "ipv4_addr" : "192.168.86.3",
                        "ipv4_gw" : "192.168.86.1",
                        "namespace" : "ns_wlan0",
                        "alias" : "if_5GHz"
                },
                "wlx98482735bed7" : {
                        "type" : "wireless",
                        "wpa_supplicant_config" : "/etc/wpa_supplicant/wlx98482735bed7.conf",
                        "ipv4_addr" : "192.168.86.6",
                        "ipv4_gw" : "192.168.86.1",
                        "namespace" : "root",
                        "alias" : "if_2.4GHz"
                },
                "eth0" : {
                        "type" : "ethernet",
                        "ipv4_addr" : "192.168.86.2",
                        "ipv4_gw" : "192.168.86.1",
                        "namespace" : "ns_eth0",
                        "alias" : "if_lan"
                }
        },
        "bandwidth_monitor_bridge" : {
                "configure" : true,
                "namespace" : "bwmonitor",
                "bridge_name" : "bwmonitor",
                "modem_interface" : "enx00e04c01007e",
                "router_interface" : "enx00e04c0009ae"
        }
}

And the working one...

{
        "configure_interfaces" : true,
        "test_exec_namespace" : "root",
        "interfaces" : {
                "wlan0" : {
                        "type" : "wireless",
                        "wpa_supplicant_config" : "/etc/wpa_supplicant/wlan0.conf",
                        "ipv4_addr" : "192.168.86.3",
                        "ipv4_gw" : "192.168.86.1",
                        "namespace" : "ns_wlan0",
                        "alias" : "if_5GHz"
                },
                "eth0" : {
                        "type" : "ethernet",
                        "ipv4_addr" : "192.168.86.2",
                        "ipv4_gw" : "192.168.86.1",
                        "namespace" : "root",
                        "alias" : "if_lan"
                }
        },
        "bandwidth_monitor_bridge" : {
                "configure" : true,
                "namespace" : "bwmonitor",
                "bridge_name" : "bwmonitor",
                "modem_interface" : "enx00e04c01007e",
                "router_interface" : "enx00e04c0009ae"
        }
}

Also, a couple of follow-up questions...

  1. If the device is just incompatible, can you point me in the direction of a known compatible device? I see you used a D-Link. What model works for you?
  2. Do I need a USB 3.0 hub to connect the device to one of the USB 3.0 ports or is using one of the two USB 2.0 ports sufficient? I'm unsure what the bottleneck would be in this case.
mr-canoehead commented 4 years ago

One thought I have is that you may be experiencing USB power issues; Raspberry Pis have a low limit for the amount of power that can be delivered to USB devices (1.2A for all devices combined). I experienced USB power issues when I started using a Vantec dual gigabit ethernet adapter for the bandwidth monitoring bridge (it consumes a lot of power). I could not reliably get all USB interfaces working at the same time. After changing the configuration so that all USB devices were connected via an externally powered USB 3 hub I had no further issues.

I am using a D-Link DWA-182 for monitoring the 5GHz network, the internal WiFi adapter is monitoring the 2.4GHz network. I used the D-Link because I happened to have one when I started this project. Unfortunately I hesitate to recommend any D-Link products since the company has a history of changing chipsets between versions of the same product, so a DWA-182 adapter with a different version number may not work at all. I had to build the driver from a GitHub repository since the adapter is not supported by D-Link for Linux devices. It took several attempts to find a repository with a driver that worked.

I have not had anyone submit info about other dual band adapters, so I can't suggest any others to try at this time.

Here's my current interfaces.json config, the if_5GHz interface is the D-Link adapter. It's in the root network namespace since its driver doesn't support the set_wiphy_netns command.

{
        "configure_interfaces" : true,
        "test_exec_namespace" : "ns_eth0",
        "interfaces" : {
                "wlan0" : {
                        "type" : "wireless",
                        "wpa_supplicant_config" : "/etc/wpa_supplicant/wlan0.conf",
                        "ipv4_addr" : "10.1.2.111",
                        "ipv4_gw" : "10.1.2.1",
                        "namespace" : "ns_wlan0",
                        "alias" : "if_2.4GHz"
                },
                "wlxf48ceb9b7044" : {
                        "type" : "wireless",
                        "wpa_supplicant_config" : "/etc/wpa_supplicant/wlxf48ceb9b7044.conf",
                        "ipv4_addr" : "10.1.2.112",
                        "ipv4_gw" : "10.1.2.1",
                        "namespace" : "root",
                        "alias" : "if_5GHz"
                },
                "eth0" : {
                        "type" : "ethernet",
                        "ipv4_addr" : "10.1.2.110",
                        "ipv4_gw" : "10.1.2.1",
                        "namespace" : "ns_eth0",
                        "alias" : "if_lan"
                }
        },
        "bandwidth_monitor_bridge" : {
                "configure" : true,
                "namespace" : "bwmonitor",
                "bridge_name" : "bwmonitor",
                "modem_interface" : "enx000acd28f63a",
                "router_interface" : "enx000acd28f639"
        }
}
christasich commented 4 years ago

I'm trying to get ahold of a powered USB hub so I can test this. I don't currently have one at my disposal. I'll update when I can!

christasich commented 4 years ago

I never found the time to track down a USB hub and was at the end of the return window for the WiFi antenna. I went ahead and returned it. Still, the pi was able to power the device just fine when it wasn't connected as part of the monitoring system, so I'm not sure it was a power issue. I know low power can manifest in odd ways, though, so I can't really rule that out as a possibility. Sorry I couldn't debug anymore!