From 327bbca6e6f9106583ef7d9b90c54d15b087b18f Mon Sep 17 00:00:00 2001 From: "Hansi, dl9rdz" Date: Sat, 30 Oct 2021 17:14:42 +0200 Subject: [PATCH] some APRS for wettersonde.net support --- RX_FSK/RX_FSK.ino | 9 +++++---- RX_FSK/data/cfg.js | 3 ++- RX_FSK/data/config.txt | 3 ++- RX_FSK/src/Sonde.h | 3 ++- RX_FSK/src/aprs.cpp | 5 +++-- RX_FSK/src/aprs.h | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index 7292ecf..f7f8bfc 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -646,7 +646,8 @@ struct st_configitems config_list[] = { {"tcp.port", 0, &sonde.config.tcpfeed.port}, {"tcp.chase", 0, &sonde.config.chase}, {"tcp.comment", 30, sonde.config.comment}, - {"tcp.bcall", 9, sonde.config.bcall}, + {"tcp.objcall", 9, sonde.config.objcall}, + {"tcp.beaconsym", 4, sonde.config.beaconsym}, {"tcp.highrate", 0, &sonde.config.tcpfeed.highrate}, #if FEATURE_CHASEMAPPER /* Chasemapper settings */ @@ -2302,7 +2303,7 @@ void loopDecoder() { // first check if ID and position lat+lonis ok if (s->d.validID && ((s->d.validPos & 0x03) == 0x03)) { - char *str = aprs_senddata(s, sonde.config.call, sonde.config.udpfeed.symbol); + char *str = aprs_senddata(s, sonde.config.call, sonde.config.objcall, sonde.config.udpfeed.symbol); if (connected) { char raw[201]; int rawlen = aprsstr_mon2raw(str, raw, APRS_MAXLEN); @@ -3232,9 +3233,9 @@ void aprs_station_update() { return; } } - Serial.printf("Really updating!! (bcall is %s)", sonde.config.bcall); + Serial.printf("Really updating!! (objcall is %s)", sonde.config.objcall); time_last_aprs_update = time_now; - char *bcn = aprs_send_beacon(sonde.config.bcall, lat, lon, "/O"); + char *bcn = aprs_send_beacon(sonde.config.call, lat, lon, sonde.config.beaconsym + ((chase==SH_LOC_CHASE)?2:0)); if ( tcpclient.disconnected()) { tcpclient.connect(sonde.config.tcpfeed.host, sonde.config.tcpfeed.port); } diff --git a/RX_FSK/data/cfg.js b/RX_FSK/data/cfg.js index 3032d5a..9ef3bc5 100644 --- a/RX_FSK/data/cfg.js +++ b/RX_FSK/data/cfg.js @@ -43,7 +43,8 @@ var cfgs = [ [ "tcp.host", "APRS TCP host"], [ "tcp.port", "APRS TCP port"], [ "tcp.highrate", "Rate limit"], -[ "tcp.bcall", "APRS location beacon call"], +[ "tcp.objcall", "APRS object call"], +[ "tcp.beaconsym", "APRS tracker symbol"], [ "tcp.chase", "APRS location reporting (0=off, 1=fixed, 2=chase/GPS, 3=auto)"], [ "tcp.comment", "APRS location comment"], [ "", "MQTT data feed configuration", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/MQTT-configuration"], diff --git a/RX_FSK/data/config.txt b/RX_FSK/data/config.txt index 55cd737..aca7559 100644 --- a/RX_FSK/data/config.txt +++ b/RX_FSK/data/config.txt @@ -107,7 +107,8 @@ tcp.symbol=/O tcp.highrate=20 # send beacon (possibly with different call or SSID) tcp.chase=0 -tcp.bcall= +tcp.objcall= +tcp.beaconsym=/`/( tcp.comment= #-------------------------------# # mqtt settings diff --git a/RX_FSK/src/Sonde.h b/RX_FSK/src/Sonde.h index 350c877..5f56e6c 100644 --- a/RX_FSK/src/Sonde.h +++ b/RX_FSK/src/Sonde.h @@ -284,7 +284,8 @@ typedef struct st_rdzconfig { char call[10]; // APRS callsign int passcode; // APRS passcode int chase; - char bcall[10]; // APRS position beacon call + char objcall[10]; // APRS object call (for wettersonde.net) + char beaconsym[5]; // APRS beacon symbol char comment[32]; struct st_feedinfo udpfeed; // target for AXUDP messages struct st_feedinfo tcpfeed; // target for APRS-IS TCP connections diff --git a/RX_FSK/src/aprs.cpp b/RX_FSK/src/aprs.cpp index 2894204..18ec720 100644 --- a/RX_FSK/src/aprs.cpp +++ b/RX_FSK/src/aprs.cpp @@ -290,13 +290,14 @@ char *aprs_send_beacon(const char *usercall, float lat, float lon, const char *s return b; } -char *aprs_senddata(SondeInfo *si, const char *usercall, const char *sym) { +char *aprs_senddata(SondeInfo *si, const char *usercall, const char *objcall, const char *sym) { SondeData *s = &(si->d); *b=0; - aprsstr_append(b, usercall); + aprsstr_append(b, *objcall ? objcall : usercall); aprsstr_append(b, ">"); // const char *destcall="APRARX,SONDEGATE,TCPIP,qAR,oh3bsg"; aprsstr_append(b, destcall); + if(*objcall) aprsstr_append(b, usercall); // uncompressed aprsstr_append(b, ":;"); char tmp[10]; diff --git a/RX_FSK/src/aprs.h b/RX_FSK/src/aprs.h index 36a9bef..3cdb1c4 100644 --- a/RX_FSK/src/aprs.h +++ b/RX_FSK/src/aprs.h @@ -9,7 +9,7 @@ void aprs_gencrctab(void); int aprsstr_mon2raw(const char *mon, char raw[], int raw_len); int aprsstr_mon2kiss(const char *mon, char raw[], int raw_len); char *aprs_send_beacon(const char *call, float lat, float lon, const char *sym); -char *aprs_senddata(SondeInfo *s, const char *usercall, const char *sym); +char *aprs_senddata(SondeInfo *s, const char *usercall, const char *objcall, const char *sym); #endif