kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
M10: extract #sat; M20: upload to sondehub without #sat
rodzic
85930bc3f7
commit
7f2b9ef611
|
@ -3122,7 +3122,8 @@ void sondehub_send_data(WiFiClient *client, SondeInfo *s, struct st_sondehub *co
|
|||
if (*s->ser == 0) return; // Don't send anything without serial number
|
||||
if (((int)s->lat == 0) && ((int)s->lon == 0)) return; // Sometimes these values are zeroes. Don't send those to the sondehub
|
||||
if ((int)s->alt > 50000) return; // If alt is too high don't send to SondeHub
|
||||
if ((int)s->sats < 4) return; // If not enough sats don't send to SondeHub
|
||||
// M20 data does not include #sat information
|
||||
if ( s->type!=STYPE_M20 && (int)s->sats < 4) return; // If not enough sats don't send to SondeHub
|
||||
|
||||
// If not connected to sondehub, try reconnecting.
|
||||
// TODO: do this outside of main loop
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const char *version_name = "rdzTTGOsonde";
|
||||
const char *version_id = "devel20210630";
|
||||
const char *version_id = "devel20210726";
|
||||
const int SPIFFS_MAJOR=2;
|
||||
const int SPIFFS_MINOR=11;
|
||||
|
|
|
@ -319,6 +319,7 @@ int M10M20::decodeframeM10(uint8_t *data) {
|
|||
float vn = getint16(data+6)*VMUL;
|
||||
sonde.si()->vs = getint16(data+8) * VMUL;
|
||||
sonde.si()->hs = sqrt(ve*ve+vn*vn);
|
||||
sonde.si()->sats = data[30];
|
||||
float dir = atan2(vn, ve)*(1.0/RAD);
|
||||
if(dir<0) dir+=360;
|
||||
sonde.si()->dir = dir;
|
||||
|
|
Ładowanie…
Reference in New Issue