FlightAware Discussions

Force USB Wifi Over Internal WiFi

Is there a way to force PiAware to use an external USB WiFi dongle without disabling the internal WiFi adapter on the Raspberry Pi 4?

I am wanting to use a WiFi USB dongle with an external antenna to reach a remote router for internet access. I see the instructions for disabling the internal WiFi adapter (using rfkill set to yes) which causes wlan0 to be assigned to the WiFi USB dongle. That works fine - PiAware connects using the USB WiFi. However, I want to keep the internal WiFi enabled.

I tried assigning the internal adapter to wlan1 by creating a rules file in /etc/udev/rules.d/72-wlan-geo-dependent.rules. This worked in that it assigns the internal WiFi to wlan1, but when PiAware boots, there is no wlan0 even with the USB dongle plugged in.

It appears PiAware searches for a matching MAC address for the internal WiFi adapter, and if found, configures it and only it for WiFi regardless of what wlanx it is assigned to. Is there a way around this?

If you need unusual network setups (two live wifi connections counts as unusual) then the piaware sdcard image is not going to be sufficiently flexible for you; I’d suggest starting from a vanilla Raspbian image.

Thank you for the reply.

Poking around in fa_sysinfo.tcl, I see a line

			# if we have a Pi / broadcom wifi (probably the Pi 3 built-in wifi)
			# and also something else
			# then prefer the something else
			if {[string match -nocase b8:27:eb:* [interface_sysfs_value $interface address ""]] ||
				[string match -nocase dc:a6:32:* [interface_sysfs_value $interface address ""]]} {
				lappend candidates [list "2:$interface" $interface]
			} else {
				lappend candidates [list "1:$interface" $interface]

The comment line seems to indicate that if there is ‘something else’ meaning another WiFi adapter, that the ‘something else’ would be preferred. Is that not the case?

Correct, if there are multiple wireless interfaces visible that do not have rfkill set, then that code should prefer to select an interface that does not have a Broadcom / Pi Foundation OUI.

That’s not going to help if you’re entirely missing one of the wireless interfaces though.