Two Alfa AWUS036ACM WiFi USB Adapters crashing Raspberry Pi 4B

I have build OpenWrt router on Raspberry Pi 4B. Everything works great if I use only one USB WiFi Adapter, but if I plug in two (one as AP, 2nd as client) and run a speed test - the system crushes.

I know that Raspberry Pi is supposed to give 1.2A to share between 4 USB ports, but that is way above what is needed:

root@OpenWrt:~# lsusb -v | grep -e 'MaxPower' -e 'Bus [0-9]'
Bus 002 Device 003: ID 0e8d:7612 MediaTek Inc. Wireless
    MaxPower              400mA
Bus 001 Device 002: ID 2109:3431  USB2.0 Hub
    MaxPower              100mA
Bus 001 Device 001: ID 1d6b:0002 Linux 5.10.161 xhci-hcd xHCI Host Controller
    MaxPower                0mA
Bus 002 Device 002: ID 0e8d:7612 MediaTek Inc. Wireless
    MaxPower              400mA
Bus 002 Device 001: ID 1d6b:0003 Linux 5.10.161 xhci-hcd xHCI Host Controller
    MaxPower                0mA

There was this topic from last year that is now closed. Two Alfa USB Wifi Adapters on Raspberry Pi?
I added those lines in the /boot/config.txt
but there is no difference...

################################################################################
# Bootloader configuration - config.txt
################################################################################

################################################################################
# For overclocking and various other settings, see:
# https://www.raspberrypi.org/documentation/configuration/config-txt/README.md
################################################################################

# OpenWrt config
include distroconfig.txt

[all]
# Place your custom settings here.
max_usb_current=1
safe_mode_gpio=4
~

Any ideas what can I do next to troubleshoot it?

how do you know this ?

I've run the "lsusb -v | grep -e 'MaxPower' -e 'Bus [0-9]'" command to check what is the max power draw of the USB devices connected and we are getting 400mA per WiFi Dongle + 100mA registered for an internal USB2.0 Hub. That totals 0.9A, so we still have some headroom to reach 1.2A.

Get a powered USB hub and test through it. If it also crashes, then we are not talking about some power limit.

1 Like

It's a good idea. I've heard that some powered USB hubs are feeding the power back to the Pi.
I'd have to buy one, so if there are any steps we can take before I spend extra money, I'd like to do those first.

Get a USB flash drive with an x86_64 version of OpenWrt. Connect both the flash drive and the two Alfa cards to your laptop or desktop, if it has enough USB ports. See if it still crashes.

Not really comparable though, power availability wise.

1 Like

Correct, and that's why it has been proposed: if it still crashes, it is a software issue, not a power issue.

2 Likes

I don't have a laptop with 3 ports, but I can do it on my main workstation PC this weekend.

It works on x86_64.
I connected both USB adapters and loaded up a backup from Raspberry Pi, so the settings are the same.
Made multiple speed tests, moved 20GB of files on the LAN, and no crashes (on Raspberry Pi, I'm usually unable to finish one speed test and LAN file transfers fail after 200-300MB).

I've tested voltage on USB ports and I noticed that there are some drops. Very short drops, can't say for sure how low as my multimeter is not that quick, but I noticed that at idle it's 4.99-5.00V. When I start moving files it drops to around 4.96V and then there are some drops I registered 4.8V and 4.72V.

I've connected 4 capacitors in parallel. 470uF each. It seemed to help a little I was always able to finish at least one speedtest, but that is not a solution for when I want to transfer large amounts of data as it was still crashing.

Any ideas? I would really love to avoid the powered USB hub solution...

A few thoughts...

  1. Consider that this is partially related to the main power supply capacity -- a larger supply could potentially resolve the issue if the main supply itself is hitting its limit. However...
  2. This also has to do with the available power to be delivered to the USB ports. Beyond the power input, the Pi has a certain maximum power budget that it can deliver to the USB ports, and that is limited by the power circuitry that feeds those ports and/or the whole system (I'm not sure if maxing out the USB port power drags down the main power rails for the entire Pi or if there is a separate regulator for the ports). Once you hit that limit, you will brown-out the USB devices and/or the entire system.
  3. You'll need the powered USB hub (or some other means of externally powering the USB devices) if your USB devices are collectively drawing too much power... there's no way around this.
  4. Most USB wifi devices are not great performers. You would be much better served by using a dedicated wifi AP connected by ethernet (this is obviously not practical if your Pi is a travel router, but if it isn't being used for portable purposes, you should ditch the USB wifi adapters).
  5. If you're aiming for a travel router type config, there are actual travel routers that are purpose built for this use case with better radios and a more convenient form factor.
1 Like

I am aiming for travel router and those USB adapters are hugely better than the inbuild Wifi of Pi 4B.
Except for GL.iNet which many people have security concerns about. What other routers are purpose built with 2 good radios? Before I undertook this project I looked online and I haven't found anything excelt for GL.iNet. Can you give me any brands or models?

Yes, many usb adapters are better than the built in WiFi on a pi - that is a very low bar, though :rofl:

IMO, aside from the power issue, once you start using external usb WiFi adapted, the pi as a travel router becomes a bit ungainly and cumbersome.

There are many travel routers out there. The majority of the ones offered by gl-inet are officially supported by the openwrt project, and therefore you don’t have to worry about using the vendor firmware.

I personally use the TP-Link TL-WR902AC which is perfectly adequate for travel purposes (including a vpn road warrior config).

I don't know. With these WiFi USB adapters I'm getting 480Mbps up and down, so I'm not sure how much more I want from a travel router...

The Pi + 2 USB adapters is pretty much the same size as the TP-Link TL-WR902AC. You just have the antennas sticking out.

I have a few more ideas to tackle this. I will report back in case someone in the future will have similar problems.

You can always try Alfa AWUS036ACM plus some other, less power-hungry, adapter. Or even question yourself whether you really need two adapters. Once I transfer everything from the old phone to the new one, there will be no devices that need 2.4 GHz in my home, and therefore no need to keep the 2.4 GHz AP, especially given that the band is overcrowded. Maybe the same applies to you?

The WR902AC is ~65mm x 75mm x 22mm, all in.
The Pi is ~65mm x 95mm x 35mm (in the standard Canakit case), but that doesn't include the USB adapters you're using.

So it's not a huge difference, but the WR902AC is clearly smaller. The Pi is probably significantly higher performance, though. But I think it depends on your needs and expectations for a travel router (and more often than not, the upstream connection when at a cafe or hotel is the limiting factor).

I think GL routers with vanilla OpenWrt should be good enough to eliminate the security concern? (I have the Beryl which is flashed to vanilla one already and works great under 22.03.3)

I bought this hub and it won't back feed power to my Pi4, and it uses USB-C as power supply so you can have a multi port USB power for both Pi4 + Hub.

What are the speeds on AC in Wireless-Wireless birdge?