1

I have an RPi Zero W, on which I want to use a Wifi dongle to have better reception.

I can see my dongle, the drivers are recognized and I can scan with it, but Raspbian (stretch) seems to stick to the embedded wifi to setup the connection:

lo        no wireless extensions.

usbwlan   unassociated  Nickname:"rtl_wifi"
          Mode:Auto  Access Point: Not-Associated   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

usb0      no wireless extensions.

wlan1     IEEE 802.11  ESSID:"myNetwork"
          Mode:Managed  Frequency:2.437 GHz  Access Point: xx:yy:DA:A1:3A:60
          Bit Rate=72.2 Mb/s   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=49/70  Signal level=-61 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

(note that I have setup udev to name the device "usbwlan" regardless of the predictable network names).

How can I do that ? Should I fiddle with dhcpcd or wpa_supplicant?

Gui13
  • 103
  • 7
  • Dhcpcd controls wpa_supplicant so you only need to configure dhcpcd -- see `allowinterfaces` and `denyinterfaces` in `man dhcpcd.conf`. Dunno if there's a way to provide a preference ordered list, but there's a lot of stuff in that man page./ – goldilocks Nov 20 '20 at 19:34

2 Answers2

1

If you want to completely replace the onboard WiFi with the dongle, you can disable it. Hardware devices are managed by overlays on the Raspberry Pi OS. In /boot/overlays/README you will find:

Name:   disable-wifi
Info:   Disable onboard WiFi on Pi 3B, 3B+, 3A+, 4B and Zero W.
Load:   dtoverlay=disable-wifi
Params: <None>

So just add

dtoverlay=disable-wifi

to the file /boot/config.txt and reboot. Then you only have the WiFi dongle available. It should also get the name that was given to the onboard WiFi.

Ingo
  • 40,606
  • 15
  • 76
  • 189
0

Depends what you mean by "prefer".

Advanced dhcpcd Configuration in How to set up networking/WiFi describes how to use different wpa_supplicant files for each, how to disable etc.

Milliways
  • 54,718
  • 26
  • 92
  • 182