kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
Merge branch 'dl9rdz:devel' into devel
commit
c7bd7a73ec
|
@ -159,6 +159,9 @@ String processor(const String& var) {
|
|||
snprintf(tmpstr, 128, "Fingerprint %d (%s)", sonde.fingerprint, fpstr);
|
||||
return String(tmpstr);
|
||||
}
|
||||
if (var == "EPHSTATE") {
|
||||
return String(ephtxt[ephstate]);
|
||||
}
|
||||
return String();
|
||||
}
|
||||
|
||||
|
@ -1082,7 +1085,7 @@ void addSondeStatusKML(char *ptr, int i)
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf(ptr + strlen(ptr), "<Placemark id=\"%s\"><name>%s</name><Point><coordinates>%.6f,%.6f,%.0f</coordinates></Point><description>%3.3f MHz, Type: %s, h=%.0fm</description></Placemark>",
|
||||
sprintf(ptr + strlen(ptr), "<Placemark id=\"%s\"><name>%s</name><Point><altitudeMode>absolute</altitudeMode><coordinates>%.6f,%.6f,%.0f</coordinates></Point><description>%3.3f MHz, Type: %s, h=%.0fm</description></Placemark>",
|
||||
s->id, s->id,
|
||||
s->lon, s->lat, s->alt,
|
||||
s->freq, sondeTypeStr[s->type], s->alt);
|
||||
|
@ -2838,6 +2841,7 @@ void loopWifiScan() {
|
|||
}
|
||||
if (hasRS92) {
|
||||
geteph();
|
||||
if(ephstate==EPH_PENDING) ephstate=EPH_ERROR;
|
||||
get_eph("/brdc");
|
||||
}
|
||||
delay(3000);
|
||||
|
@ -3120,7 +3124,7 @@ void sondehub_station_update(WiFiClient *client, struct st_sondehub *conf) {
|
|||
w += strlen(w);
|
||||
|
||||
// Only send email if provided
|
||||
if (conf->email != '\0') {
|
||||
if (strlen(conf->email) != 0) {
|
||||
sprintf(w,
|
||||
"\"uploader_contact_email\": \"%s\",",
|
||||
conf->email);
|
||||
|
@ -3128,7 +3132,7 @@ void sondehub_station_update(WiFiClient *client, struct st_sondehub *conf) {
|
|||
}
|
||||
|
||||
// Only send antenna if provided
|
||||
if (conf->antenna != '\0') {
|
||||
if (strlen(conf->antenna) != 0) {
|
||||
sprintf(w,
|
||||
"\"uploader_antenna\": \"%s\",",
|
||||
conf->antenna);
|
||||
|
@ -3338,15 +3342,15 @@ void sondehub_send_data(WiFiClient * client, SondeInfo * s, struct st_sondehub *
|
|||
// Only send temp & humidity if provided
|
||||
if (((int)s->temperature != 0) && ((int)s->relativeHumidity != 0)) {
|
||||
sprintf(w,
|
||||
"\"temp\": %.1f,"
|
||||
"\"humidity\": %.1f,",
|
||||
"\"temp\": %.3f,"
|
||||
"\"humidity\": %.3f,",
|
||||
float(s->temperature), float(s->relativeHumidity)
|
||||
);
|
||||
w += strlen(w);
|
||||
}
|
||||
|
||||
// Only send antenna if provided
|
||||
if (conf->antenna != '\0') {
|
||||
if (strlen(conf->antenna) != 0) {
|
||||
sprintf(w,
|
||||
"\"uploader_antenna\": \"%s\",",
|
||||
conf->antenna);
|
||||
|
|
|
@ -65,6 +65,8 @@
|
|||
<br>
|
||||
Autodetect info: %AUTODETECT_INFO%<br>
|
||||
<br>
|
||||
RS92 RINEX eph state: %EPHSTATE%<br>
|
||||
<br>
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
|
|
|
@ -12,6 +12,9 @@ extern WiFiClient client;
|
|||
|
||||
//static const char *ftpserver = "www.ngs.noaa.gov";
|
||||
char outbuf[128];
|
||||
uint8_t ephstate = EPH_NOTUSED;
|
||||
//enum EPHSTATE { EPH_NOTUSED, EPH_PENDING, EPH_TIMEERR, EPH_ERROR, EPH_EPHERROR, EPH_GOOD };
|
||||
char *ephtxt[] = { "Disabled", "Pending", "Time error", "Fetch error", "Read error", "Good" };
|
||||
|
||||
uint8_t getreply() {
|
||||
String s = client.readStringUntil('\n');
|
||||
|
@ -45,10 +48,12 @@ void writeFully(File &file, uint8_t *buf, size_t len)
|
|||
|
||||
void geteph() {
|
||||
// Set current time via network...
|
||||
ephstate = EPH_PENDING;
|
||||
struct tm tinfo;
|
||||
configTime(0, 0, "pool.ntp.org");
|
||||
bool ok = getLocalTime(&tinfo, 2000); // wait max 2 seconds to get current time via ntp
|
||||
if(!ok) {
|
||||
ephstate = EPH_TIMEERR;
|
||||
Serial.println("Failed to get current date/time");
|
||||
return;
|
||||
}
|
||||
|
@ -66,6 +71,7 @@ void geteph() {
|
|||
if(tsstr && strlen(tsstr)>=9) {
|
||||
if(strcmp(nowstr, ts.c_str())<=0) {
|
||||
Serial.println("local brdc is up to date\n");
|
||||
ephstate = EPH_GOOD;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -221,6 +227,7 @@ void geteph() {
|
|||
snprintf(buf, 16, "Done: %d B ",total);
|
||||
buf[16]=0;
|
||||
disp.rdis->drawString(0,5*dispys,buf);
|
||||
ephstate = EPH_GOOD;
|
||||
delay(1000);
|
||||
|
||||
free(obuf);
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
#include <inttypes.h>
|
||||
|
||||
#ifndef GETEPH_H
|
||||
#define GETEPH_H
|
||||
void geteph();
|
||||
|
||||
enum EPHSTATE { EPH_NOTUSED, EPH_PENDING, EPH_TIMEERR, EPH_ERROR, EPH_EPHERROR, EPH_GOOD };
|
||||
|
||||
extern uint8_t ephstate;
|
||||
extern char *ephtxt[];
|
||||
#endif
|
||||
|
|
|
@ -50,13 +50,14 @@
|
|||
#include <SPIFFS.h>
|
||||
#include "nav_gps_vel.h"
|
||||
#include "rs92gps.h"
|
||||
#include "geteph.h"
|
||||
#include "Sonde.h"
|
||||
|
||||
|
||||
|
||||
gpx_t gpx;
|
||||
|
||||
int option_verbose = 0, // ausfuehrliche Anzeige
|
||||
const int option_verbose = 0, // ausfuehrliche Anzeige
|
||||
option_raw = 1, // rohe Frames
|
||||
option_inv = 0, // invertiert Signal
|
||||
option_res = 0, // genauere Bitmessung
|
||||
|
@ -827,27 +828,33 @@ int naiv_2Dfix(int N, SAT_t sats[], double alt) {
|
|||
int get_GPSkoord(int N) {
|
||||
double lat, lon, alt, rx_cl_bias;
|
||||
double vH, vD, vU;
|
||||
double lat1s, lon1s, alt1s,
|
||||
lat0 , lon0 , alt0 , pos0_ecef[3];
|
||||
double pos_ecef[3], pos1s_ecef[3], dpos_ecef[3],
|
||||
double pos_ecef[3], dpos_ecef[3],
|
||||
vel_ecef[3], dvel_ecef[3];
|
||||
double gdop, gdop0 = 1000.0;
|
||||
//double hdop, vdop, pdop;
|
||||
int i0, i1, i2, i3, j, k, n;
|
||||
int i0, i1, i2, i3, j;
|
||||
int nav_ret = 0;
|
||||
int num = 0;
|
||||
SAT_t Sat_A[4];
|
||||
#if 0
|
||||
int k, n;
|
||||
double lat1s, lon1s, alt1s,
|
||||
lat0 , lon0 , alt0 , pos0_ecef[3];
|
||||
double pos1s_ecef[3];
|
||||
SAT_t Sat_B[12]; // N <= 12
|
||||
SAT_t Sat_B1s[12];
|
||||
SAT_t Sat_C[12]; // 11
|
||||
double diter = 0;
|
||||
int exN = -1;
|
||||
#endif
|
||||
double diter = 0;
|
||||
|
||||
#if 0
|
||||
if (option_vergps == 8) {
|
||||
fprintf(stdout, " sats: ");
|
||||
for (j = 0; j < N; j++) fprintf(stdout, "%02d ", prn[j]);
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
gpx.lat = gpx.lon = gpx.alt = 0;
|
||||
|
||||
|
@ -878,6 +885,7 @@ int get_GPSkoord(int N) {
|
|||
for (j=0; j<3; j++) vel_ecef[j] += dvel_ecef[j];
|
||||
get_GPSvel(lat, lon, vel_ecef, &vH, &vD, &vU);
|
||||
}
|
||||
#if 0
|
||||
if (option_vergps == 8) {
|
||||
// gdop = sqrt(DOP[0]+DOP[1]+DOP[2]+DOP[3]); // s.o.
|
||||
//hdop = sqrt(DOP[0]+DOP[1]);
|
||||
|
@ -898,6 +906,7 @@ int get_GPSkoord(int N) {
|
|||
fprintf(stdout, "\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else gdop = -1;
|
||||
|
||||
|
@ -921,6 +930,7 @@ int get_GPSkoord(int N) {
|
|||
}}}}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (option_vergps == 8 || option_vergps == 2) {
|
||||
|
||||
for (j = 0; j < N; j++) Sat_B[j] = sat[prn[j]];
|
||||
|
@ -1047,6 +1057,7 @@ int get_GPSkoord(int N) {
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
return num;
|
||||
}
|
||||
|
@ -1184,7 +1195,9 @@ void get_eph(const char *file) {
|
|||
if (ephs) {
|
||||
ephem = 1;
|
||||
almanac = 0;
|
||||
}
|
||||
} else {
|
||||
ephstate = EPH_EPHERROR;
|
||||
}
|
||||
Serial.printf("reading RNX done, result is %d, ephs=%p\n", ephem, ephs);
|
||||
if (!option_der) d_err = 1000;
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
|
||||
[platformio]
|
||||
src_dir = RX_FSK
|
||||
lib_dir = libraries
|
||||
lib_dir = RX_FSK
|
||||
data_dir = RX_FSK/data
|
||||
|
||||
[extra]
|
||||
lib_deps_builtin =
|
||||
SondeLib
|
||||
src
|
||||
lib_deps_external =
|
||||
olikraus/U8g2 @ ^2.28.8
|
||||
AXP202X_Library
|
||||
|
|
Ładowanie…
Reference in New Issue