Updated Protocol and compatibility (markdown)

master
sh123 2021-11-15 10:35:58 +02:00
rodzic d8d8642fb1
commit dd212da322
1 zmienionych plików z 29 dodań i 0 usunięć

@ -6,6 +6,7 @@
- NB! Some popular LoRa ARPS implementations transfer plain text APRS messages over LoRa, for this mode operation need to set `cfg.EnableTextPackets/CFG_TEXT_PACKETS` to `true`, in this case iGate will transmit, receive and digirepeat text based APRS messages instead of classical AX25 frames.
# APRS AX.25 binary protocol
## APRS UI packet format
At the link level, APRS uses the AX.25 protocol, as defined in AmateurPacket-Radio Link-Layer Protocol, utilizing Unnumbered Information (UI) frames exclusively. This means that APRS runs in connection less mode, whereby AX.25 frames are transmitted without expecting any response, and reception at the other end is not guaranteed.At a higher level, APRS supports a messaging protocol that allows users tos end short messages (one line of text) to nominated stations, and expects to receive acknowledgements from those stations.
![alt text](https://raw.githubusercontent.com/sh123/esp32_loraprs/master/images/ax25.png)
@ -22,6 +23,34 @@ At the link level, APRS uses the AX.25 protocol, as defined in AmateurPacket-Rad
## APRS compressed packets
In compressed data format, the Information field contains the stations latitude and longitude, together with course and speed or pre-calculated radio range or altitude. This information is compressed to minimize the length of the transmitted packet (and therefore improve its chances of being received correctly under less than ideal conditions). The Information field also contains a display Symbol Code, and there may optionally be a plain text comment (uncompressed) as well.
## APRS compressed packets generation
Arduino code to generate compressed coordinates from degrees.
```
/*
** Convert degrees in long format to APRS compressed format
** http://www.aprs.org/doc/APRS101.PDF, page 36
*/
static char conv_buf[32];
char* deg_to_compressed(long deg, boolean is_lat) {
long tmp;
if (is_lat) {
tmp = ((90000000LL - (long long)deg)) * 1000000LL / 2625182LL;
}
else {
tmp = ((180000000LL + (long long)deg)) * 1000000LL / 5250364LL;
}
conv_buf[0] = 33 + tmp / (91L * 91L * 91L);
tmp = tmp % (91L * 91L * 91L);
conv_buf[1] = 33 + tmp / (91L * 91L);
tmp = tmp % (91L * 91L);
conv_buf[2] = 33 + tmp / 91L;
tmp = tmp % 91L;
conv_buf[3] = 33 + tmp;
conv_buf[4] = '\0';
return conv_buf;
}
```
![alt text](https://raw.githubusercontent.com/sh123/esp32_loraprs/master/images/aprs_compressed.png)
# APRS TNC2 text protocol