Merge branch 'dl9rdz:devel' into devel

pull/161/head
eben80 2021-09-06 15:20:03 +02:00 zatwierdzone przez GitHub
commit dfb042eef4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 23 dodań i 7 usunięć

Wyświetl plik

@ -33,7 +33,8 @@ SondeHub integration has mainly been tested with RS41 and DFM.
Support for other radiosondes that use AFSK modulation is not feasible with the TTGO hardware.
In particular, decoding iMet radiosondes is not practical.
In particular, decoding iMet-1/iMet-4 radiosondes is not practical (iMet-5x seems to use FSK,
so should be feasible to implement).
Adding support for LMS6 (see issue #48) and ims100 (see branch ims100) could be feasible,
but currently I don't have plans to do add this myself. Well-tested pull requests will of

Wyświetl plik

@ -321,7 +321,7 @@ headtxt = function(data,stat) {
var datetime = m.getUTCFullYear() + "-" + az(m.getUTCMonth()+1) + "-" + az(m.getUTCDate()) + "T" +
az(m.getUTCHours()) + ":" + az(m.getUTCMinutes()) + ":" + az(m.getUTCSeconds()) + "Z";
var url = 'https://predict.cusf.co.uk/api/v1/';
url += '?launch_latitude='+data.lat + '&launch_longitude='+data.lon;
url += '?launch_latitude='+data.lat + '&launch_longitude='+fix_lon(data.lon);
url += '&launch_altitude='+data.alt + '&launch_datetime='+datetime;
url += '&ascent_rate='+ascent + '&burst_altitude=' + burst + '&descent_rate='+descent;
@ -333,11 +333,11 @@ headtxt = function(data,stat) {
draw_predict = function(prediction,data) {
var ascending = prediction.prediction[0].trajectory;
var highest = ascending[ascending.length-1];
var highest_location = [highest.latitude,highest.longitude];
var highest_location = [highest.latitude,fix_lon(highest.longitude)];
var descending = prediction.prediction[1].trajectory;
var landing = descending[descending.length-1];
var landing_location = [landing.latitude,landing.longitude];
var landing_location = [landing.latitude,fix_lon(landing.longitude)];
if (!marker_landing) {
marker_landing = L.marker(landing_location,{icon: icon_landing}).addTo(map)
@ -353,7 +353,7 @@ headtxt = function(data,stat) {
dots_predict=[];
if (data.climb > 0) {
ascending.forEach(p => dots_predict.push([p.latitude,p.longitude]));
ascending.forEach(p => dots_predict.push([p.latitude,fix_lon(p.longitude)]));
if (!marker_burst) {
marker_burst = L.marker(highest_location,{icon:icon_burst}).addTo(map).bindPopup(poptxt('burst',highest),{closeOnClick:false, autoPan:false});
@ -365,7 +365,7 @@ headtxt = function(data,stat) {
}
}
descending.forEach(p => dots_predict.push([p.latitude,p.longitude]));
descending.forEach(p => dots_predict.push([p.latitude,fix_lon(p.longitude)]));
line_predict.setLatLngs(dots_predict);
if (data.climb > 0) {
@ -378,6 +378,12 @@ headtxt = function(data,stat) {
clearTimeout(predictor);
predictor = setTimeout(function() {get_predict(last_data);}, predictor_time*1000);
};
fix_lon = function(lon) {
if (lon > 180) { return lon - 360; }
if (lon < 0) { return lon + 360; }
return lon;
};
poptxt = function(t,i) {
var lat_input = (i.id)?i.lat:i.latitude;

Wyświetl plik

@ -1,4 +1,4 @@
const char *version_name = "rdzTTGOsonde";
const char *version_id = "devel20210817";
const char *version_id = "devel20210905";
const int SPIFFS_MAJOR=2;
const int SPIFFS_MINOR=14;

Wyświetl plik

@ -122,6 +122,11 @@ void Sonde::defaultConfig() {
#define BM8563_ADDRESS 0x51
Wire.beginTransmission(BM8563_ADDRESS);
byte err = Wire.endTransmission();
if(err) { // try again
delay(400);
Wire.beginTransmission(BM8563_ADDRESS);
err = Wire.endTransmission();
}
if(err==0) {
Serial.println("M5stack Core2 board detected\n");
config.type = TYPE_M5_CORE2;
@ -447,6 +452,10 @@ void Sonde::addSonde(float frequency, SondeType type, int active, char *launchsi
return;
}
Serial.printf("Adding %f - %d - %d - %s\n", frequency, type, active, launchsite);
// reset all data if type or frequency has changed
if(type != sondeList[nSonde].type || frequency != sondeList[nSonde].freq) {
memset(&sondeList[nSonde], 0, sizeof(SondeInfo));
}
sondeList[nSonde].type = type;
sondeList[nSonde].typestr[0] = 0;
sondeList[nSonde].freq = frequency;