raspi-pico-aprs-tnc/README.md

63 wiersze
3.1 KiB
Markdown
Czysty Zwykły widok Historia

2021-07-29 14:30:34 +00:00
# raspi-pico-aprs-tnc
2021-08-01 10:22:37 +00:00
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.
2021-08-02 21:29:34 +00:00
An analog line-out audio signal will be generated by a 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).
2021-07-29 14:35:37 +00:00
2021-08-02 21:29:34 +00:00
![AFSK scope screenshot](https://github.com/eleccoder/raspi-pico-aprs-tnc/blob/main/doc/img/afsk_scope.png)
2021-08-01 15:32:05 +00:00
2021-08-02 21:31:53 +00:00
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.
2021-08-01 19:51:42 +00:00
Basically, the data/signal flow is as follows:
2021-07-31 23:01:17 +00:00
```
2021-08-01 15:18:36 +00:00
APRS (text msg + geo-coordinates + meta-data) -> AX.25 -> PCM -> PWM -> Band-Pass filtering -> AFSK audio signal
2021-07-31 23:01:17 +00:00
```
2021-08-01 15:18:36 +00:00
Both a static library `libaprs_pico.a` and an example application will be generated by the build.
2021-08-01 15:31:05 +00:00
2021-07-31 23:01:17 +00:00
## Preliminaries
2021-08-01 19:51:42 +00:00
Your host platform for cross-compilation is assumed to be LINUX.
2021-07-31 23:01:17 +00:00
2021-08-01 15:31:05 +00:00
1. Install the Pico-SDK following the instructions given in the [Raspberry Pi 'Getting Started' Guide](https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf) (pdf)
1. Set the `PICO_SDK_PATH` environment variable to point to your Pico-SDK installation directory
2021-08-01 15:18:36 +00:00
2021-07-31 23:01:17 +00:00
## Hardware
2021-08-02 21:29:34 +00:00
We just need a simple band-pass filter to extract the analog AFSK-signal from the binary PWM signal:
2021-08-01 10:22:37 +00:00
2021-08-02 14:52:00 +00:00
![band-pass filter](https://github.com/eleccoder/raspi-pico-aprs-tnc/blob/main/doc/img/band_pass_filter.png)
2021-07-31 23:01:17 +00:00
2021-08-02 21:29:34 +00:00
The line-out voltage can be as high as 2.7 V<sub>pp</sub> (~1 V<sub>rms</sub>) (at full-scale volume setting in the software and high-impedance load).
2021-08-01 15:18:36 +00:00
## Build the library and the example application
2021-08-01 10:22:37 +00:00
2021-07-31 23:01:17 +00:00
```
2021-08-01 10:22:37 +00:00
(cd into the cloned dir)
2021-07-31 23:01:17 +00:00
cmake -S . -B build
cmake --build build
```
2021-08-02 21:29:34 +00:00
`build/lib/libaprs_pico.a` and `build/aprs_pico_example.uf2|.elf|.xxx` will be generated.
2021-08-01 15:18:36 +00:00
## Run the example application
2021-08-01 10:22:37 +00:00
2021-07-31 23:01:17 +00:00
```
cd build
2021-08-01 15:18:36 +00:00
(flash 'aprs_pico_example.uf2' or 'aprs_pico_example.elf' to the Pico board as usual)
2021-07-31 23:01:17 +00:00
```
2021-08-02 21:29:34 +00:00
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).
2021-07-31 23:01:17 +00:00
## TODO (Aug 2021)
2021-08-01 15:18:36 +00:00
- [x] Thorough evaluation, in general
2021-07-31 23:01:17 +00:00
- [x] Send the APRS message on the console (USB or UART) rather than hard-coding
2021-08-01 19:51:42 +00:00
- [x] Show how to physically connect to a Baofeng HT
- [x] PTT control for RF transceivers
2021-08-01 15:18:36 +00:00
2021-08-01 19:51:42 +00:00
## Ingredients / Acknowledgements
2021-08-01 11:03:25 +00:00
2021-08-01 19:51:42 +00:00
- For APRS => AX.25 => PCM conversion I'm using [my modified version](https://github.com/eleccoder/ax25-aprs-lib) of [fsphil's ax25beacon](https://github.com/fsphil/ax25beacon)
2021-08-01 11:03:25 +00:00
- 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)