raspi-pico-aprs-tnc/README.md

60 wiersze
2.6 KiB
Markdown

# raspi-pico-aprs-tnc
A TX-only [TNC](https://en.wikipedia.org/wiki/Terminal_node_controller) (Terminal Network Controller) to generate the [AFSK](https://en.wikipedia.org/wiki/Frequency-shift_keying#Audio_FSK) audio tones for [APRS](https://en.wikipedia.org/wiki/Automatic_Packet_Reporting_System) (Automatic Packet Reporting System) messages using a [Raspberry Pi Pico](https://en.wikipedia.org/wiki/Raspberry_Pi) microcontroller board.
An analog line-out audio signal will be produced at GPIO-pin 'GP0'. You can observe it by using 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).
Basically, this is the data/signal flow:
```
APRS (text msg + geo-coordinates + meta-data) -> AX.25 -> PCM -> PWM -> Band-Pass filtering -> AFSK audio signal
```
Both a static library `libaprs_pico.a` and an example application will be generated by the build.
## Preliminaries
Your host platform is assumed to be LINUX.
If you have already installed the Pico-SDK, set the `PICO_SDK_PATH` environment variable accordingly to avoid installing the SDK twice.
## Hardware
We just need a simple band-pass filter to extract the AFSK-signal from the PWM signal:
![band-pass filter](https://github.com/eleccoder/raspi-pico-aprs-tnc/blob/main/doc/schematic/band_pass_filter.png)
## Build the library and the example application
```
(cd into the cloned dir)
cmake -S . -B build
cmake --build build
```
`build/lib/libaprs_pico.a` and `build/aprs_pico_example.xxx` will be created.
## Run the example application
```
cd build
(flash 'aprs_pico_example.uf2' or 'aprs_pico_example.elf' to the Pico board as usual)
```
The GPIO-pin 'GP0' is the line-out for the analog AFSK-signal. You can observe it by using 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).
![AFSK scope screenshot](https://github.com/eleccoder/raspi-pico-aprs-tnc/blob/main/doc/img/afsk_scope.png "Scope screenshot of an AFSK output signal")
## TODO (Aug 2021)
- [x] Thorough evaluation, in general
- [x] Send the APRS message on the console (USB or UART) rather than hard-coding
- [x] Show how to connect to a Baofeng HT
- [x] PTT control for RF tranceivers
## Acknowledgements
- For APRS => AX.25 conversion I'm using a [modified version](https://github.com/eleccoder/ax25-aprs-lib) of [fsphil's ax25beacon](https://github.com/fsphil/ax25beacon)
- For PCM => PWM conversion I'm using the audio lib from [pico-extras](https://github.com/raspberrypi/pico-extras) (WARNING: maturity seems to be alpha/beta)