--
You received this message because you are subscribed to the Google Groups "DigiPi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to digipi+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/digipi/ddacf90b-de15-48cf-9b0e-3e91be08f6fcn%40googlegroups.com.
--
USB AX3000 adapter + MIMO puck antenna for the DigiPi hotspot, onboard Wi-Fi kept for the home network
| Radio | Interface | Driver | Role |
|---|---|---|---|
| Onboard Pi 3B+ Wi-Fi | wlan0 | brcmfmac | Client on home Wi-Fi (e.g. 192.168.1.224) 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) |
At home both run at once. In the field, home Wi-Fi is simply absent and the hotspot keeps running.
Tested on: Raspberry Pi 3B+, DigiPi on Raspberry Pi OS Trixie.
sudo remount before changing anything, and sudo reboot when finished to return to read-only. Do not leave it writable across a power loss.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 .nmconnectionfiles directly with sudo sed, then run sudo nmcli connection reload.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 (sudo ls -l /var/lib/NetworkManager/).dtoverlay=disable-wifi. The onboard radio is needed for the home network.From the Mac, join the DigiPi network (or use the home network) and SSH in. See section 9 for the Mac SSH config.
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/chronyIn a second Terminal window on the Mac:
scp 'digipi-field:/tmp/net-backup-*.tar.gz' ~/
ls -l ~/net-backup-*.tar.gzlsusb | 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.brcmfmac = onboard radio (MAC usually starts b8:27:eb), mt7921u = USB adapter* APRecord both MACs, in uppercase, for the next steps:
ONBOARD_MAC=B8:27:EB:xx:xx:xx # brcmfmac radio
USB_MAC=90:DE:80:xx:xx:xx # mt7921u adapter(Type these two lines at the prompt with your real values; later commands use them. If you log out, set them again.)
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 -3Expected: country US: DFS-FCC.
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.leasesdnsmasq-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.
The stock DigiPi hotspot profile is tied to wlan0 and has autoconnect=false (DigiPi's autohotspot.servicenormally 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/' $FCheck the printed file (password masked):
interface-name= line[wifi] contains mac-address=<USB_MAC>, band=bg, mode=ap, ssid=DigiPiautoconnect=true[ipv4] has address1=10.0.0.5/24 and method=sharedband=bg (2.4 GHz) is required: the GW1200 is 2.4 GHz only, and 2.4 GHz gives the best range.
Change the hotspot password if it is still the default or a weak one:
sudo sed -i 's|^psk=.*|psk=NEW-HOTSPOT-PASSWORD|' $FThe stock wlan0.nmconnection may have an empty ssid= line. NetworkManager silently ignores such a profile (it won't appear in nmcli connection show).
W=/etc/NetworkManager/system-connections/wlan0.nmconnection
sudo sed 's/^psk=.*/psk=xxxx/' $W | cat -ALook for an empty ssid= or psk=, and for ^M at line ends (Windows line endings; remove with sudo sed -i 's/\r$//' $W).
Fix and pin it to the onboard radio (replace the SSID and password with yours; 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/' $WIf 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 (sudo nano $W), then sudo chmod 600 $W:
[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(A uuid= line is optional; NetworkManager generates one if absent.)
sudo chmod 600 /etc/NetworkManager/system-connections/*.nmconnection
sudo nmcli connection reload
nmcli connection showExpected: both hotspot and wlan0 are listed. Until the reboot, the hotspot still runs on the onboard radio and wlan0shows no device. That is normal.
/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.
sudo rebootWait about a minute, rejoin DigiPi, ssh digipi-field, then:
nmcli device status
iw dev
ping -c 3 10.0.0.6
chronyc sources
iw reg get | head -3Expected:
wlan1 connected → hotspot; wlan0 connected → 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 fixcountry USiw dev shows txpower 3.00 dBm for wlan1 even with 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 (measured −52 dBm / −93 dBm noise). 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.)
Without IdentitiesOnly, the Mac offers every key it has and the Pi disconnects with "Too many authentication failures". Keys live in ~/.ssh/keys/.
~/.ssh/config entries (keep them above any Host * section):
Host digipi224 192.168.1.224
HostName 192.168.1.224
User pi
IdentityFile ~/.ssh/keys/id_digipi224
IdentitiesOnly yes
Host digipi-field 10.0.0.5
HostName 10.0.0.5
User pi
IdentityFile ~/.ssh/keys/id_digipi224
IdentitiesOnly yes(AddKeysToAgent yes and UseKeychain yes are set globally at the top of the file.)
ssh digipi-fieldssh digipi224If SSH offers the key but still asks for a password, the Pi doesn't have the key (common after a rebuild). Check with:
ssh -v digipi224 exit 2>&1 | grep -iE "offering|accepted|denied"To install the key: on the Pi, run sudo remount. Then on the Mac:
ssh-copy-id -i ~/.ssh/keys/id_digipi224.pub digipi-field
ssh digipi-field # should log in without a passwordThen on the Pi: sudo reboot. One install covers both host entries (same Pi).
The GW1200 gets its time from the Pi (chrony), so the Pi needs good time 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-pagerExpected:
allow 10.0.0.0/24: the weather network may query the Pilocal stratum 10: serve RTC-based time when no other source is availablerefclock SHM 0 ... refid NMEA (in conf.d/GPS.conf): GPS time via gpsdrtc-to-system.service ran successfully: DS3231 RTC sets the clock at boot, before WeeWXgpsd active with -nPriority: internet (home) → GPS (field, with a fix) → RTC / local stratum 10 (fallback). chrony's rtcsync keeps the RTC corrected whenever it's synced.
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.
If the hotspot doesn't return after the reboot, put the Mac on home Wi-Fi and ssh digipi224 (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 rebootThis frees the hotspot to run on the onboard radio again. For a full restore, unpack the backup from step 1 (sudo tar xzf net-backup-YYYY-MM-DD.tar.gz -C / after copying it back to the Pi and running sudo remount).
When all checks pass:
sudo rebootThis returns the SD card to read-only.
On Nov 2, 2026, at 8:18 AM, Scott Sheppard <sshe...@bellsouth.net> wrote:
Hello