8118ddf55b | ||
---|---|---|
cmake | ||
doc | ||
include | ||
src | ||
.gitignore | ||
CMakeLists.txt | ||
LICENSE | ||
README.md |
README.md
raspi-pico-aprs-tnc
A TX-only TNC (Terminal Node Controller) to generate the AFSK (Audio Frequency-Shift Keying) audio tones for APRS (Automatic Packet Reporting System) messages using a RP2040 microcontroller on a Raspberry Pi Pico board.
Block diagram showing the signal flow
An analog line-out audio signal will be generated by a band-pass filter connected to GPIO-pin 'GP0' which provides the binary PWM signal. You can probe it by a scope, listen to it by using an audio amp, or connect it to any RF transceiver to send it on the air (ham radio license required).
Image: Line-out signal (see below) probed by a DSO. We clearly see the 1200 Hz and 2200 Hz tones of the 1200 Bd 2-AFSK.
Both a static library libaprs_pico.a
and a demo application will be generated by the build.
Prerequisites
Your host platform for cross-compilation is assumed to be LINUX.
- Install the Pico-SDK following the instructions given in the Raspberry Pi 'Getting Started' Guide (pdf)
- Set the
PICO_SDK_PATH
environment variable to point to your Pico-SDK installation directory - Install the pico-extras libraries:
cd $PICO_SDK_PATH/..
git clone -b master https://github.com/raspberrypi/pico-extras.git
cd pico-extras
git submodule update --init
Hardware
We just need a simple band-pass filter to extract the analog AFSK-signal from the binary PWM signal:
The line-out voltage can be as high as 2.7 Vpp (~1 Vrms) (at full-scale volume setting in the software and high-impedance load).
Build the library and the 'beacon' demo application
git clone https://github.com/eleccoder/raspi-pico-aprs-tnc.git
cd raspi-pico-aprs-tnc
cmake -S . -B build
cmake --build build
build/lib/libaprs_pico.a
and build/aprs_pico_beacon_demo[.uf2|.elf|.bin|.hex]
will be generated, as well as the testing application build/aprs_pico_tone_test[.uf2|.elf|.bin|.hex]
.
Run the 'beacon' demo application
cd build
Flash 'aprs_pico_beacon_demo[.uf2|.elf|.bin|.hex]' to the Pico board as usual.
The analog AFSK audio signal will be available at the filter's line-out. You can probe it by a scope, listen to it by using an audio amp, or connect it to any RF transceiver to send it on the air (ham radio license required).
Test the 'beacon' demo application using Dire Wolf (on LINUX)
We can use the famous Dire Wolf CLI software to decode the APRS data after sampling our APRS audio signal by means of a soundcard.
- Connect the line-out of our circuit above to the microphone input of your soundcard of your (ALSA-supported) LINUX system.
- Check if you can hear the typical APRS 'modem-sound' on your audio output device by monitoring the input signal:
arecord -f cd -c 1 -t raw - | aplay -f cd -c 1 -t raw
- Install Dire Wolf on your system. Probably, you just have to run:
sudo apt install direwolf
- Let's sample the APRS audio signal fed to the soundcard and forward the audio stream to Dire Wolf:
arecord -f cd -c 1 -t raw - | direwolf
- Enjoy the decoded APRS message:
TODO (Dec. 2022)
- Send the APRS message on the console (USB or UART) rather than hard-coding
- PTT control for RF transceivers
- Show how to physically connect to a Baofeng HT
Ingredients / Acknowledgements
- For
APRS => AX.25 => PCM
conversion I'm using my modified version of fsphil's ax25beacon project. - For
PCM => PWM
conversion I'm using thepico_audio_pwm
library from pico-extras (NOTE: ATTOW, maturity seems to be rather alpha/beta). - Basic PWM audio rendering with the Pi Pico has been spotted in the pico-playground.