set dhcp dns name to mdns name; preparation of configurable map link (dl2mf merge)

This commit is contained in:
Hansi, dl9rdz 2022-10-01 00:52:52 +00:00
parent 3443834d3e
commit 89804426dc
3 changed files with 15 additions and 27 deletions

View File

@ -1890,27 +1890,6 @@ void setup()
axpSemaphore = xSemaphoreCreateBinary();
xSemaphoreGive(axpSemaphore);
#if 0
delay(2000);
// temporary test
volatile uint32_t *ioport = portOutputRegister(digitalPinToPort(4));
uint32_t portmask = digitalPinToBitMask(4);
int t = millis();
for (int i = 0; i < 10000000; i++) {
digitalWrite(4, LOW);
digitalWrite(4, HIGH);
}
int res = millis() - t;
Serial.printf("Duration w/ digitalWriteo: %d\n", res);
t = millis();
for (int i = 0; i < 10000000; i++) {
*ioport |= portmask;
*ioport &= ~portmask;
}
res = millis() - t;
Serial.printf("Duration w/ fast io: %d\n", res);
#endif
for (int i = 0; i < 39; i++) {
Serial.printf("%d:%d ", i, initlevels[i]);
}
@ -1927,6 +1906,7 @@ void setup()
Serial.println("Reading initial configuration");
setupConfigData(); // configuration must be read first due to OLED ports!!!
WiFi.setHostname(sonde.config.mdnsname);
// NOT TTGO v1 (fingerprint 64) or Heltec v1/v2 board (fingerprint 4)
// and NOT TTGO Lora32 v2.1_1.6 (fingerprint 31/63)

View File

@ -1,6 +1,15 @@
<html>
<head>
<script>
maptype = "SH"; // TODO: Get from config
const maps = {
"WS": ["https://www.wettersonde.net/map.php", (s)=>"?sonde="+s, (lat,lon)=>""],
"SH": ["https://sondehub.org/", (s)=>s, (lat,lon)=>'#!mz=8&mc=' + lat + ',' + lon],
"RS": ["https://radiosondy.info/", (s)=>"sonde.php?sondenumber="+s, (lat,lon)=>""],
"OW": ["https://v2.openwx.de/start.php", (s)=>"?sonde="+s, (lat,lon)=>"?mode=mobile"],
};
data = ["T4420541",63.5,-20.0];
document.addEventListener("DOMContentLoaded", function(){
fetch('live.json')
@ -8,12 +17,11 @@ document.addEventListener("DOMContentLoaded", function(){
.then((data) => {
console.log(data.gps.lat, data.gps.lon, data.sonde.ser);
if( (data.sonde.ser||'')=='' && !(data.gps.lat===undefined) ) {
urlarg = '#!mz=8&mc=' + data.gps.lat + ',' + data.gps.lon
urlarg = maps[maptype][2](data.gps.lat, data.gps.lon);
} else {
urlarg = data.sonde.ser || '';
urlarg = maps[maptype][1](data.sonde.ser||'');
}
id = data.sonde.ser || '';
iftxt='<iframe src="https://sondehub.org/' + urlarg + '" style="border:1px solid #00A3D3;border-radius:20px;height:98vh;width:100%"></iframe>';
iftxt='<iframe src="' + maps[maptype][0] + urlarg + '" style="border:1px solid #00A3D3;border-radius:20px;height:98vh;width:100%"></iframe>';
document.getElementsByTagName('body')[0].innerHTML = iftxt;
})
})

View File

@ -1,4 +1,4 @@
const char *version_name = "rdzTTGOsonde";
const char *version_id = "devel20220925";
const char *version_id = "devel20220930";
const int SPIFFS_MAJOR=2;
const int SPIFFS_MINOR=16;
const int SPIFFS_MINOR=17;