From 9054d21f4d251988f1c00a424e4f5a41785851b3 Mon Sep 17 00:00:00 2001 From: Christian OE3CJB Bauer Date: Thu, 27 Aug 2020 21:41:54 +0200 Subject: [PATCH] base91 compressed packets --- README.md | 2 + src/TTGO_T-Beam_LoRa_APRS.ino | 122 ++++++++++++++++++++--------- src/TTGO_T-Beam_LoRa_APRS_config.h | 15 +++- 3 files changed, 98 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 8f3df09..86e4fb1 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ Now the DS18B20 is supported as well - uncomment line 31: // #define DS18B20 by uncommenting // #define SHOW_RX_PACKET the tracker shows received LoRa APRS packets in raw format for the time in milliseconds defined in SHOW_RX_TIME - both in ...config.h

new features:
+- compressed packets in tracker mode +- symbol RV added - show RX packets - DS18B20 support (setable in config.h) - GPS switched off in WX_FIXED mode (only available with boards with HW-Version >=V1.0) diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 257e532..36c7ffb 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -11,9 +11,14 @@ // // licensed under CC BY-NC-SA // +// version: V1.3 +// last update: 27.08.2020 +// change history +// symbol RV added +// compressed packets in tracker mode (base91) +// // version: V1.2 // last update: 02.01.2020 -// // change history // added course change to smart Beaconing // code cleaned @@ -736,14 +741,29 @@ static void smartDelay(unsigned long ms) } while (millis() - start < ms); } +char *ax25_base91enc(char *s, uint8_t n, uint32_t v) +{ + /* Creates a Base-91 representation of the value in v in the string */ + /* pointed to by s, n-characters long. String length should be n+1. */ + + for(s += n, *s = '\0'; n; n--) + { + *(--s) = v % 91 + 33; + v /= 91; + } + + return(s); +} ///////////////////////////////////////////////////////////////////////////////////////// //@APA Recalc GPS Position == generate APRS string void recalcGPS(){ String Ns, Ew, helper; + char helper_base91[] = {"0000\0"}; float Tlat=48.2012, Tlon=15.6361; int i, Talt, lenalt; + uint32_t aprs_lat, aprs_lon; float Lat=0.0; float Lon=0.0; float Tspeed=0, Tcourse=0; @@ -931,48 +951,76 @@ case WX_MOVE: break; case TRACKER: default: - for (i=0; i" // other symbols are // "_" => Weather Station // ">" => CAR // "[" => RUNNER