diff --git a/.travis/push.sh b/.travis/push.sh index 9e1d5d0..ff2e613 100755 --- a/.travis/push.sh +++ b/.travis/push.sh @@ -61,6 +61,8 @@ commit_website_files() { git add ${BRANCH}/update.ino.bin echo "${TRAVIS_COMMIT_MESSAGE}" >> ${BRANCH}/${VERSION}-changelog.txt git add ${BRANCH}/${VERSION}-changelog.txt + echo "
${VERSION}
" > ${BRANCH}/update-info.html + git add ${BRANCH}/update-info.html git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" } upload_files() { diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index d33f846..0df29b1 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -59,7 +59,19 @@ WiFiClient client; #define SONDEHUB_MOBILE_STATION_UPDATE_TIME (30*1000) // 30 sec WiFiClient shclient; // Sondehub v2 unsigned long time_last_update = 0; +/* SH_LOC_OFF: never send position information to SondeHub + SH_LOC_FIXED: send fixed position (if specified in config) or GPS position (if there is a GPS fix) as fixed station position (no chase mode) to sondehub + SH_LOC_CHASE: always activate chase mode and send GPS position (if available) + SH_LOC_AUTO: if there is no valid GPS position, or GPS position < MIN_LOC_AUTO_DIST away from known fixed position: use FIXED mode + otherwise, i.e. if there is a valid GPS position and (either no fixed position in config, or GPS position is far away from fixed position), use CHASE mode. +*/ +enum { SH_LOC_OFF, SH_LOC_FIXED, SH_LOC_CHASE, SH_LOC_AUTO }; +/* auto mode is chase if valid GPS position and (no fixed location entered OR valid GPS position and distance in lat/lon deg to fixed location > threshold) */ +#define MIN_LOC_AUTO_DIST 200 /* meter */ +#define SH_LOC_AUTO_IS_CHASE ( gpsPos.valid && ( (isnan(sonde.config.sondehub.lat) || isnan(sonde.config.sondehub.lon) ) || \ + calcLatLonDist( gpsPos.lat, gpsPos.lon, sonde.config.sondehub.lat, sonde.config.sondehub.lon ) > MIN_LOC_AUTO_DIST ) ) #endif +extern float calcLatLonDist(float lat1, float lon1, float lat2, float lon2); // KISS over TCP for communicating with APRSdroid WiFiServer tncserver(14580); @@ -99,6 +111,8 @@ static unsigned long specTimer; void enterMode(int mode); void WiFiEvent(WiFiEvent_t event); +char buffer[85]; +MicroNMEA nmea(buffer, sizeof(buffer)); // Read line from file, independent of line termination (LF or CR LF) String readLine(Stream &stream) { @@ -186,7 +200,6 @@ void setupChannelList() { while (file.available()) { String line = readLine(file); //file.readStringUntil('\n'); String sitename; - if (!file.available()) break; if (line[0] == '#') continue; char *space = strchr(line.c_str(), ' '); if (!space) continue; @@ -417,14 +430,14 @@ const char *createSondeHubMap() { HTMLBODY(ptr, "map.html"); if (!sonde.config.sondehub.active) { strcat(ptr, "Doing update, wait until reboot
"); } else { + sprintf(ptr + strlen(ptr), "Currently installed: %s-%c%d
\n", version_id, SPIFFS_MAJOR + 'A' - 1, SPIFFS_MINOR); + strcat(ptr, "Available master::
"
+ "Available devel:
Note: If suffix is the same, update should work fully. If the number is different, update contains changes in the file system. A full re-flash is required to get all new features, but the update should not break anything. If the letter is different, a full re-flash is mandatory, update will not work
"); } strcat(ptr, "