Skip to content

Dual‐Radio WiFi Setup

sonoaltercocker edited this page Nov 3, 2026 · 4 revisions

DigiPi Dual-Radio (wlan0 and wlan1) Wi-Fi Setup

Nov 2, 2026

Scott Sheppard (ssheppa9@bellsouth.net)

With editing and formatting by Claude (claude.ai)

This document is published on the wiki in Markdown (.md) format.

Overview

The onboard Wi-Fi on a Raspberry Pi 3B+ has a very limited transmit range (low power). If you need to edit DigiPi configurations in the field, better Wi-Fi range makes it much easier to reach the Raspberry Pi and, with it, the DigiPi functions.

When connected to the "DigiPi" SSID, the device is on the 10.0.0.0/24 network, and that is fine for most things. However, loading other applications from the web, running apt update and apt upgrade, or installing tools like WeeWX requires internet access. To do that, the DigiPi must also be connected to a local (i.e. "home") network that is not on the 10 network, because the 10 network can't route to the internet. Switching between the DigiPi SSID and your home network is a hassle: you have to access the DigiPi interface, change the Wi-Fi SSID, and reboot every time. This proposed solution gives you BOTH the DigiPi SSID and a "home" (non-10 network) SSID, and thus public routing. When the DigiPi system is deployed in the field, it simply won't find your defined "home" network, and the DigiPi SSID keeps working.

The following instructions were run on a Macintosh computer. The same basic approach can be achieved using Microsoft Windows 11 PowerShell commands (not tested, but included as Appendix A).

The USB AX3000 adapter with the MIMO puck runs the DigiPi hotspot, and the onboard Wi-Fi stays on the "home" network. At home both run at once; in the field, home Wi-Fi is simply absent and the hotspot keeps running. In this guide, "home" means any Wi-Fi network other than the DigiPi SSID (not on 10.0.0.0/24), such as your house router; it gives the Pi internet access.

Radio Interface Driver Role
Onboard Pi 3B+ Wi-Fi wlan0 brcmfmac Client on home Wi-Fi (address assigned by your router; reach it as digipi.local) for SSH and internet
USB AX3000 adapter + ANT-132-S02 puck wlan1 mt7921u (MediaTek MT7921AU, USB ID 0e8d:7961) DigiPi hotspot, 10.0.0.5/24, 2.4 GHz, serves the weather network (GW1200 at 10.0.0.6)

Tested on a Raspberry Pi 3B+ running the DigiPi project image v2.2-1 by KM6LYW, on Raspberry Pi OS Trixie. The image file is too large to attach to this document; get it from the DigiPi project (see the DigiPi Google Group).

Important DigiPi rules (read first)

  1. The SD card is read-only. Run sudo remount before changing anything, and sudo reboot when finished to return to read-only. Do not leave it writable across a power loss.
  2. Do not use nmcli connection modify on DigiPi. NetworkManager starts while the card is read-only and keeps that view even after sudo remount, so nmcli modify fails with "Read-only file system". Edit the .nmconnection files directly with sudo sed, then run sudo nmcli connection reload.
  3. Use sudo to read NetworkManager files. /etc/NetworkManager/system-connections/ and /var/lib/NetworkManager/ are root-only. Wildcards such as sudo ls /var/lib/NetworkManager/dnsmasq-* fail because your shell expands the * before sudo runs; list the folder instead with sudo ls -l /var/lib/NetworkManager/.
  4. Do not add dtoverlay=disable-wifi. The onboard radio is needed for the home network.

Before you start: SSH setup (Mac)

Do this first, while the computer and the Pi are both on the DigiPi network (10.0.0.0/24), so ssh digipi-field works for every step that follows. Windows users: see Appendix A.3–A.6 instead.

Without IdentitiesOnly, the Mac offers every key it has and the Pi disconnects with "Too many authentication failures". Keys live in ~/.ssh/keys/.

Add these entries to ~/.ssh/config, above any Host * section. If the file doesn't already start with AddKeysToAgent yes and UseKeychain yes, add those two lines at the top so macOS remembers the key's passphrase.

Host digipi-home
    HostName digipi.local
    User pi
    IdentityFile ~/.ssh/keys/id_digipi
    IdentitiesOnly yes

Host digipi-field 10.0.0.5
    HostName 10.0.0.5
    User pi
    IdentityFile ~/.ssh/keys/id_digipi
    IdentitiesOnly yes

