Updates to support SondeSeeker
Updates to support SondeSeeker
This commit is contained in:
parent
944e486f12
commit
848aaad7ae
|
|
@ -695,6 +695,7 @@ void setupConfigData() {
|
|||
while (file.available()) {
|
||||
String line = readLine(file); //file.readStringUntil('\n');
|
||||
sonde.setConfig(line.c_str());
|
||||
LOG_D(TAG, "Processing a=%s",line.c_str());
|
||||
}
|
||||
sonde.checkConfig(); // eliminate invalid entries
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ var cfgs = [
|
|||
[ "sondehub.chase", "SondeHub location reporting (0=off, 1=fixed, 2=chase/GPS, 3=auto)"],
|
||||
[ "sondehub.host", "SondeHub host (DO NOT CHANGE)"],
|
||||
[ "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 frequency import", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/SondeHub-import" ],
|
||||
[ "sondehub.fiactive", "SondeHub frequency import active (0=disabled, 1=active)" ],
|
||||
|
|
@ -110,7 +110,7 @@ var cfgs = [
|
|||
];
|
||||
|
||||
var tocheck = ["sd.cs", "sd.miso", "sd.mosi", "sd.clk", "oled_sda", "oled_scl", "oled_rst", "tft_rs", "tft_cs", "tft_spifreq", "button_pin", "button2_pin",
|
||||
"led_pout", "gps_rxd", "gps_txd", "batt_adc", "sx1278_ss", "sx1278_miso", "sx1278_mosi", "sx1278_sck", "ss.host", "cm.host"];
|
||||
"led_pout", "gps_rxd", "gps_txd", "batt_adc", "sx1278_ss", "sx1278_miso", "sx1278_mosi", "sx1278_sck"];
|
||||
var alloweddups = [ ["sd.mosi", "oled_sda"], ["sd.clk", "oled_scl" ] ];
|
||||
|
||||
function isAllowedDup(nameA, nameB) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ marker=1
|
|||
# APRS settings
|
||||
#-------------------------------#
|
||||
call=N0CALL
|
||||
passcode=-1
|
||||
passcode=12345
|
||||
#-------------------------------#
|
||||
# Sonde specific settings: bandwidth
|
||||
# valid values: 3100, 3900, 5200, 6300, 7800, 10400, 12500,
|
||||
|
|
@ -147,9 +147,9 @@ sondehub.fiinterval=60
|
|||
sondehub.fimaxdist=150
|
||||
sondehub.fimaxage=6
|
||||
#-------------------------------#
|
||||
# SondeSeeker settings
|
||||
# Sondeseeker settings
|
||||
#-------------------------------#
|
||||
ss.active=1
|
||||
ss.active=0
|
||||
ss.host=224.0.0.0
|
||||
ss.port=62655
|
||||
#-------------------------------#
|
||||
|
|
|
|||
|
|
@ -344,9 +344,9 @@ void Sonde::defaultConfig() {
|
|||
strcpy(config.mqtt.prefix, "rdz_sonde_server/");
|
||||
config.mqtt.report_interval = 60000;
|
||||
|
||||
config.ss.active = 0;
|
||||
config.ss.port = 1883;
|
||||
strcpy(config.ss.host, "224.0.0.0");
|
||||
config.ss.active = 1;
|
||||
strcpy(config.ss.host, "255.255.255.255");
|
||||
config.ss.port = 62655;
|
||||
}
|
||||
|
||||
extern struct st_configitems config_list[];
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ struct st_sondehub {
|
|||
char callsign[64];
|
||||
char antenna[64];
|
||||
char email[64];
|
||||
int fiactive;
|
||||
int fiactive;
|
||||
int fiinterval;
|
||||
int fimaxdist;
|
||||
double fimaxage;
|
||||
|
|
@ -305,7 +305,7 @@ typedef struct st_rdzconfig {
|
|||
int noisefloor; // for spectrum display
|
||||
char mdnsname[15]; // mDNS-Name, defaults to rdzsonde
|
||||
// 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_rs92config rs92;
|
||||
struct st_dfmconfig dfm;
|
||||
|
|
@ -315,14 +315,14 @@ typedef struct st_rdzconfig {
|
|||
// data feed configuration
|
||||
// for now, one feed for each type is enough, but might get extended to more?
|
||||
char call[10]; // APRS callsign
|
||||
int passcode; // APRS passcode
|
||||
int passcode; // APRS passcode
|
||||
int chase;
|
||||
char objcall[10]; // APRS object call (for wettersonde.net)
|
||||
char beaconsym[5]; // APRS beacon symbol
|
||||
char comment[32];
|
||||
struct st_axudpinfo udpfeed; // target for AXUDP messages
|
||||
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_aprsinfo tcpfeed; // target for APRS-IS TCP connections
|
||||
struct st_kisstnc kisstnc; // target for KISS TNC (via TCP, mainly for APRSdroid)
|
||||
struct st_mqtt mqtt;
|
||||
struct st_sondehub sondehub;
|
||||
struct st_cm cm;
|
||||
|
|
@ -342,7 +342,6 @@ struct st_configitems {
|
|||
extern struct st_configitems config_list[];
|
||||
extern const int N_CONFIG;
|
||||
|
||||
|
||||
#define MAXSONDE 50
|
||||
|
||||
extern int fingerprintValue[];
|
||||
|
|
@ -398,13 +397,12 @@ public:
|
|||
void updateDisplayIP();
|
||||
void updateDisplay();
|
||||
void clearDisplay();
|
||||
void dispsavectlON();
|
||||
void dispsavectlOFF(int rxactive);
|
||||
void dispsavectlON();
|
||||
void dispsavectlOFF(int rxactive);
|
||||
|
||||
void setIP(String ip, bool isAP);
|
||||
};
|
||||
|
||||
extern Sonde sonde;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "conn-sondeseeker.h"
|
||||
#include <WiFiUdp.h>
|
||||
#include "posinfo.h"
|
||||
#include "json.h"
|
||||
|
||||
extern const char *sondeTypeStrSH[];
|
||||
extern WiFiUDP udp;
|
||||
|
|
@ -18,52 +20,16 @@ void ConnSondeseeker::netshutdown() {
|
|||
|
||||
void ConnSondeseeker::updateSonde(SondeInfo *si) {
|
||||
char buf[1024];
|
||||
struct tm tim;
|
||||
|
||||
if(!sonde.config.ss.active) return;
|
||||
strcpy(buf, "{\"sonde\": {");
|
||||
sonde2json(buf + strlen(buf), 1024, si);
|
||||
strcat(buf, "}}");
|
||||
|
||||
time_t t = si->d.time;
|
||||
gmtime_r(&t, &tim);
|
||||
uint8_t realtype = si->type;
|
||||
if (TYPE_IS_METEO(realtype)) {
|
||||
realtype = si->d.subtype == 1 ? STYPE_M10 : STYPE_M20;
|
||||
}
|
||||
char prefix[10];
|
||||
if(realtype == STYPE_RS41) {
|
||||
prefix[0] = 0;
|
||||
}
|
||||
else {
|
||||
strncpy(prefix, sondeTypeStrSH[realtype], 10);
|
||||
strcat(prefix, "-");
|
||||
}
|
||||
sprintf(buf, "{ \"type\": \"PAYLOAD_SUMMARY\","
|
||||
"\"callsign\": \"%s%s\","
|
||||
"\"latitude\": %.5f,"
|
||||
"\"longitude\": %.5f,"
|
||||
"\"altitude\": %d,"
|
||||
"\"speed\": %d,"
|
||||
"\"heading\": %d,"
|
||||
"\"time\": \"%02d:%02d:%02d\","
|
||||
"\"model\": \"%s\","
|
||||
"\"freq\": \"%.3f MHz\"",
|
||||
prefix,
|
||||
si->d.ser,
|
||||
si->d.lat,
|
||||
si->d.lon,
|
||||
(int)si->d.alt,
|
||||
(int)(si->d.hs * 1.9438445), // m/s into knots
|
||||
(int)si->d.dir,
|
||||
tim.tm_hour, tim.tm_min, tim.tm_sec,
|
||||
sondeTypeStrSH[realtype],
|
||||
si->freq);
|
||||
if( !isnan(si->d.temperature) ) {
|
||||
sprintf(buf + strlen(buf), ", \"temp\": %.1f", si->d.temperature);
|
||||
}
|
||||
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();
|
||||
udp.endPacket();
|
||||
|
||||
}
|
||||
|
||||
void ConnSondeseeker::updateStation(PosInfo *pi) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue