Merge 848aaad7ae into 881123575b
This commit is contained in:
commit
6a0041078f
|
|
@ -42,6 +42,9 @@
|
||||||
|
|
||||||
|
|
||||||
/* Data exchange connectors */
|
/* Data exchange connectors */
|
||||||
|
#if FEATURE_SONDESEEKER
|
||||||
|
#include "src/conn-sondeseeker.h"
|
||||||
|
#endif
|
||||||
#if FEATURE_CHASEMAPPER
|
#if FEATURE_CHASEMAPPER
|
||||||
#include "src/conn-chasemapper.h"
|
#include "src/conn-chasemapper.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -71,6 +74,9 @@ Conn *connectors[] = { &connSystem,
|
||||||
#if FEATURE_CHASEMAPPER
|
#if FEATURE_CHASEMAPPER
|
||||||
&connChasemapper,
|
&connChasemapper,
|
||||||
#endif
|
#endif
|
||||||
|
#if FEATURE_SONDESEEKER
|
||||||
|
&connSondeseeker,
|
||||||
|
#endif
|
||||||
#if FEATURE_MQTT
|
#if FEATURE_MQTT
|
||||||
&connMQTT,
|
&connMQTT,
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -689,6 +695,7 @@ void setupConfigData() {
|
||||||
while (file.available()) {
|
while (file.available()) {
|
||||||
String line = readLine(file); //file.readStringUntil('\n');
|
String line = readLine(file); //file.readStringUntil('\n');
|
||||||
sonde.setConfig(line.c_str());
|
sonde.setConfig(line.c_str());
|
||||||
|
LOG_D(TAG, "Processing a=%s",line.c_str());
|
||||||
}
|
}
|
||||||
sonde.checkConfig(); // eliminate invalid entries
|
sonde.checkConfig(); // eliminate invalid entries
|
||||||
}
|
}
|
||||||
|
|
@ -753,6 +760,12 @@ struct st_configitems config_list[] = {
|
||||||
{"cm.host", 63, &sonde.config.cm.host},
|
{"cm.host", 63, &sonde.config.cm.host},
|
||||||
{"cm.port", 0, &sonde.config.cm.port},
|
{"cm.port", 0, &sonde.config.cm.port},
|
||||||
#endif
|
#endif
|
||||||
|
#if FEATURE_SONDESEEKER
|
||||||
|
/* Sondeseeker settings */
|
||||||
|
{"ss.active", -3, &sonde.config.ss.active},
|
||||||
|
{"ss.host", 63, &sonde.config.ss.host},
|
||||||
|
{"ss.port", 0, &sonde.config.ss.port},
|
||||||
|
#endif
|
||||||
#if FEATURE_MQTT
|
#if FEATURE_MQTT
|
||||||
/* MQTT */
|
/* MQTT */
|
||||||
{"mqtt.active", 0, &sonde.config.mqtt.active},
|
{"mqtt.active", 0, &sonde.config.mqtt.active},
|
||||||
|
|
@ -2311,6 +2324,9 @@ void loopDecoder() {
|
||||||
#endif
|
#endif
|
||||||
#if FEATURE_CHASEMAPPER
|
#if FEATURE_CHASEMAPPER
|
||||||
connChasemapper.updateSonde( s );
|
connChasemapper.updateSonde( s );
|
||||||
|
#endif
|
||||||
|
#if FEATURE_SONDESEEKER
|
||||||
|
connSondeseeker.updateSonde( s );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if FEATURE_SONDEHUB
|
#if FEATURE_SONDEHUB
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,16 @@ var cfgs = [
|
||||||
[ "cm.active", "Chasemapper active (0=disabled, 1=active)"],
|
[ "cm.active", "Chasemapper active (0=disabled, 1=active)"],
|
||||||
[ "cm.host", "Chasemapper UDP host"],
|
[ "cm.host", "Chasemapper UDP host"],
|
||||||
[ "cm.port", "Chasemapper UDP port"],
|
[ "cm.port", "Chasemapper UDP port"],
|
||||||
|
[ "", "SondeSeeker settings", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/Sondeseeker-configuration"],
|
||||||
|
[ "ss.active", "Sondeseeker active (0=disabled, 1=active)"],
|
||||||
|
[ "ss.host", "Sondeseeker UDP host"],
|
||||||
|
[ "ss.port", "Sondeseeker UDP port"],
|
||||||
[ "", "SondeHub settings", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/SondeHub-settings"],
|
[ "", "SondeHub settings", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/SondeHub-settings"],
|
||||||
[ "sondehub.active", "SondeHub reporting (0=disabled, 1=active)"],
|
[ "sondehub.active", "SondeHub reporting (0=disabled, 1=active)"],
|
||||||
[ "sondehub.chase", "SondeHub location reporting (0=off, 1=fixed, 2=chase/GPS, 3=auto)"],
|
[ "sondehub.chase", "SondeHub location reporting (0=off, 1=fixed, 2=chase/GPS, 3=auto)"],
|
||||||
[ "sondehub.host", "SondeHub host (DO NOT CHANGE)"],
|
[ "sondehub.host", "SondeHub host (DO NOT CHANGE)"],
|
||||||
[ "sondehub.callsign", "Callsign"],
|
[ "sondehub.callsign", "Callsign"],
|
||||||
[ "sondehub.antenna", "Antenna (optional, visisble on SondeHub tracker)"],
|
[ "sondehub.antenna", "Antenna (optional, visible on SondeHub tracker)"],
|
||||||
[ "sondehub.email", "SondeHub email (optional, only used to contact in case of upload errors)"],
|
[ "sondehub.email", "SondeHub email (optional, only used to contact in case of upload errors)"],
|
||||||
[ "", "SondeHub frequency import", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/SondeHub-import" ],
|
[ "", "SondeHub frequency import", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/SondeHub-import" ],
|
||||||
[ "sondehub.fiactive", "SondeHub frequency import active (0=disabled, 1=active)" ],
|
[ "sondehub.fiactive", "SondeHub frequency import active (0=disabled, 1=active)" ],
|
||||||
|
|
@ -97,7 +101,7 @@ var cfgs = [
|
||||||
[ "power_pout", "Power control port"],
|
[ "power_pout", "Power control port"],
|
||||||
[ "led_pout", "LED output port"],
|
[ "led_pout", "LED output port"],
|
||||||
[ "gps_rxd", "GPS RXD pin (-1 to disable)"],
|
[ "gps_rxd", "GPS RXD pin (-1 to disable)"],
|
||||||
[ "gps_txd", "GPS TXD pin (optional, only for GSP reset)"],
|
[ "gps_txd", "GPS TXD pin (optional, only for GPS reset)"],
|
||||||
[ "batt_adc", "Battery measurement pin"],
|
[ "batt_adc", "Battery measurement pin"],
|
||||||
[ "sx1278_ss", "SX1278 SS"],
|
[ "sx1278_ss", "SX1278 SS"],
|
||||||
[ "sx1278_miso", "SX1278 MISO"],
|
[ "sx1278_miso", "SX1278 MISO"],
|
||||||
|
|
|
||||||
|
|
@ -147,5 +147,11 @@ sondehub.fiinterval=60
|
||||||
sondehub.fimaxdist=150
|
sondehub.fimaxdist=150
|
||||||
sondehub.fimaxage=6
|
sondehub.fimaxage=6
|
||||||
#-------------------------------#
|
#-------------------------------#
|
||||||
|
# Sondeseeker settings
|
||||||
|
#-------------------------------#
|
||||||
|
ss.active=0
|
||||||
|
ss.host=224.0.0.0
|
||||||
|
ss.port=62655
|
||||||
|
#-------------------------------#
|
||||||
# EOF
|
# EOF
|
||||||
#-------------------------------#
|
#-------------------------------#
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#define FEATURE_MQTT 1
|
#define FEATURE_MQTT 1
|
||||||
#define FEATURE_SDCARD 1
|
#define FEATURE_SDCARD 1
|
||||||
#define FEATURE_APRS 1
|
#define FEATURE_APRS 1
|
||||||
|
#define FEATURE_SONDESEEKER 1
|
||||||
|
|
||||||
|
|
||||||
// Additional optional components
|
// Additional optional components
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ void Sonde::defaultConfig() {
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
config.noisefloor = -125;
|
config.noisefloor = -125;
|
||||||
strcpy(config.call,"NOCALL");
|
strcpy(config.call,"N0CALL");
|
||||||
config.passcode = -1;
|
config.passcode = -1;
|
||||||
strcpy(config.mdnsname, "rdzsonde");
|
strcpy(config.mdnsname, "rdzsonde");
|
||||||
config.maxsonde=15;
|
config.maxsonde=15;
|
||||||
|
|
@ -343,6 +343,10 @@ void Sonde::defaultConfig() {
|
||||||
strcpy(config.mqtt.password, "/0");
|
strcpy(config.mqtt.password, "/0");
|
||||||
strcpy(config.mqtt.prefix, "rdz_sonde_server/");
|
strcpy(config.mqtt.prefix, "rdz_sonde_server/");
|
||||||
config.mqtt.report_interval = 60000;
|
config.mqtt.report_interval = 60000;
|
||||||
|
|
||||||
|
config.ss.active = 1;
|
||||||
|
strcpy(config.ss.host, "255.255.255.255");
|
||||||
|
config.ss.port = 62655;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern struct st_configitems config_list[];
|
extern struct st_configitems config_list[];
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,12 @@ struct st_cm {
|
||||||
int port;
|
int port;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct st_ss {
|
||||||
|
int active;
|
||||||
|
char host[64];
|
||||||
|
int port;
|
||||||
|
};
|
||||||
|
|
||||||
struct st_sondehub {
|
struct st_sondehub {
|
||||||
int active;
|
int active;
|
||||||
int chase;
|
int chase;
|
||||||
|
|
@ -236,7 +242,7 @@ struct st_sondehub {
|
||||||
char callsign[64];
|
char callsign[64];
|
||||||
char antenna[64];
|
char antenna[64];
|
||||||
char email[64];
|
char email[64];
|
||||||
int fiactive;
|
int fiactive;
|
||||||
int fiinterval;
|
int fiinterval;
|
||||||
int fimaxdist;
|
int fimaxdist;
|
||||||
double fimaxage;
|
double fimaxage;
|
||||||
|
|
@ -299,7 +305,7 @@ typedef struct st_rdzconfig {
|
||||||
int noisefloor; // for spectrum display
|
int noisefloor; // for spectrum display
|
||||||
char mdnsname[15]; // mDNS-Name, defaults to rdzsonde
|
char mdnsname[15]; // mDNS-Name, defaults to rdzsonde
|
||||||
// receiver configuration
|
// receiver configuration
|
||||||
int freqofs; // frequency offset (tuner config = rx frequency + freqofs) in Hz
|
int freqofs; // frequency offset (tuner config = rx frequency + freqofs) in Hz
|
||||||
struct st_rs41config rs41; // configuration options specific for RS41 receiver
|
struct st_rs41config rs41; // configuration options specific for RS41 receiver
|
||||||
struct st_rs92config rs92;
|
struct st_rs92config rs92;
|
||||||
struct st_dfmconfig dfm;
|
struct st_dfmconfig dfm;
|
||||||
|
|
@ -309,17 +315,18 @@ typedef struct st_rdzconfig {
|
||||||
// data feed configuration
|
// data feed configuration
|
||||||
// for now, one feed for each type is enough, but might get extended to more?
|
// for now, one feed for each type is enough, but might get extended to more?
|
||||||
char call[10]; // APRS callsign
|
char call[10]; // APRS callsign
|
||||||
int passcode; // APRS passcode
|
int passcode; // APRS passcode
|
||||||
int chase;
|
int chase;
|
||||||
char objcall[10]; // APRS object call (for wettersonde.net)
|
char objcall[10]; // APRS object call (for wettersonde.net)
|
||||||
char beaconsym[5]; // APRS beacon symbol
|
char beaconsym[5]; // APRS beacon symbol
|
||||||
char comment[32];
|
char comment[32];
|
||||||
struct st_axudpinfo udpfeed; // target for AXUDP messages
|
struct st_axudpinfo udpfeed; // target for AXUDP messages
|
||||||
struct st_aprsinfo tcpfeed; // target for APRS-IS TCP connections
|
struct st_aprsinfo tcpfeed; // target for APRS-IS TCP connections
|
||||||
struct st_kisstnc kisstnc; // target for KISS TNC (via TCP, mainly for APRSdroid)
|
struct st_kisstnc kisstnc; // target for KISS TNC (via TCP, mainly for APRSdroid)
|
||||||
struct st_mqtt mqtt;
|
struct st_mqtt mqtt;
|
||||||
struct st_sondehub sondehub;
|
struct st_sondehub sondehub;
|
||||||
struct st_cm cm;
|
struct st_cm cm;
|
||||||
|
struct st_ss ss;
|
||||||
struct st_sdcard sd;
|
struct st_sdcard sd;
|
||||||
} RDZConfig;
|
} RDZConfig;
|
||||||
|
|
||||||
|
|
@ -335,7 +342,6 @@ struct st_configitems {
|
||||||
extern struct st_configitems config_list[];
|
extern struct st_configitems config_list[];
|
||||||
extern const int N_CONFIG;
|
extern const int N_CONFIG;
|
||||||
|
|
||||||
|
|
||||||
#define MAXSONDE 50
|
#define MAXSONDE 50
|
||||||
|
|
||||||
extern int fingerprintValue[];
|
extern int fingerprintValue[];
|
||||||
|
|
@ -391,13 +397,12 @@ public:
|
||||||
void updateDisplayIP();
|
void updateDisplayIP();
|
||||||
void updateDisplay();
|
void updateDisplay();
|
||||||
void clearDisplay();
|
void clearDisplay();
|
||||||
void dispsavectlON();
|
void dispsavectlON();
|
||||||
void dispsavectlOFF(int rxactive);
|
void dispsavectlOFF(int rxactive);
|
||||||
|
|
||||||
void setIP(String ip, bool isAP);
|
void setIP(String ip, bool isAP);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Sonde sonde;
|
extern Sonde sonde;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
#include "../features.h"
|
||||||
|
#if FEATURE_SONDESEEKER
|
||||||
|
|
||||||
|
#include "conn-sondeseeker.h"
|
||||||
|
#include <WiFiUdp.h>
|
||||||
|
#include "posinfo.h"
|
||||||
|
#include "json.h"
|
||||||
|
|
||||||
|
extern const char *sondeTypeStrSH[];
|
||||||
|
extern WiFiUDP udp;
|
||||||
|
|
||||||
|
void ConnSondeseeker::init() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConnSondeseeker::netsetup() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConnSondeseeker::netshutdown() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConnSondeseeker::updateSonde(SondeInfo *si) {
|
||||||
|
char buf[1024];
|
||||||
|
|
||||||
|
strcpy(buf, "{\"sonde\": {");
|
||||||
|
sonde2json(buf + strlen(buf), 1024, si);
|
||||||
|
strcat(buf, "}}");
|
||||||
|
|
||||||
|
Serial.printf("Sending SondeSeeker json: %s\n", buf);
|
||||||
|
udp.beginPacket(sonde.config.ss.host, sonde.config.ss.port);
|
||||||
|
udp.write((const uint8_t *)buf, strlen(buf));
|
||||||
|
udp.endPacket();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConnSondeseeker::updateStation(PosInfo *pi) {
|
||||||
|
}
|
||||||
|
|
||||||
|
String ConnSondeseeker::getStatus() {
|
||||||
|
if(!sonde.config.ss.active) return String("disabled");
|
||||||
|
char info[100];
|
||||||
|
snprintf(info, 100, "active [%s:%d]", sonde.config.ss.host, sonde.config.ss.port);
|
||||||
|
return String(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
String ConnSondeseeker::getName() {
|
||||||
|
return String("SondeSeeker");
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnSondeseeker connSondeseeker;
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
#ifndef _SONDESEEKER_H
|
||||||
|
#define _SONDESEEKER_H
|
||||||
|
|
||||||
|
#include "Sonde.h"
|
||||||
|
#include "conn.h"
|
||||||
|
|
||||||
|
class ConnSondeseeker : public Conn {
|
||||||
|
public:
|
||||||
|
void init();
|
||||||
|
void netsetup();
|
||||||
|
void netshutdown();
|
||||||
|
void updateSonde( SondeInfo *si );
|
||||||
|
void updateStation( PosInfo *pi );
|
||||||
|
String getStatus();
|
||||||
|
String getName();
|
||||||
|
};
|
||||||
|
|
||||||
|
extern ConnSondeseeker connSondeseeker;
|
||||||
|
|
||||||
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue