base91 compressed packets
This commit is contained in:
parent
d3b3a368a8
commit
9054d21f4d
|
|
@ -41,6 +41,8 @@ Now the DS18B20 is supported as well - uncomment line 31: // #define DS18B20
|
||||||
by uncommenting <b>// #define SHOW_RX_PACKET</b> the tracker shows received LoRa APRS packets in raw format for the time in milliseconds defined in SHOW_RX_TIME - both in ...config.h<br>
|
by uncommenting <b>// #define SHOW_RX_PACKET</b> the tracker shows received LoRa APRS packets in raw format for the time in milliseconds defined in SHOW_RX_TIME - both in ...config.h<br>
|
||||||
<br>
|
<br>
|
||||||
<b>new features:</b><br>
|
<b>new features:</b><br>
|
||||||
|
- compressed packets in tracker mode
|
||||||
|
- symbol RV added
|
||||||
- show RX packets
|
- show RX packets
|
||||||
- DS18B20 support (setable in config.h)
|
- DS18B20 support (setable in config.h)
|
||||||
- GPS switched off in WX_FIXED mode (only available with boards with HW-Version >=V1.0)
|
- GPS switched off in WX_FIXED mode (only available with boards with HW-Version >=V1.0)
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,14 @@
|
||||||
//
|
//
|
||||||
// licensed under CC BY-NC-SA
|
// 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
|
// version: V1.2
|
||||||
// last update: 02.01.2020
|
// last update: 02.01.2020
|
||||||
//
|
|
||||||
// change history
|
// change history
|
||||||
// added course change to smart Beaconing
|
// added course change to smart Beaconing
|
||||||
// code cleaned
|
// code cleaned
|
||||||
|
|
@ -736,14 +741,29 @@ static void smartDelay(unsigned long ms)
|
||||||
} while (millis() - start < 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
|
//@APA Recalc GPS Position == generate APRS string
|
||||||
void recalcGPS(){
|
void recalcGPS(){
|
||||||
|
|
||||||
String Ns, Ew, helper;
|
String Ns, Ew, helper;
|
||||||
|
char helper_base91[] = {"0000\0"};
|
||||||
float Tlat=48.2012, Tlon=15.6361;
|
float Tlat=48.2012, Tlon=15.6361;
|
||||||
int i, Talt, lenalt;
|
int i, Talt, lenalt;
|
||||||
|
uint32_t aprs_lat, aprs_lon;
|
||||||
float Lat=0.0;
|
float Lat=0.0;
|
||||||
float Lon=0.0;
|
float Lon=0.0;
|
||||||
float Tspeed=0, Tcourse=0;
|
float Tspeed=0, Tcourse=0;
|
||||||
|
|
@ -931,48 +951,76 @@ case WX_MOVE:
|
||||||
break;
|
break;
|
||||||
case TRACKER:
|
case TRACKER:
|
||||||
default:
|
default:
|
||||||
for (i=0; i<Tcall.length();++i){ // remove unneeded "spaces" from callsign field
|
#ifndef TX_BASE91
|
||||||
if (Tcall.charAt(i) != ' ') {
|
for (i=0; i<Tcall.length();++i){ // remove unneeded "spaces" from callsign field
|
||||||
outString += Tcall.charAt(i);
|
if (Tcall.charAt(i) != ' ') {
|
||||||
|
outString += Tcall.charAt(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
// outString = (Tcall);
|
||||||
// outString = (Tcall);
|
outString += ">APRS:!";
|
||||||
outString += ">APRS:!";
|
if(Tlat<10) {outString += "0"; }
|
||||||
if(Tlat<10) {outString += "0"; }
|
outString += String(Lat,2);
|
||||||
outString += String(Lat,2);
|
outString += Ns;
|
||||||
outString += Ns;
|
outString += sTable;
|
||||||
outString += sTable;
|
if(Tlon<100) {outString += "0"; }
|
||||||
if(Tlon<100) {outString += "0"; }
|
if(Tlon<10) {outString += "0"; }
|
||||||
if(Tlon<10) {outString += "0"; }
|
outString += String(Lon,2);
|
||||||
outString += String(Lon,2);
|
outString += Ew;
|
||||||
outString += Ew;
|
outString += TxSymbol;
|
||||||
outString += TxSymbol;
|
if(Tcourse<100) {outString += "0"; }
|
||||||
if(Tcourse<100) {outString += "0"; }
|
if(Tcourse<10) {outString += "0"; }
|
||||||
if(Tcourse<10) {outString += "0"; }
|
Coursex = String(Tcourse,0);
|
||||||
Coursex = String(Tcourse,0);
|
Coursex.replace(" ","");
|
||||||
Coursex.replace(" ","");
|
outString += Coursex;
|
||||||
outString += Coursex;
|
outString += "/";
|
||||||
outString += "/";
|
if(Tspeed<100) {outString += "0"; }
|
||||||
if(Tspeed<100) {outString += "0"; }
|
if(Tspeed<10) {outString += "0"; }
|
||||||
if(Tspeed<10) {outString += "0"; }
|
Speedx = String(Tspeed,0);
|
||||||
Speedx = String(Tspeed,0);
|
Speedx.replace(" ","");
|
||||||
Speedx.replace(" ","");
|
outString += Speedx;
|
||||||
outString += Speedx;
|
outString += "/A=";
|
||||||
outString += "/A=";
|
outString += Altx;
|
||||||
outString += Altx;
|
outString += " Batt=";
|
||||||
outString += " Batt=";
|
outString += String(BattVolts,2);
|
||||||
outString += String(BattVolts,2);
|
outString += ("V");
|
||||||
outString += ("V");
|
#ifdef DEBUG
|
||||||
#ifdef DEBUG
|
outString += (" Debug: ");
|
||||||
outString += (" Debug: ");
|
outString += TxRoot;
|
||||||
outString += TxRoot;
|
#endif
|
||||||
#endif
|
#else
|
||||||
|
for (i=0; i<Tcall.length();++i){ // remove unneeded "spaces" from callsign field
|
||||||
|
if (Tcall.charAt(i) != ' ') {
|
||||||
|
outString += Tcall.charAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// outString = (Tcall);
|
||||||
|
outString += ">APRS:!/";
|
||||||
|
aprs_lat = 900000000 - Tlat * 10000000;
|
||||||
|
aprs_lat = aprs_lat / 26 - aprs_lat / 2710 + aprs_lat / 15384615;
|
||||||
|
aprs_lon = 900000000 + Tlon * 10000000 / 2;
|
||||||
|
aprs_lon = aprs_lon / 26 - aprs_lon / 2710 + aprs_lon / 15384615;
|
||||||
|
ax25_base91enc(helper_base91, 4, aprs_lat);
|
||||||
|
for (i=0; i<4; i++) {
|
||||||
|
outString += helper_base91[i];
|
||||||
|
}
|
||||||
|
ax25_base91enc(helper_base91, 4, aprs_lon);
|
||||||
|
for (i=0; i<4; i++) {
|
||||||
|
outString += helper_base91[i];
|
||||||
|
}
|
||||||
|
outString += TxSymbol;
|
||||||
|
ax25_base91enc(helper_base91, 1, (uint32_t) Tcourse/4 );
|
||||||
|
outString += helper_base91[0];
|
||||||
|
ax25_base91enc(helper_base91, 1, (uint32_t) (log1p(Tspeed)/0.07696));
|
||||||
|
outString += helper_base91[0];
|
||||||
|
outString += "\x48";
|
||||||
|
#endif
|
||||||
Serial.print("outString=");
|
Serial.print("outString=");
|
||||||
// Speedx = String(Tspeed,0);
|
// Speedx = String(Tspeed,0);
|
||||||
// Speedx.replace(" ","");
|
// Speedx.replace(" ","");
|
||||||
Serial.println(outString);
|
Serial.println(outString);
|
||||||
// Serial.println("=");
|
// Serial.println("=");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,12 @@
|
||||||
//
|
//
|
||||||
// licensed under CC BY-NC-SA
|
// 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.1beta
|
// version: V1.1beta
|
||||||
// last update: 22.11.2019
|
// last update: 22.11.2019
|
||||||
//
|
//
|
||||||
|
|
@ -26,6 +32,7 @@
|
||||||
// SET HW version
|
// SET HW version
|
||||||
#define T_BEAM_V1_0 // use this for newer Boards AKA Rev1 (second board release)
|
#define T_BEAM_V1_0 // use this for newer Boards AKA Rev1 (second board release)
|
||||||
// #define T_BEAM_V0_7 // use this for older Boards AKA Rev0.x (first board release)
|
// #define T_BEAM_V0_7 // use this for older Boards AKA Rev0.x (first board release)
|
||||||
|
#define TX_BASE91 // if BASE91 is set, packets will be sent compressed (in TRACKER-mode only)
|
||||||
|
|
||||||
// SET temperature sensor type
|
// SET temperature sensor type
|
||||||
// #define DS18B20 // use this if you use DS18B20, default ist DHT22
|
// #define DS18B20 // use this if you use DS18B20, default ist DHT22
|
||||||
|
|
@ -33,12 +40,12 @@
|
||||||
// USER DATA - USE THESE LINES TO MODIFY YOUR PREFERENCES
|
// USER DATA - USE THESE LINES TO MODIFY YOUR PREFERENCES
|
||||||
// IF NOT CHANGED you have to go through the configuration routine at first boot up of the TTGO T-Beam
|
// IF NOT CHANGED you have to go through the configuration routine at first boot up of the TTGO T-Beam
|
||||||
|
|
||||||
#define DONT_USE_FLASH_MEMORY // uncomment if you don't want to use Flashmemory - instead data below must be corrected
|
// #define DONT_USE_FLASH_MEMORY // uncomment if you don't want to use Flashmemory - instead data below must be corrected
|
||||||
#define CALLSIGN "OE3CJB-14" // enter your callsign here - less then 6 letter callsigns please add "spaces" so total length is 6 (without SSID)
|
#define CALLSIGN "OE1XYZ-11" // enter your callsign here - less then 6 letter callsigns please add "spaces" so total length is 6 (without SSID)
|
||||||
#define WX_CALLSIGN "OE3CJB-14" // use same callsign but you can use different SSID
|
#define WX_CALLSIGN "OE1XYZ-11" // use same callsign but you can use different SSID
|
||||||
#define LONGITUDE_PRESET "01539.85E" // please in APRS notation DDDMM.mmE or DDDMM.mmW
|
#define LONGITUDE_PRESET "01539.85E" // please in APRS notation DDDMM.mmE or DDDMM.mmW
|
||||||
#define LATIDUDE_PRESET "4813.62N" // please in APRS notation DDMM.mmN or DDMM.mmS
|
#define LATIDUDE_PRESET "4813.62N" // please in APRS notation DDMM.mmN or DDMM.mmS
|
||||||
#define APRS_SYMBOL "R" // other symbols are
|
#define APRS_SYMBOL ">" // other symbols are
|
||||||
// "_" => Weather Station
|
// "_" => Weather Station
|
||||||
// ">" => CAR
|
// ">" => CAR
|
||||||
// "[" => RUNNER
|
// "[" => RUNNER
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue