Setting up APRS. Orange Pi One H3 and Quansheng K5

Started by VK5MCH, Sep 30, 2025, 01:28 PM

Previous topic - Next topic

VK5MCH

#1
I thought  would give this a go and see how it turns out.

It was all done on CHATGPT5 after seeding it.

# Orange Pi One (H3) + Quansheng APRS: Full Step‑by‑Step Manual

**Goal:** Build a reliable APRS tracker / RX iGate / TX iGate on an Orange Pi One (H3) using a USB sound card and a Quansheng HT (e.g., UV‑K5/UV‑K6). This guide is end‑to‑end, from flashing the OS to sending/receiving APRS messages from a desktop over TCP/IP.

---

## 0) What You'll Build (Overview)

* **Orange Pi One (H3)** running **Armbian**.
* **USB sound card** (CM108/CM119 recommended).
* **Quansheng HT** tuned to **145.175 MHz (VK)** or **144.390 MHz (NA)**.
* **Direwolf** as a software TNC (AFSK 1200), exposing **AGWPE (TCP 8000)** and **KISS (TCP 8001)** to LAN clients (PinPoint APRS / YAAC / Xastir).
* Optional: **APRS‑IS iGate** and/or **GPSD** for live position beacons.

> **Callsign & Legality:** You must use your own amateur callsign and comply with your local amateur radio regulations.

---

## 1) Parts & Prerequisites

**Hardware**

* Orange Pi One (H3) + microSD (16–32 GB, A1/A2 class recommended).
* USB sound card (CM108/CM119 chipset preferred).
* Quansheng HT (UV‑K5 / UV‑K6 or similar) + K1 (Kenwood) 2‑pin programming/audio cable OR a custom audio cable.
* Audio leads: Radio SPK → USB mic‑in; USB headphone‑out → Radio mic‑in.
* (Optional) 2× resistors (e.g., 10 kΩ / 10 kΩ) + 1 µF capacitor for mic pad/DC block.
* (Optional) USB GPS (u‑blox type) if you want mobile beacons without internet.
* (Optional) Powered USB hub if your dongles draw extra current.

**Software (download now)**

