Added mobile location
This commit is contained in:
parent
b61f920e12
commit
547b08e3d7
|
|
@ -595,6 +595,7 @@ struct st_configitems config_list[] = {
|
|||
/* Sondehub v2 settings */
|
||||
{"", "Sondehub v2 settings", -5, NULL},
|
||||
{"sondehub.active", "Sondehub reporting active", 0, &sonde.config.sondehub.active},
|
||||
{"sondehub.chase", "Sondehub chase location active", 0, &sonde.config.sondehub.chase},
|
||||
{"sondehub.host", "Sondehub host", 63, &sonde.config.sondehub.host},
|
||||
{"sondehub.callsign", "Callsign", 63, &sonde.config.sondehub.callsign},
|
||||
{"sondehub.lat", "Latitude", 19, &sonde.config.sondehub.lat},
|
||||
|
|
@ -3052,12 +3053,26 @@ void sondehub_send_data(WiFiClient *client, SondeInfo *s, struct st_sondehub *co
|
|||
);
|
||||
w += strlen(w);
|
||||
}
|
||||
sprintf(w,
|
||||
"\"uploader_position\": [ %s, %s, %s ],"
|
||||
"\"uploader_antenna\": \"%s\""
|
||||
"}]",
|
||||
conf->lat, conf->lon, conf->alt, conf->antenna
|
||||
);
|
||||
|
||||
if (conf->chase == 0) {
|
||||
sprintf(w,
|
||||
"\"uploader_position\": [ %s, %s, %s ],"
|
||||
"\"uploader_antenna\": \"%s\""
|
||||
"}]",
|
||||
conf->lat, conf->lon, conf->alt, conf->antenna
|
||||
);
|
||||
}
|
||||
else if (gpsPos.valid) {
|
||||
sprintf(w,
|
||||
"\"uploader_position\": [ %.6f, %.6f, %d ],"
|
||||
"\"mobile\": \"true\""
|
||||
"}]",
|
||||
gpsPos.lat, gpsPos.lon, gpsPos.alt
|
||||
);
|
||||
}
|
||||
else {
|
||||
sprintf(w, "}]");
|
||||
}
|
||||
|
||||
client->println("PUT /sondes/telemetry HTTP/1.1");
|
||||
client->print("Host: ");
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ mqtt.prefix=rdz_sonde_server/
|
|||
#-------------------------------#
|
||||
# Sondehub v2 DB settings
|
||||
sondehub.active=0
|
||||
sondehub.chase=0
|
||||
sondehub.host=api.v2.sondehub.org
|
||||
sondehub.callsign=CHANGEME_RDZTTGO
|
||||
sondehub.lat=null
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const char *version_name = "rdzTTGOsonde";
|
||||
const char *version_id = "devel20210524";
|
||||
const char *version_id = "devel20210524-1";
|
||||
const int SPIFFS_MAJOR=2;
|
||||
const int SPIFFS_MINOR=11;
|
||||
|
|
|
|||
|
|
@ -376,6 +376,8 @@ void Sonde::setConfig(const char *cfg) {
|
|||
strncpy(config.mqtt.prefix, val, 63);
|
||||
} else if(strcmp(cfg, "sondehub.active")==0) {
|
||||
config.sondehub.active = atoi(val);
|
||||
} else if(strcmp(cfg,"sondehub.chase")==0) {
|
||||
config.sondehub.chase = atoi(val);
|
||||
} else if(strcmp(cfg, "sondehub.host")==0) {
|
||||
strncpy(config.sondehub.host, val, 63);
|
||||
} else if(strcmp(cfg, "sondehub.callsign")==0) {
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ struct st_mqtt {
|
|||
|
||||
struct st_sondehub {
|
||||
int active;
|
||||
int chase;
|
||||
char host[64];
|
||||
char callsign[64];
|
||||
char lat[20];
|
||||
|
|
|
|||
Loading…
Reference in New Issue