digipi-home reaches the Pi by name (digipi.local) on your home network, whatever address your router hands it, so you don't need to know its IP. If .local names don't resolve on your computer or network, replace digipi.local with the Pi's home IP address: run hostname -I on the Pi while it's on your home network. A DHCP reservation for the Pi's onboard MAC in your router keeps that address from changing.

  • On the DigiPi network: ssh digipi-field
  • On the home network: ssh digipi-home

Installing the key on a fresh Pi. If SSH offers the key but still asks for a password, the Pi doesn't have the key, which is common after a rebuild. Check with:

ssh -v digipi-home exit 2>&1 | grep -iE "offering|accepted|denied"

To install the key, run sudo remount on the Pi, then on the Mac:

ssh-copy-id -i ~/.ssh/keys/id_digipi.pub digipi-field
ssh digipi-field          # should log in without a password

Then run sudo reboot on the Pi. One install covers both host entries, since it's the same Pi.

0. Hardware

  1. Connect the puck's RP-SMA lead(s) to the USB adapter. Use both leads if the adapter has two antenna ports (2×2 MIMO). Ultra Low Profile Indoor/Outdoor Omni Directional MIMO WiFi Antenna - Dual Band/Triple Band 2.4/5.8/6 GHz WiFi Puck - Through Hole Screw Mount - 3 ft Coax Lead w/RP-SMA (ANT-132-S02) (Amazon)
  2. Plug the adapter into a Pi USB port. It can draw significant current when transmitting, so use a solid 5 V / 2.5 A supply or a powered USB hub; budget an extra 2–3 W on battery/solar systems. EDUP® USB 3.0 WiFi 6E Adapter for PC, AX3000M, Mt7921au, 802.11ax (Amazon)
  3. Mount the puck high and clear of metal. Placement matters as much as gain.

1. Connect, make writable, back up

Starting point: the Pi is running DigiPi's default hotspot (SSID "DigiPi") on its onboard radio, so both the Mac and the Pi are on the DigiPi 10.0.0.0/24 network. The home network isn't set up on the Pi yet; that happens in step 6. On the Mac, join the DigiPi network, then SSH to the Pi at 10.0.0.5 with ssh digipi-field (set up in "Before you start").

On the Pi:

sudo remount
sudo tar czf /tmp/net-backup-$(date +%F).tar.gz /etc/NetworkManager/system-connections /boot/firmware/config.txt /etc/rc.local /etc/chrony

In a second Terminal window on the Mac:

scp 'digipi-field:/tmp/net-backup-*.tar.gz' ~/
ls -l ~/net-backup-*.tar.gz

2. Identify the radios and record MAC addresses

lsusb | grep -i 0e8d
for i in wlan0 wlan1; do echo "$i  $(basename $(readlink /sys/class/net/$i/device/driver))  $(cat /sys/class/net/$i/address)"; done
iw list | grep -E "^Wiphy|^[[:space:]]+\* AP$"

Expected:

  • lsusb shows 0e8d:7961 MediaTek Inc.
  • The interface whose driver is brcmfmac is the onboard radio (normally wlan0; on a Pi 3B+ its MAC starts with b8:27:eb). The interface whose driver is mt7921u is the USB adapter (normally wlan1).
  • Both phys list * AP

Record both MACs in uppercase. Type these two lines at the prompt with your real values; later commands use them. If you log out, set them again.

ONBOARD_MAC=B8:27:EB:xx:xx:xx    # brcmfmac radio
USB_MAC=90:DE:80:xx:xx:xx        # mt7921u adapter

3. Set the Wi-Fi country

The default "world" domain (country 00) limits power and channels.

sudo raspi-config nonint do_wifi_country US
sudo iw reg set US
iw reg get | head -3

Expected: country US: DFS-FCC.

4. Lease file in RAM for the hotspot on wlan1

DigiPi already redirects the wlan0 lease file to /run (RAM). Add the same for wlan1, because NetworkManager's dnsmasq can't write to the read-only card.

sudo ln -sf /run/dnsmasq-wlan1.leases /var/lib/NetworkManager/dnsmasq-wlan1.leases
sudo touch /run/dnsmasq-wlan1.leases
sudo sed -i 's|^  touch /run/dnsmasq-wlan0.leases$|&\n  touch /run/dnsmasq-wlan1.leases|' /etc/rc.local
grep -n "dnsmasq-wlan" /etc/rc.local
sudo ls -l /var/lib/NetworkManager/

Expected:

  • rc.local shows both touch /run/dnsmasq-wlan0.leases and touch /run/dnsmasq-wlan1.leases
  • Both dnsmasq-wlan0.leases and dnsmasq-wlan1.leases are symlinks to /run/...

If the wlan0 symlink or touch line is missing on your image, create it the same way. As a reminder, these commands do that; the last line adds any missing touch line just before exit 0 in rc.local:

sudo ln -sf /run/dnsmasq-wlan0.leases /var/lib/NetworkManager/dnsmasq-wlan0.leases
sudo touch /run/dnsmasq-wlan0.leases
for i in wlan0 wlan1; do grep -q "touch /run/dnsmasq-$i.leases" /etc/rc.local || sudo sed -i "/^exit 0/i touch /run/dnsmasq-$i.leases" /etc/rc.local; done
grep -n "dnsmasq-wlan" /etc/rc.local

5. Move the hotspot to the USB adapter

The stock DigiPi hotspot profile is tied to wlan0 and has autoconnect=false (DigiPi's autohotspot.service normally starts it). Tie it to the USB adapter's MAC and let NetworkManager start it at every boot.

F=/etc/NetworkManager/system-connections/hotspot.nmconnection
sudo sed -i '/^interface-name=/d' $F
sudo sed -i '/^mac-address=/d' $F
sudo sed -i "/^\[wifi\]\$/a mac-address=$USB_MAC" $F
sudo sed -i 's/^autoconnect=false$/autoconnect=true/' $F
sudo sed 's/^psk=.*/psk=xxxx/' $F

Check the printed file (password masked):

  • No interface-name= line
  • [wifi] contains mac-address=<USB_MAC>, band=bg, mode=ap, ssid=DigiPi
  • autoconnect=true
  • [ipv4] has address1=10.0.0.5/24 and method=shared

band=bg (2.4 GHz) is required for this build: the Ecowitt GW1200 is part of the Sheppard DigiPi weather station and is 2.4 GHz only. If you aren't using an Ecowitt gateway, ignore that reference, but keep band=bg anyway: 2.4 GHz gives the best range and works with every phone, tablet and laptop.

Change the hotspot password if it is still the default or a weak one:

sudo sed -i 's|^psk=.*|psk=NEW-HOTSPOT-PASSWORD|' $F

6. Set up the home Wi-Fi client on the onboard radio

The DigiPi image ships with two Wi-Fi profiles. hotspot.nmconnection is the built-in "DigiPi" access point (step 5). wlan0.nmconnection is a separate client profile for joining a home network, and on a stock image its ssid= line is empty because the image can't know your home network. NetworkManager silently ignores a profile with an empty SSID, so wlan0 won't appear in nmcli connection show until you fill it in below.

W=/etc/NetworkManager/system-connections/wlan0.nmconnection
sudo sed 's/^psk=.*/psk=xxxx/' $W | cat -A

Look for an empty ssid= or psk=, and for ^M at line ends (Windows line endings; remove with sudo sed -i 's/\r$//' $W).

Fix it and pin it to the onboard radio. Replace the SSID and password with yours and keep the single quotes:

sudo sed -i 's|^ssid=.*|ssid=YOUR-HOME-SSID|' $W
sudo sed -i 's|^psk=.*|psk=YOUR-HOME-PASSWORD|' $W
sudo sed -i '/^interface-name=/d' $W
sudo sed -i '/^mac-address=/d' $W
sudo sed -i "/^\[wifi\]\$/a mac-address=$ONBOARD_MAC" $W
sudo sed 's/^psk=.*/psk=xxxx/' $W

If the SSID or password contains |, & or \, put a \ before each of those characters in the command.

If the file doesn't exist at all, create it with sudo nano $W, then run sudo chmod 600 $W. A uuid= line is optional; NetworkManager generates one if absent.

[connection]
id=wlan0
type=wifi
autoconnect=true
autoconnect-retries=0

[wifi]
mac-address=B8:27:EB:xx:xx:xx
mode=infrastructure
ssid=YOUR-HOME-SSID

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=YOUR-HOME-PASSWORD

[ipv4]
method=auto

[ipv6]
method=auto

The mac-address= value is the onboard radio's MAC that you recorded in step 2 as ONBOARD_MAC (the brcmfmac interface). Type the actual address here: nano doesn't fill in $ONBOARD_MAC, so replace xx:xx:xx with the last three pairs of your MAC, in uppercase (for example B8:27:EB:67:C1:3D).

7. Reload and check before rebooting

sudo chmod 600 /etc/NetworkManager/system-connections/*.nmconnection
sudo nmcli connection reload
nmcli connection show

Expected: both hotspot and wlan0 are listed. Until the reboot, the hotspot still runs on the onboard radio and wlan0 shows no device. That is normal.

About DigiPi's autohotspot.service. /etc/systemd/system/autohotspot.service runs /usr/local/bin/digihotspot.sh 30 seconds after boot. If wlan0 is not connected, it runs nmcli connection down wlan0, then nmcli connection up hotspot, and adds a firewall rule rejecting TCP port 53. It doesn't name an interface for the hotspot, so with the MAC lock the hotspot stays on the USB adapter. Leave it enabled.

Quirk: if the home router takes longer than 30 seconds to connect, the script disconnects home Wi-Fi until the next reboot; the hotspot is unaffected. If this happens often, disable it with sudo systemctl disable autohotspot.service. The hotspot still starts via autoconnect=true.

8. Reboot and verify

sudo reboot

Wait about a minute, rejoin DigiPi, run ssh digipi-field (set up in ~/.ssh/config, see "Before you start"; Windows: Appendix A.3), then:

nmcli device status
iw dev
ping -c 3 10.0.0.6
chronyc sources
iw reg get | head -3

Expected:

  • wlan1 connected to hotspot; wlan0 connected to wlan0 when home Wi-Fi is in range
  • iw dev: wlan1 type AP, ssid DigiPi, channel 11 (2.4 GHz); wlan0 type managed on your home SSID (2.4 or 5 GHz)
  • ping replies from the GW1200. The first one or two may be slow (1–2 s) while it wakes or rejoins.
  • chronyc sources: internet servers when home Wi-Fi is up; NMEA becomes active when the GPS has a fix
  • country US

Transmit power reading. iw dev shows txpower 3.00 dBm for wlan1 even after sudo iw dev wlan1 set txpower fixed 2000. This is a known MT7921 reporting quirk, not the real output. Check the actual signal from the Mac while joined to DigiPi:

system_profiler SPAirPortDataType | grep -m1 "Signal / Noise"

Around −40 to −60 dBm nearby is normal; the measured value was −52 dBm with a −93 dBm noise floor. Better than about −70 dBm at the point of use gives a solid link. Option-clicking the Wi-Fi icon may not show RSSI on newer macOS.

9. Time (field operation)

The GW1200 (or any other application or device that needs time from the DigiPi Raspberry Pi) gets its time from the Pi through chrony, so the Pi needs good time even without internet. Confirm these are in place:

grep -nE "^(allow|local|refclock)" /etc/chrony/chrony.conf /etc/chrony/conf.d/* 2>/dev/null
systemctl status rtc-to-system --no-pager
systemctl status gpsd --no-pager

Expected:

  • allow 10.0.0.0/24: the weather network may query the Pi
  • local stratum 10: serve RTC-based time when no other source is available
  • refclock SHM 0 ... refid NMEA (in conf.d/GPS.conf): GPS time via gpsd
  • rtc-to-system.service ran successfully: the DS3231 RTC sets the clock at boot, before WeeWX
  • gpsd active with -n

Priority order: internet (home), then GPS (field, with a fix), then RTC with local stratum 10 (fallback). chrony's rtcsync keeps the RTC corrected whenever it's synced.

Note on the RTC: the DS3231 real-time clock in this build is an add-on module. The Raspberry Pi 3B+ and Pi 4 have no built-in RTC. Without one, the Pi boots with the wrong time until GPS or internet time arrives, and the rtc-to-system check above does not apply. Adding an RTC to a Pi 3B+ or Pi 4 will be covered in a separate wiki article.

Note: gpsd is set to /dev/ttyACM1. The audio interface (All-In-One-Cable) may also appear as ttyACM, and the two can swap numbers after a reboot. Pointing gpsd at the GPS's fixed /dev/serial/by-id/ name avoids this.

10. Rollback

If the hotspot doesn't return after the reboot, put the Mac on home Wi-Fi and run ssh digipi-home (or use Ethernet, or a keyboard and monitor). Then:

sudo remount
F=/etc/NetworkManager/system-connections/hotspot.nmconnection
sudo sed -i '/^mac-address=/d' $F
sudo reboot

This frees the hotspot to run on the onboard radio again. For a full restore, copy the backup from step 1 back to the Pi, run sudo remount, then sudo tar xzf net-backup-YYYY-MM-DD.tar.gz -C /.

11. Finish

When all checks pass, run sudo reboot. This returns the SD card to read-only.

Appendix A: Windows 11 PowerShell commands

Everything that runs on the Pi is the same; only the computer-side steps change. Windows 11 includes the OpenSSH client (ssh, scp, ssh-keygen, ssh-add), so no extra software is needed. Run these in PowerShell.

Mac step Windows 11 equivalent
~/.ssh/config $HOME\.ssh\config (no file extension)
~/.ssh/keys/id_digipi $HOME\.ssh\keys\id_digipi
ssh-copy-id Not available; use the pipe command in A.4
ls -l Get-ChildItem
grep Select-String
system_profiler signal check netsh wlan show interfaces

A.1 Check that the SSH client is installed

Get-WindowsCapability -Online -Name OpenSSH.Client*

If State is not Installed, run PowerShell as Administrator and:

Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

A.2 Join the DigiPi or home network

Join each network once from the Wi-Fi menu so Windows saves it. After that:

netsh wlan show networks
netsh wlan connect name=DigiPi
netsh wlan show interfaces

A.3 SSH config file

Create the folders and open the config file:

New-Item -ItemType Directory -Force "$HOME\.ssh\keys" | Out-Null
if (!(Test-Path "$HOME\.ssh\config")) { New-Item -ItemType File "$HOME\.ssh\config" | Out-Null }
notepad "$HOME\.ssh\config"

Paste the same entries as "Before you start". Windows OpenSSH understands ~, so the paths work unchanged:

Host digipi-home
    HostName digipi.local
    User pi
    IdentityFile ~/.ssh/keys/id_digipi
    IdentitiesOnly yes

Host digipi-field 10.0.0.5
    HostName 10.0.0.5
    User pi
    IdentityFile ~/.ssh/keys/id_digipi
    IdentitiesOnly yes

Save it. If Notepad adds .txt, rename the file:

Rename-Item "$HOME\.ssh\config.txt" config

AddKeysToAgent and UseKeychain are Mac-specific; Windows uses the ssh-agent service instead (A.5).

A.4 Create and install the key

Create a key, or copy id_digipi and id_digipi.pub from the Mac into $HOME\.ssh\keys\:

ssh-keygen -t ed25519 -f "$HOME\.ssh\keys\id_digipi"

Restrict the private key to your account; OpenSSH refuses keys that other accounts can read:

$key = "$HOME\.ssh\keys\id_digipi"
icacls $key /inheritance:r
icacls $key /grant:r "$($env:USERNAME):(R)"

Install the key on the Pi. Run sudo remount on the Pi first, then on Windows:

Get-Content "$HOME\.ssh\keys\id_digipi.pub" | ssh digipi-field "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
ssh digipi-field

The second command should log in without the Pi password. Then run sudo reboot on the Pi.

A.5 Remember the key passphrase (optional)

Run PowerShell as Administrator once:

Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent

Then, in a normal PowerShell window:

ssh-add "$HOME\.ssh\keys\id_digipi"

A.6 Connect

  • On the DigiPi network: ssh digipi-field
  • On the home network: ssh digipi-home

A.7 Copy the backup (step 1)

scp 'digipi-field:/tmp/net-backup-*.tar.gz' "$HOME\"
Get-ChildItem "$HOME\net-backup-*.tar.gz"

Windows 11 includes tar, so tar -tzf <file> lists the archive's contents.

A.8 Troubleshooting

Check which key SSH offers ("Before you start"):

ssh -v digipi-home exit 2>&1 | Select-String -Pattern "offering|accepted|denied"

Check the hotspot signal while joined to DigiPi (section 8):

netsh wlan show interfaces | Select-String -Pattern "SSID|Signal|Rssi"

Windows reports signal as a percentage; recent Windows 11 builds also show Rssi in dBm. About 70% or better, or better than −70 dBm, gives a solid link.

Check that the Pi and GW1200 answer:

Test-Connection 10.0.0.5 -Count 3
Test-Connection 10.0.0.6 -Count 3

Clone this wiki locally