* Armbian for Orange Pi One (H3): [https://www.armbian.com/orange-pi-one/](https://www.armbian.com/orange-pi-one/)
* Balena Etcher: [https://www.balena.io/etcher/](https://www.balena.io/etcher/)
  or Raspberry Pi Imager: [https://www.raspberrypi.com/software/](https://www.raspberrypi.com/software/)
* Direwolf source: [https://github.com/wb2osz/direwolf](https://github.com/wb2osz/direwolf)
* PinPoint APRS (Windows client): [https://pinpointaprs.com/download.html](https://pinpointaprs.com/download.html)
* YAAC (cross‑platform client): [https://sourceforge.net/projects/yetanotheraprsc/files/](https://sourceforge.net/projects/yetanotheraprsc/files/)
* APRS Tier2 servers: [https://www.aprs2.net/](https://www.aprs2.net/)  and server rotation: [https://www.aprs-is.net/APRSServers.aspx](https://www.aprs-is.net/APRSServers.aspx)
* VK APRS setup guidance: [https://aprs.net.au/radio-setup/vhf/](https://aprs.net.au/radio-setup/vhf/)

**Region‑specific APRS VHF channel**

* Australia/NZ: **145.175 MHz FM (NFM)**
* North America: **144.390 MHz FM (NFM)**

---

## 2) Flash Armbian to microSD

1. Download a **current Armbian image** for **Orange Pi One (H3)** from: [https://www.armbian.com/orange-pi-one/](https://www.armbian.com/orange-pi-one/)
2. Use **Balena Etcher** or **Raspberry Pi Imager** to flash the `.img` to the microSD.
3. Safely eject the card and insert into the Orange Pi.

> **Tip:** Prefer Armbian **Bookworm (Debian)** or **Jammy/Noble (Ubuntu)** variants. Server/headless is fine.

---

## 3) First Boot & Base System Setup

1. Connect Ethernet to your LAN (wired is simplest). Power on the Orange Pi.
2. Default Armbian login (first boot):

  * user: `root`
  * pass: `1234`
    You will be prompted to create a new sudo user (e.g., `aprs`) and set locales/timezone.
3. Update and reboot:

```bash
sudo apt update && sudo apt upgrade -y
sudo reboot
```

4. Find the Pi's IP address (on the Pi):

```bash
ip a | grep inet
```

(Optional) Reserve this IP in your router's DHCP or set static IP via `nmtui` or `armbian-config`.

---

## 4) Plug in the USB Sound Card & Verify Audio

Plug in your USB sound card, then:

```bash
aplay -l
arecord -l
```

You should see a **USB Audio** device, typically **card 1, device 0** (shown as `hw:1,0`).

**Set audio levels**

```bash
alsamixer
# F6 → select your USB device
# F4 → Capture (set mic input level ~60–80%)
```

> **Optional (stable device naming):** Create `~/.asoundrc` to pin default device to your USB card so `plughw:1,0` remains stable across reboots.

Example `~/.asoundrc`:

```txt
pcm.!default {
  type plug
  slave.pcm "hw:1,0"
}
ctl.!default {
  type hw
  card 1
}
```

---

## 5) Install Direwolf (software TNC)

**Option A (recommended: latest from source)**

```bash
sudo apt install -y git cmake build-essential
cd ~
git clone https://github.com/wb2osz/direwolf
cd direwolf
mkdir build && cd build
cmake ..
make -j4
sudo make install
```

Check version:

```bash
direwolf -v
```

**Option B (repo package)**

```bash
sudo apt install -y direwolf
```

> Repo versions can lag; prefer Option A if you want the newest features (e.g., Radio Interface Guide updates in 1.7+).

---

## 6) Wire the Radio (Quansheng ↔ USB Sound Card)

* **RX path (radio → Pi):** Radio **SPK** (3.5 mm) → USB **Mic‑In**.
* **TX path (Pi → radio):** USB **Headphone‑Out** → Radio **Mic‑In** (2.5 mm). Add a **series capacitor \~1 µF** and a **divider** (e.g., 10 kΩ / 10 kΩ) if your USB card overdrives the mic.
* **PTT:** Start with **VOX** on the radio (simple & works well). If VOX is unreliable, you can use **CM108/CM119 GPIO PTT** or a **USB‑Serial RTS** line later.

**Quansheng radio settings**

* **VFO/MEM:** Set a **simplex** channel on **145.175 MHz (NFM)** (VK) or **144.390 MHz** (NA).
* **VOX:** ON; short delay (\~0.5–1.0 s).
* **TX power:** LOW (reduces distortion & saves battery).
* **No CTCSS/DCS** on APRS.
* **Volume:** start \~30–40%.

---

## 7) Create `~/direwolf.conf`

This file provides **RX‑only iGate** and **TX Tracker/iGate** profiles. Enable only one profile at a time.

```ini
# ============================
# Direwolf config - Orange Pi One + USB Soundcard + Quansheng (VK region)
# APRS VHF: 145.175 MHz (Australia/NZ) or 144.390 (NA)
# Sample rate: 48000 Hz
# ============================

# ---- AUDIO DEVICE ----
# Find with: aplay -l  /  arecord -l
ADEVICE plughw:1,0

# ---- MODEM ----
CHANNEL 0
MODEM 1200

# ---- IDENT/CALL ----
MYCALL YOURCALL-9  # ← change to your callsign-SSID

# ============================
# PROFILE A: RX-Only iGate (safe start – NO TX)
# ============================
#PTT NONE

# APRS-IS (RX→IS)
IGSERVER rotate.aprs2.net
IGLOGIN YOURCALL 12345  # ← replace 12345 with your APRS-IS passcode

# Fixed site position for your iGate (example: Adelaide CBD)
PBEACON delay=0 every=30 symbol=igi lat=-34.9285 long=138.6007 comment="OrangePi One RX iGate 145.175 MHz" via=IS

# ============================
# PROFILE B: Tracker / TX + optional iGate (enable when ready)
# ============================
## Uncomment the next lines and comment Profile A if you want TX
#PTT VOX
#TXDELAY 300

## (Choose ONE of these beacons)
## (A) Fixed station beacon
#PBEACON delay=0 every=120 symbol=igi lat=-34.9285 long=138.6007 power=5 height=10 gain=3 dir=0 comment="OrangePi iGate/Digi 145.175 MHz"

## (B) Mobile beacon via GPSD (if running gpsd)
#GPSD localhost:2947
#TBEACON sendto=0 every=60 symbol=> comment="OrangePi + Quansheng Mobile"

## Optional APRS-IS while TXing
#IGSERVER rotate.aprs2.net
#IGLOGIN YOURCALL 12345
#IGFILTER m/50

# ---- AGW/KISS servers for desktop clients ----
AGWPORT 8000
KISSPORT 8001

# ---- Optional Digipeater (leave off unless you know you need it) ----
#DIGIPEAT 0 WIDE1-1
#DIGIPATH WIDE1-1,WIDE2-1
```

> **Passcode:** APRS‑IS requires a validation (derived from your callsign). Generate it via a trusted tool. Keep it private.

---

## 8) Test Direwolf (Foreground)

**RX‑only test first:**

```bash
direwolf -c ~/direwolf.conf -r 48000 -D 1
```

* Watch the console for decoded packets. Adjust radio volume and `alsamixer` capture levels for solid decodes (aim Direwolf audio level \~50–70).
* If using **Profile B (TX)**, ensure VOX keys the radio and over‑deviation is avoided (reduce USB output volume if packets don't decode on other stations).

**Quick audio sanity checks**

```bash
# Record 5 seconds from mic-in and play back
arecord -d 5 -f S16_LE -r 48000 /tmp/test.wav
aplay /tmp/test.wav
```

---

## 9) Enable APRS‑IS iGate (Optional)

* With **IGSERVER rotate.aprs2.net** and **IGLOGIN** set, Direwolf will forward **RF→IS** automatically when decoding RF.
* Verify your station appears on [https://aprs.fi](https://aprs.fi) after a few minutes. Use your callsign search.

**Firewall note (if you enable UFW)**

```bash
sudo apt install -y ufw
sudo ufw allow 8000/tcp  # AGWPE
sudo ufw allow 8001/tcp  # KISS
sudo ufw enable
sudo ufw status
```

---

## 10) Connect a Desktop Client over TCP/IP

From your desktop on the same LAN:

**PinPoint APRS (Windows)**

1. Install PinPoint from [https://pinpointaprs.com/download.html](https://pinpointaprs.com/download.html)
2. Open **Options → Connections → Add AGW**.
3. Host: `ORANGE_PI_IP`  Port: `8000`  (AGWPE)
4. Select **TNC/AGW** as the connection for messaging.
5. Set your **callsign**, position source (manual/GPS), and map options.

**YAAC (Windows/macOS/Linux)**

1. Download YAAC ZIP: [https://sourceforge.net/projects/yetanotheraprsc/files/](https://sourceforge.net/projects/yetanotheraprsc/files/)
  Unzip and run `YAAC.jar` (requires Java).
2. Add an **AGWPE over TCP** interface: Host `ORANGE_PI_IP`, Port `8000`.
3. Configure callsign, beacons, and maps.

> Both clients can send/receive APRS **messages** through the Orange Pi via TCP/IP.

---

## 11) Autostart Direwolf at Boot (systemd)

Create a service file:

```bash
sudo nano /etc/systemd/system/direwolf@.service
```

Paste:

```ini
[Unit]
Description=Direwolf APRS (for user %%i)
After=network-online.target sound.target
Wants=network-online.target

[Service]
User=%i
ExecStart=/usr/local/bin/direwolf -c /home/%i/direwolf.conf -r 48000 -D 1
Restart=on-failure

[Install]
WantedBy=multi-user.target
```

Enable for your user (replace `aprs` if different):

```bash
sudo systemctl enable direwolf@aprs.service
sudo systemctl start  direwolf@aprs.service
sudo systemctl status direwolf@aprs.service
```

---

## 12) Optional: GPS Integration

If you add a USB GPS:

```bash
sudo apt install -y gpsd gpsd-clients
sudo dpkg-reconfigure gpsd
# Set to tcp://localhost:2947 (autostart with GPSD)

# Test
cgps -s
```

Enable in `direwolf.conf` (Profile B):

```ini
GPSD localhost:2947
TBEACON sendto=0 every=60 symbol=> comment="OrangePi + Quansheng Mobile"
```

---

## 13) Optional: Hardware PTT (CM108/CM119 or Serial RTS)

If VOX is unreliable, you can key PTT from the USB sound card's **CM108/CM119 GPIO** or a **USB‑Serial RTS** pin.

**CM108/CM119** (needs a compatible dongle and wired transistor to PTT):

```ini
PTT CM108
CM108_PIN GPIO3
```

**USB‑Serial RTS** (FTDI/CH340, transistor to PTT):

```ini
PTT /dev/ttyUSB0 RTS
SERIAL_DELAY 50
```

Consult Direwolf's **Radio Interface Guide** for wiring details.

---

## 14) Region & Channel Plan (VK)

* Use **145.175 MHz (FM, 1200 baud AFSK)** for APRS in Australia/NZ.
* Keep beacon rates polite (e.g., 120 s for mobiles) and use SmartBeaconing if available.

---

## 15) Troubleshooting Checklist

* **No decodes?** Lower radio volume a touch; set `alsamixer` capture \~65–80%; check `ADEVICE` card index; confirm NFM and no CTCSS.
* **TX not keying?** Increase VOX sensitivity; add `TXDELAY 300`; ensure USB output volume is audible but not clipping.
* **Over‑deviation / garbled?** Reduce USB output level, add 1 µF series cap + 10 kΩ divider.
* **Desktop can't connect?** Ensure Pi's IP is reachable; ports **8000/8001** open; `systemctl status direwolf@USER` shows running.
* **APRS‑IS not gating?** Verify passcode and server; check internet connectivity; ensure you're receiving RF before expecting RF→IS gating.
* **Wrong sound device after reboot?** Use `~/.asoundrc` or pin device by USB ID and create udev rules.

---

## 16) Appendix: Example Minimal Configs

**RX‑Only iGate (minimal):**

```ini
ADEVICE plughw:1,0
CHANNEL 0
MODEM 1200
MYCALL YOURCALL-10
IGSERVER rotate.aprs2.net
IGLOGIN YOURCALL 12345
PBEACON delay=0 every=30 symbol=igi lat=-34.9285 long=138.6007 comment="RX iGate" via=IS
AGWPORT 8000
KISSPORT 8001
```

**Mobile Tracker via VOX:**

```ini
ADEVICE plughw:1,0
CHANNEL 0
MODEM 1200
MYCALL YOURCALL-9
PTT VOX
TXDELAY 300
GPSD localhost:2947
TBEACON sendto=0 every=60 symbol=> comment="OPi + QS Mobile"
AGWPORT 8000
KISSPORT 8001
```

---

## 17) Useful Links

* Armbian Orange Pi One (H3): [https://www.armbian.com/orange-pi-one/](https://www.armbian.com/orange-pi-one/)
* Direwolf (source & docs): [https://github.com/wb2osz/direwolf](https://github.com/wb2osz/direwolf)
  User Guide (PDF mirror): [https://packet-radio.net/wp-content/uploads/2018/10/Direwolf-User-Guide.pdf](https://packet-radio.net/wp-content/uploads/2018/10/Direwolf-User-Guide.pdf)
  Radio Interface Guide: [https://hamgate.ampr.org/docs/Direwolf-Radio-Interface-Guide.pdf](https://hamgate.ampr.org/docs/Direwolf-Radio-Interface-Guide.pdf)
* APRS‑IS / Tier2 servers: [https://www.aprs2.net/](https://www.aprs2.net/)  |  [https://www.aprs-is.net/APRSServers.aspx](https://www.aprs-is.net/APRSServers.aspx)
* VK APRS VHF guidelines: [https://aprs.net.au/radio-setup/vhf/](https://aprs.net.au/radio-setup/vhf/)
* PinPoint APRS (Windows): [https://pinpointaprs.com/download.html](https://pinpointaprs.com/download.html)
* YAAC (Yet Another APRS Client): [https://sourceforge.net/projects/yetanotheraprsc/files/](https://sourceforge.net/projects/yetanotheraprsc/files/)
* aprs.fi (map/validation): [https://aprs.fi](https://aprs.fi)

---

### You're done!

You now have a clean, service‑based APRS node that can: decode APRS from RF, gate to APRS‑IS, beacon a fixed or mobile station, and serve LAN clients over AGWPE/KISS for full APRS messaging.
Mick VK5MCH