kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
yet another fix for ftp eph
rodzic
3ddbebf2fc
commit
35156948cb
|
@ -1692,6 +1692,7 @@ void setup()
|
|||
int v = gpio_get_level((gpio_num_t)i);
|
||||
Serial.printf("%d:%d ", i, v);
|
||||
}
|
||||
Serial.printf("Test%1$s%1$s\n", "hello");
|
||||
|
||||
//NimBLEDevice::init("NimBLE-Arduino");
|
||||
//NimBLEServer* pServer = NimBLEDevice::createServer();;
|
||||
|
|
|
@ -28,6 +28,7 @@ const char *sondeTypeStr[NSondeTypes] = { "DFM ", "RS41", "RS92", "Mxx ", "M10 "
|
|||
const char *sondeTypeLongStr[NSondeTypes] = { "DFM (all)", "RS41", "RS92", "M10/M20", "M10 ", "M20 ", "MP3-H1" };
|
||||
const char sondeTypeChar[NSondeTypes] = { 'D', '4', 'R', 'M', 'M', '2', '3' };
|
||||
const char *manufacturer_string[]={"Graw", "Vaisala", "Vaisala", "Meteomodem", "Meteomodem", "Meteomodem", "Meteo-Radiy"};
|
||||
const char *DEFEPH="gssc.esa.int/gnss/data/daily/%1$04d/brdc/brdc%2$03d0.%3$02dn.gz";
|
||||
|
||||
int fingerprintValue[]={ 17, 31, 64, 4, 55, 48, 23, 128+23, 119, 128+119, -1 };
|
||||
const char *fingerprintText[]={
|
||||
|
@ -258,7 +259,7 @@ void Sonde::defaultConfig() {
|
|||
config.tcpfeed.port = 12345;
|
||||
config.tcpfeed.highrate = 10;
|
||||
config.kisstnc.active = 0;
|
||||
strcpy(config.ephftp,"igs.bkg.bund.de/IGS/BRDC/");
|
||||
strcpy(config.ephftp,DEFEPH);
|
||||
|
||||
config.mqtt.active = 0;
|
||||
strcpy(config.mqtt.id, "rdz_sonde_server");
|
||||
|
@ -278,6 +279,8 @@ void Sonde::checkConfig() {
|
|||
if(config.sondehub.fimaxage>48) config.sondehub.fimaxage = 48;
|
||||
if(config.sondehub.fimaxdist==0) config.sondehub.fimaxdist = 150;
|
||||
if(config.sondehub.fimaxage==0) config.sondehub.fimaxage = 2;
|
||||
// auto upgrade config to new version with format arguments in string
|
||||
if(!strchr(sonde.config.ephftp,'%')) strcpy(sonde.config.ephftp,DEFEPH);
|
||||
}
|
||||
void Sonde::setConfig(const char *cfg) {
|
||||
while(*cfg==' '||*cfg=='\t') cfg++;
|
||||
|
|
|
@ -282,7 +282,7 @@ typedef struct st_rdzconfig {
|
|||
struct st_dfmconfig dfm;
|
||||
struct st_m10m20config m10m20;
|
||||
struct st_mp3hconfig mp3h;
|
||||
char ephftp[40];
|
||||
char ephftp[80];
|
||||
// data feed configuration
|
||||
// for now, one feed for each type is enough, but might get extended to more?
|
||||
char call[10]; // APRS callsign
|
||||
|
|
|
@ -86,22 +86,25 @@ void geteph() {
|
|||
Serial.println("cannot open file\n");
|
||||
return;
|
||||
}
|
||||
char host[252];
|
||||
strcpy(host, sonde.config.ephftp);
|
||||
char *buf = strchr(host, '/');
|
||||
if(!buf) { Serial.println("Invalid FTP host config"); return; }
|
||||
*buf = 0;
|
||||
buf++;
|
||||
char host[100];
|
||||
char buf[200];
|
||||
char *ptr = strchr(sonde.config.ephftp, '/');
|
||||
if(!ptr) { Serial.println("Invalid FTP host config"); return; }
|
||||
int hlen = ptr - sonde.config.ephftp;
|
||||
strncpy(host, sonde.config.ephftp, hlen);
|
||||
host[hlen] = 0;
|
||||
snprintf(buf, 200, ptr+1, year, day, year-2000);
|
||||
uint8_t dispw, disph, dispxs, dispys;
|
||||
disp.rdis->getDispSize(&disph, &dispw, &dispxs, &dispys);
|
||||
disp.rdis->clear();
|
||||
disp.rdis->setFont(FONT_SMALL);
|
||||
disp.rdis->drawString(0, 0, host);
|
||||
// fetch rinex from server
|
||||
char *ptr = buf + strlen(buf);
|
||||
snprintf(ptr, 128, "%04d/%03d/brdc%03d0.%02dn.gz", year, day, day, year-2000);
|
||||
// char *ptr = buf + strlen(buf);
|
||||
// snprintf(ptr, 128, "%04d/%03d/brdc%03d0.%02dn.gz", year, day, day, year-2000);
|
||||
// snprintf(ptr, 128, "%04d/brdc/brdc%03d0.%02dn.gz", year, /*day,*/ day, year-2000);
|
||||
Serial.println("running geteph\n");
|
||||
disp.rdis->drawString(0, 1*dispys, ptr+9);
|
||||
disp.rdis->drawString(0, 1*dispys, buf+9);
|
||||
|
||||
if(!client.connect(host, 21)) {
|
||||
Serial.printf("FTP connection to %s failed\n", host);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const char *version_name = "rdzTTGOsonde";
|
||||
const char *version_id = "devel20230822";
|
||||
const char *version_id = "devel20230828";
|
||||
const int SPIFFS_MAJOR=2;
|
||||
const int SPIFFS_MINOR=17;
|
||||
|
|
Ładowanie…
Reference in New Issue