diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index defcdad..4a40ad7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Repository auschecken
- uses: actions/checkout@v4
+ uses: actions/checkout@v5
- name: Firmwareversion ermitteln
id: version
@@ -37,12 +37,12 @@ jobs:
fi
- name: Python einrichten
- uses: actions/setup-python@v5
+ uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Node einrichten
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v5
with:
node-version: '22'
@@ -76,6 +76,7 @@ jobs:
run: |
pio pkg install -e smalltv_ultra
python3 tools/test_network_json.py
+ python3 tools/test_radar_scan.py
python3 tools/test_airline_cache.py
python3 tools/test_vvo_response.py
python3 tools/test_geo_buffer.py
@@ -103,7 +104,7 @@ jobs:
- name: Firmware hochladen
if: always()
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v6
with:
name: pixelstop-v${{ steps.version.outputs.version }}-firmware
path: dist/firmware/
@@ -111,7 +112,7 @@ jobs:
- name: Begleitpaket hochladen
if: always()
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v6
with:
name: pixelstop-v${{ steps.version.outputs.version }}-begleitpaket
path: dist/begleitpaket/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4d7a66a..e0bf80f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,25 @@
# Änderungen
+## v0.5.3-dev
+
+- **Webinterface-Menü:** Die wischbare Reiterleiste ist ersetzt durch ein Menü hinter der Taste ☰ (ausklappend wie beim RavestickBoard). Unter dem Titel steht die aktuelle Seite.
+- **Auge-Symbol** an WLAN-Passwort und API-Keys: zeigt die gerade getippte Eingabe. Gespeicherte Werte werden weiterhin nie an den Browser zurückgeschickt.
+- **3-Tage-Vorhersage als eigene Ansicht** in der Rotation, direkt unter „Wetter“, mit eigener Dauer und ▶. Der feste 8-s-Wechsel in der Wetteransicht entfällt; der Wetter-Reiter weist auf die neue Ansicht hin. Wer die Vorhersage bisher eingeschaltet hatte, findet die neue Zeile nach dem Update angehakt. Die Rotation folgt jetzt der Reihenfolge der Liste (Flug-Tracker vor Uhr).
+- **Flugzeugtypen:** eine einzige Tabelle im Flash mit 232 Typen weltweit (Airliner aller Varianten, Regionaljets, Frachter, Business-Jets, allgemeine Luftfahrt, Hubschrauber, Militär, Russland/GUS). Mit Hersteller, solange es in 18 Zeichen passt; ein Code ergibt genau einen Text; unbekannte Codes erscheinen als Code.
+- **Radar-Optionen** im Flugradar-Reiter: Betreiber als Name zum Rufzeichen (Standard), Oberbegriff oder beides (für bekannte Militär-Rufzeichen, z. B. „US Air Force / AMC“); Geschwindigkeit in km/h oder Knoten im Wechsel mit dem Kennzeichen; ▲▼ für Steig-/Sinkflug ab 300 ft/min; „MIL“ neben dem Rufzeichen für Militär.
+- **4-stellige Flughafencodes:** Routen zu Flugplätzen ohne IATA-Code wurden bisher komplett verworfen („N/A“), weil adsb.lol dort den ICAO-Code liefert. Jetzt gelten 3 Buchstaben (IATA) oder 4 Zeichen (ICAO, Buchstabe am Anfang, Ziffern erlaubt); adsbdb und aviationstack nutzen den ICAO-Code als Ersatz. Das „>“ bleibt fest in der Mitte: 3-stellige Routen sehen pixelgenau aus wie bisher, 4-stellige wachsen nach außen.
+- **Notfälle:** Bei Squawk 7500/7600/7700 sind Rufzeichen und Routenzeile rot; in der Routenzeile wechseln Route und „SQUAWK 7700“ alle 3 s (ohne Route steht der Squawk dauerhaft).
+- **Filter:** Hubschrauber, Kleinflugzeuge, Segler/Ballone/Ultraleicht/Drohnen und Flugzeuge am Boden ausblendbar. Mit Filter fragt PixelStop alle Flugzeuge im Radius ab und liest sie einzeln ein (`src/RadarScan.h`), damit der Speicherbedarf nicht mit der Zahl der Flugzeuge wächst.
+- **Diagnose:** Erfolgreiche Radarabrufe stehen als eine Zeile im Log (mit dem kleinsten freien Speicher während des Abrufs), Fehler weiter mit allen Schritten; der Log reicht damit etwa fünfmal so lange. Zusatzabfragen melden „leer“ (keine Daten zum Flugzeug) oder „übersprungen“ mit Grund. Im Status: aktuelles Flugzeug und Zahl der geprüften Flugzeuge.
+- **Dimmverfahren (Test):** Unter „Anzeige“ wählbar zwischen Standard (PWM) und Sigma-Delta. Sigma-Delta nutzt einen eigenen Baustein des Chips und soll das gelegentliche Aufblitzen bei geringer Helligkeit beseitigen.
+- **README:** aufklappbare „Mehr Beispiele“ mit realistischen Daten unter der Galerie; neuer Abschnitt „Flugradar: Darstellung und Einstellungen“ mit Beispielen aus dem Battlestar-Galactica-Universum (Quelle „DRADIS“), der Notfall als GIF mit sechs Bildern aus dem echten Displaycode; der Renderer kann den Quellnamen in der Fußzeile dafür setzen.
+- Workflow-Bausteine auf Node-24-Versionen (checkout v5, setup-node v5, setup-python v6, upload-artifact v6).
+
## v0.5.2-dev
+Auf Hardware bestätigt: Weiterrechnen von Entfernung und Höhe, Statuspunkt, Meldung bei „Jetzt anzeigen“, adsb.lol-Schlüssel.
+
+
- **Radar weitergerechnet:** Entfernung und Höhe werden zwischen zwei Abrufen jede Sekunde aus Geschwindigkeit über Grund, Kurs und Steig-/Sinkrate fortgeschrieben (`src/RadarMotion.h`). Jeder echte Abruf setzt die Werte neu. Die Höhe folgt der Steigrate höchstens 45 s, die Position höchstens bis kurz nach dem nächsten erwarteten Abruf (mindestens 1, höchstens 4 Minuten); danach bleiben die Werte stehen. Am Boden wird nicht gerechnet. Die auswählbaren Abrufintervalle bleiben unverändert.
- **Statuspunkt in der Radar-Fußzeile:** kurz weiß bei neuen Daten, grün im normalen Takt, gelb bei überfälligem oder fehlgeschlagenem Abruf und bei Anbieterpausen, grau, wenn die Werte stehen. Text und Sekundenzähler rücken dafür 10 Pixel nach rechts.
- **„Jetzt anzeigen“:** Die Meldung nennt jetzt die Anzeigedauer, z. B. „Wird für 30 s angezeigt · danach geht die Rotation weiter“; ist nur eine Ansicht aktiv, bleibt sie bis zum nächsten Speichern stehen.
diff --git a/README.en.md b/README.en.md
index 16cec4a..90f7fc7 100644
--- a/README.en.md
+++ b/README.en.md
@@ -6,9 +6,9 @@
Bought as a small Wi-Fi cube with a rather modest stock firmware – and from day one with the plan to turn it into something of my own.
[](https://github.com/du13500/pixelstop/actions/workflows/build.yml)
-
+

-
+



@@ -25,8 +25,9 @@ The cube shows, in rotation or permanently:
| View | What you see |
| --- | --- |
| **Departures** | Live departures of a stop of Verkehrsverbund Oberelbe (VVO, Dresden region): line, destination, minutes, delays and cancellations; up to ten departures on two pages, filter by mode of transport |
-| **Weather** | Current temperature, day/night weather icon, high and low, chance of rain, sunrise and sunset, alternating with a 3-day forecast; °C or °F |
-| **Flight radar** | The nearest aircraft within the chosen radius: callsign, airline, route, type, registration, distance and altitude |
+| **Weather** | Current temperature, day/night weather icon, high and low, chance of rain, sunrise and sunset; °C or °F |
+| **3-day forecast** | Weekday, weather icon, high/low and rain for the next three days, as a view of its own in the rotation |
+| **Flight radar** | The nearest aircraft within the chosen radius: callsign, airline, route, type, registration, distance and altitude; optionally speed, ▲▼ for climb/descent, military marking and filters (e.g. hide helicopters). Emergencies (squawk 7500/7600/7700) appear in red |
| **Clock** | Time and date with a selectable time zone |
| **Flight tracker** | One specific flight with scheduled and actual times and live altitude (your own aviationstack key required) |
| **Countdown 1–4** | Four independent timers with their own title and colours – in days, hours or minutes |
@@ -40,17 +41,36 @@ Plus night mode, brightness down to 1 %, place search with a map, Greek and Cyri
| Departures · Dresden Hauptbahnhof with a delay (yellow) and a cancellation (✕) | Weather · Brooklyn in °F | Flight radar · Emirates A380 from Dubai to Frankfurt |
| Flight tracker · one flight with scheduled and actual times | Forecast · the next three days | Countdown · in days or as a timer |
-## Status: v0.5.2-dev
+### More examples
+
+Departures & weather
+
+| | |
+| :---: | :---: |
+| Destinations · town of the stop dropped, “Meißen T.” abbreviated | Weather · Dresden at night in °C |
+
+
+
+Clock & countdown
+
+| | |
+| :---: | :---: |
+| Clock · with date | Countdown · as a minute timer |
+
+
+
+## Status: v0.5.3-dev
| Area | Status |
| --- | --- |
| Departures (VVO), weather, clock, countdowns | ✅ stable in daily use |
| Flight radar over HTTP/1.1, pauses on rejected requests | ✅ confirmed on hardware (v0.4.14.7) |
| Radar only while visible, daily budget without a key | ✅ running on hardware (v0.4.14.8), long-term observation ongoing |
-| Backlight at 1 % without flashes | ✅ much improved (v0.4.14.6) |
+| Backlight at 1 % without flashes | ⚠️ occasional flashes, sigma-delta test running (v0.5.3) |
| German/English language switch, abbreviated destinations | ✅ confirmed on hardware (v0.5.0) |
| 3-day forecast, tidier web interface, “Show now”, town of the stop | ✅ confirmed on hardware (v0.5.1) |
-| Radar: distance and altitude continued between requests, status dot | ⏳ hardware test pending |
+| Radar: distance and altitude continued between requests, status dot | ✅ confirmed on hardware (v0.5.2) |
+| Radar options and filters, 232 aircraft types, menu, forecast as a view, sigma-delta dimming | ⏳ hardware test pending |
| Flight tracker with your own aviationstack key | ⏳ not fully tested on hardware |
All changes are listed in [`CHANGELOG.md`](CHANGELOG.md) (German), open checks in [`ROADMAP.md`](ROADMAP.md).
@@ -134,6 +154,27 @@ All ways are listed at [adsb.lol/mmb](https://www.adsb.lol/mmb). If adsb.lol rej
| 🟡 yellow | update overdue, failed or provider pause; values are estimated |
| ⚫ grey | no data for too long; distance and altitude stand still |
+### Flight radar: display and settings
+
+The **Flight radar** tab lets you adjust the view:
+
+- **Operator:** name of the callsign (default), branch, or both, e.g. “US Air Force / AMC” – for known military callsigns.
+- **Speed** in km/h or knots, alternating with the registration every 3 seconds.
+- **▲▼** between distance and altitude when climbing or descending faster than 300 ft/min.
+- **MIL** next to the callsign for military aircraft.
+- **Hide:** helicopters, light aircraft, gliders/balloons/ultralights/drones, aircraft on the ground.
+- **Always on:** emergencies (squawk 7500/7600/7700) with a red callsign and a red route line in which the route and “SQUAWK 7700” alternate every 3 s; airports with 3-letter IATA or 4-character ICAO codes.
+
+For illustration, a view from Galactica’s CIC:
+
+| | |
+| :---: | :---: |
+| Speed alternating with the registration, 4-character codes, “N/A” when the data has no altitude | MIL marking, operator as “branch / unit” |
+
+
Emergency · callsign and route line in red; route and “SQUAWK 7700” alternate every 3 s, with ▼ while descending, distance, altitude and age running on, custom display name in the header
+
+Fictional sample data inspired by Battlestar Galactica, not affiliated with the rights holders. For these images the footer source reads “DRADIS” instead of “ADSB.LOL”; everything else is unchanged firmware output.
+
## Plans
- **More regions:** departures not only from VVO but selectable per transport association or Germany-wide (planned for v0.6.0).
diff --git a/README.md b/README.md
index 7aae415..0eb44de 100644
--- a/README.md
+++ b/README.md
@@ -6,9 +6,9 @@
Gekauft als kleiner WLAN-Würfel mit eher bescheidener Werksfirmware – und von Anfang an mit dem Plan, etwas Eigenes daraus zu machen.
[](https://github.com/du13500/pixelstop/actions/workflows/build.yml)
-
+

-
+



@@ -25,8 +25,9 @@ Der Würfel zeigt im Wechsel oder dauerhaft:
| Ansicht | Was du siehst |
| --- | --- |
| **Abfahrten** | Live-Abfahrten einer Haltestelle des Verkehrsverbunds Oberelbe (VVO): Linie, Ziel, Minuten, Verspätungen und Ausfälle; bis zu zehn Abfahrten auf zwei Seiten, Filter nach Verkehrsmittel |
-| **Wetter** | Aktuelle Temperatur, Wetterbild für Tag und Nacht, Höchst- und Tiefstwert, Regenwahrscheinlichkeit, Sonnenauf- und -untergang, im Wechsel eine 3-Tage-Vorhersage; °C oder °F |
-| **Flugradar** | Das nächste Flugzeug im gewählten Umkreis: Callsign, Airline, Route, Typ, Kennzeichen, Entfernung und Höhe |
+| **Wetter** | Aktuelle Temperatur, Wetterbild für Tag und Nacht, Höchst- und Tiefstwert, Regenwahrscheinlichkeit, Sonnenauf- und -untergang; °C oder °F |
+| **3-Tage-Vorhersage** | Wochentag, Wetterbild, Höchst-/Tiefstwert und Regen für die nächsten drei Tage, als eigene Ansicht in der Rotation |
+| **Flugradar** | Das nächste Flugzeug im gewählten Umkreis: Callsign, Airline, Route, Typ, Kennzeichen, Entfernung und Höhe; wahlweise Geschwindigkeit, ▲▼ bei Steig-/Sinkflug, Militär-Markierung und Filter (z. B. Hubschrauber ausblenden). Notfälle (Squawk 7500/7600/7700) erscheinen rot |
| **Uhr** | Uhrzeit und Datum mit wählbarer Zeitzone |
| **Flug-Tracker** | Ein bestimmter Flug mit Plan- und Ist-Zeiten und Live-Höhe (eigener aviationstack-Schlüssel nötig) |
| **Countdown 1–4** | Vier unabhängige Timer mit eigenem Titel und Farben – in Tagen, Stunden oder Minuten |
@@ -40,17 +41,36 @@ Dazu kommen Nachtmodus, Helligkeit ab 1 %, Ortssuche mit Karte, griechische und
| Abfahrten · Dresden Hauptbahnhof, mit Verspätung (gelb) und Ausfall (✕) | Wetter · Brooklyn in °F | Flugradar · Emirates A380 von Dubai nach Frankfurt |
| Flug-Tracker · ein Flug mit Plan- und Ist-Zeiten | Vorhersage · die nächsten drei Tage | Countdown · in Tagen oder als Timer |
-## Entwicklungsstand: v0.5.2-dev
+### Mehr Beispiele
+
+Abfahrten & Wetter
+
+| | |
+| :---: | :---: |
+| Fahrtziele · Ort der Haltestelle ausgeblendet, „Meißen T.“ abgekürzt | Wetter · Dresden nachts in °C |
+
+
+
+Uhr & Countdown
+
+| | |
+| :---: | :---: |
+| Uhr · mit Datum | Countdown · als Minuten-Timer |
+
+
+
+## Entwicklungsstand: v0.5.3-dev
| Bereich | Stand |
| --- | --- |
| Abfahrten (VVO), Wetter, Uhr, Countdowns | ✅ im Alltag stabil |
| Flugradar über HTTP/1.1, Pausen bei abgelehnten Anfragen | ✅ auf Hardware bestätigt (v0.4.14.7) |
| Radar nur bei sichtbarer Ansicht, Tagesbudget ohne Schlüssel | ✅ läuft auf Hardware (v0.4.14.8), Langzeitbeobachtung läuft |
-| Hintergrundbeleuchtung bei 1 % ohne Aufblitzen | ✅ deutlich besser (v0.4.14.6) |
+| Hintergrundbeleuchtung bei 1 % ohne Aufblitzen | ⚠️ gelegentliches Aufblitzen, Test mit Sigma-Delta läuft (v0.5.3) |
| Sprachumschaltung Deutsch/Englisch, abgekürzte Fahrtziele | ✅ auf Hardware bestätigt (v0.5.0) |
| 3-Tage-Vorhersage, aufgeräumtes Webinterface, „Jetzt anzeigen“, Ort der Haltestelle | ✅ auf Hardware bestätigt (v0.5.1) |
-| Radar: Entfernung und Höhe zwischen den Abrufen weitergerechnet, Statuspunkt | ⏳ Hardwaretest offen |
+| Radar: Entfernung und Höhe zwischen den Abrufen weitergerechnet, Statuspunkt | ✅ auf Hardware bestätigt (v0.5.2) |
+| Radar-Optionen und Filter, 232 Flugzeugtypen, Menü, Vorhersage als Ansicht, Dimmverfahren Sigma-Delta | ⏳ Hardwaretest offen |
| Flug-Tracker mit eigenem aviationstack-Schlüssel | ⏳ nicht vollständig auf Hardware getestet |
Alle Änderungen stehen in [`CHANGELOG.md`](CHANGELOG.md), offene Prüfungen in [`ROADMAP.md`](ROADMAP.md).
@@ -134,6 +154,27 @@ Eine Übersicht aller Wege gibt es unter [adsb.lol/mmb](https://www.adsb.lol/mmb
| 🟡 gelb | Abruf überfällig, fehlgeschlagen oder Anbieterpause; Werte sind geschätzt |
| ⚫ grau | zu lange keine Daten; Entfernung und Höhe stehen still |
+### Flugradar: Darstellung und Einstellungen
+
+Im Reiter **Flugradar** lässt sich die Anzeige anpassen:
+
+- **Betreiber:** Name zum Rufzeichen (Standard), Oberbegriff oder beides, z. B. „US Air Force / AMC“ – für bekannte Militär-Rufzeichen.
+- **Geschwindigkeit** in km/h oder Knoten, alle 3 Sekunden im Wechsel mit dem Kennzeichen.
+- **▲▼** zwischen Entfernung und Höhe bei Steig- oder Sinkflug ab 300 ft/min.
+- **MIL** neben dem Rufzeichen für Militärflugzeuge.
+- **Ausblenden:** Hubschrauber, Kleinflugzeuge, Segler/Ballone/Ultraleicht/Drohnen, Flugzeuge am Boden.
+- **Immer aktiv:** Notfälle (Squawk 7500/7600/7700) mit rotem Rufzeichen und roter Routenzeile, in der Route und „SQUAWK 7700“ alle 3 s wechseln; Flughäfen mit 3-stelligem IATA- oder 4-stelligem ICAO-Code.
+
+Zur Veranschaulichung ein Blick aus dem CIC der Galactica:
+
+| | |
+| :---: | :---: |
+| Geschwindigkeit im Wechsel mit dem Kennzeichen, 4-stellige Codes, „N/A“ wenn der Datenabruf keine Höhe liefert | MIL-Markierung, Betreiber als „Oberbegriff / Einheit“ |
+
+
Notfall · Rufzeichen und Routenzeile rot; Route und „SQUAWK 7700“ wechseln alle 3 s, dazu ▼ im Sinkflug, Entfernung, Höhe und Alter laufen weiter, eigener Anzeigename in der Kopfzeile
+
+Fiktive Beispieldaten in Anlehnung an Battlestar Galactica, ohne Verbindung zu den Rechteinhabern. Für diese Bilder heißt die Quelle in der Fußzeile „DRADIS“ statt „ADSB.LOL“; alles andere ist unveränderte Firmware-Ausgabe.
+
## Pläne
- **Mehr Regionen:** Abfahrten nicht nur vom VVO, sondern auswählbar je Verkehrsverbund bzw. deutschlandweit (geplant für v0.6.0).
diff --git a/ROADMAP.md b/ROADMAP.md
index 6e0256f..4f0e58d 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -1,10 +1,10 @@
# Roadmap
-Stand: 08.11.2026. Erledigtes steht in [`CHANGELOG.md`](CHANGELOG.md).
+Stand: 09.11.2026. Erledigtes steht in [`CHANGELOG.md`](CHANGELOG.md).
## Nächste Prüfungen auf dem Gerät
-- **v0.5.2-dev:** Radar-Werte zwischen den Abrufen (Entfernung zählt flüssig mit, Höhe bei Steig-/Sinkflug), Statuspunkt in allen Farben, Meldung bei „Jetzt anzeigen“, Hinweis bei abgelaufenem adsb.lol-Schlüssel. Anonymen Schlüssel holen und einige Tage testen.
+- **v0.5.3-dev:** Menü und Auge-Symbol im Webinterface; 3-Tage-Vorhersage als eigene Ansicht (Migration der alten Einstellung); Radar-Optionen (Betreiber A/B/C, Geschwindigkeit, ▲▼, MIL), Filter mit Abfrage aller Flugzeuge im Radius (Dauer und freien Speicher im Log beobachten); Notfalldarstellung; neue Typenliste; Routen mit 4-stelligen ICAO-Codes (kleine Flugplätze statt „N/A“); **Sigma-Delta nachts bei 1–10 % gegen PWM vergleichen** (Aufblitzen, Fiepen, Helligkeitsstufen). Offene Beobachtung: easyJet ohne Kennzeichen und Route – mit dem neuen Log prüfen.
- **Flugradar:** Langzeittest über mehrere Tage mit Rotation; Anfragezähler „adsb.lol heute“ beobachten. adsb.lol nennt keine festen Zahlen (kostenlose Schlüssel: festes Budget pro Schlüssel, ohne Garantie); Budgetwerte (`src/RadarBudget.h`) anhand des Verbrauchs im adsb.lol-Dashboard prüfen. Freien Speicher während der Abfrage im Blick behalten (ca. 5 KB bei 4-KB-TLS-Puffer).
- **Wetter:** Exception 29 beim Programmwechsel ist seit den Speicherkorrekturen nicht wieder aufgetreten; im Langzeittest weiter beobachten.
- **Zeitzone, Sommerzeit, Nachtmodus:** gezielt prüfen, spätestens bei der Zeitumstellung Ende März.
@@ -18,8 +18,9 @@ Stand: 08.11.2026. Erledigtes steht in [`CHANGELOG.md`](CHANGELOG.md).
| --- | --- |
| **v0.5.0** | PixelStop, Deutsch/Englisch, Fahrtziele, neue README – auf Hardware bestätigt |
| **v0.5.1** | Webinterface aufgeräumt, „Jetzt anzeigen“, 3-Tage-Vorhersage, Ort der Haltestelle aus der VVO-Suche, Texte im Flash – auf Hardware bestätigt |
-| **v0.5.2** | Radar-Werte zwischen den Abrufen weitergerechnet, Statuspunkt, Hilfen zum adsb.lol-Schlüssel – in Arbeit, nach dem Hardwaretest als Release taggen |
-| **v0.5.3** | Warnungen: Bevölkerungsschutz (NINA) und DWD-Wetterwarnungen, einzeln aktivierbar, regional gefiltert, mehrere nacheinander; optional Unterbrechung der Rotation |
+| **v0.5.2** | Radar-Werte zwischen den Abrufen weitergerechnet, Statuspunkt, Hilfen zum adsb.lol-Schlüssel – auf Hardware bestätigt |
+| **v0.5.3** | Menü, Vorhersage als Ansicht, Typenliste, Radar-Optionen und Filter, Notfälle, kompakter Log, Sigma-Delta-Test – in Arbeit, nach dem Hardwaretest als Release taggen |
+| **v0.5.4** | Warnungen: Bevölkerungsschutz (NINA) und DWD-Wetterwarnungen, einzeln aktivierbar, regional gefiltert, mehrere nacheinander; optional Unterbrechung der Rotation |
| **v0.6.0** | Abfahrten über Anbieter: VVO, Transitous (deutschlandweit inkl. Bahn), danach weitere Verbünde; Haltestellensuche im Browser. Dazu Ausweichquellen fürs Radar (airplanes.live, adsb.fi), wenn adsb.lol pausiert oder das Kontingent aufgebraucht ist |
| **v0.7.0** | Optionaler moderner Anzeigestil mit echten Schriften und neuem Layout, vorher als Entwurf mit `tools/render_screens.py` |
@@ -30,6 +31,8 @@ Stand: 08.11.2026. Erledigtes steht in [`CHANGELOG.md`](CHANGELOG.md).
- **Eigene Ersetzungen für Fahrtziele** im Webinterface.
- **Englische Diagnosetexte.**
- **Variante „Wetter & Uhr“** aus demselben Code: ohne Abfahrten, Radar und Tracker, dafür eine moderne Wetterkachel mit Meteocons (MIT) losgelöst vom Pixel-Design.
+- **Mini-Radarbild:** die nächsten Flugzeuge als Punkte auf einem Radarkreis (nutzt die Abfrage aller Flugzeuge aus v0.5.3).
+- **Eigener ADS-B-Empfänger als Datenquelle** im Heimnetz (Balkon oder Hellersiedlung): Aktualisierung jede Sekunde ohne Limits.
- **Titelbild für README und GitHub-Vorschau** (KI-Motiv war technisch nicht stimmig, vorerst zurückgestellt).
- **ESP32-Umbau** des SmallTV mit vorhandenem Display als Experiment (Pinbelegung, Stromversorgung, Platz, Portierung).
diff --git a/docs/screens/abfahrten-ziele.png b/docs/screens/abfahrten-ziele.png
new file mode 100644
index 0000000..267efe3
Binary files /dev/null and b/docs/screens/abfahrten-ziele.png differ
diff --git a/docs/screens/en/abfahrten-ziele.png b/docs/screens/en/abfahrten-ziele.png
new file mode 100644
index 0000000..267efe3
Binary files /dev/null and b/docs/screens/en/abfahrten-ziele.png differ
diff --git a/docs/screens/en/radar-apollo.png b/docs/screens/en/radar-apollo.png
new file mode 100644
index 0000000..0bb4680
Binary files /dev/null and b/docs/screens/en/radar-apollo.png differ
diff --git a/docs/screens/en/radar-colone.png b/docs/screens/en/radar-colone.png
new file mode 100644
index 0000000..b2e6278
Binary files /dev/null and b/docs/screens/en/radar-colone.png differ
diff --git a/docs/screens/en/radar-karma.gif b/docs/screens/en/radar-karma.gif
new file mode 100644
index 0000000..f951999
Binary files /dev/null and b/docs/screens/en/radar-karma.gif differ
diff --git a/docs/screens/en/wetter-nacht.png b/docs/screens/en/wetter-nacht.png
new file mode 100644
index 0000000..a1fcf1e
Binary files /dev/null and b/docs/screens/en/wetter-nacht.png differ
diff --git a/docs/screens/radar-apollo.png b/docs/screens/radar-apollo.png
new file mode 100644
index 0000000..dc8285a
Binary files /dev/null and b/docs/screens/radar-apollo.png differ
diff --git a/docs/screens/radar-colone.png b/docs/screens/radar-colone.png
new file mode 100644
index 0000000..b035316
Binary files /dev/null and b/docs/screens/radar-colone.png differ
diff --git a/docs/screens/radar-karma.gif b/docs/screens/radar-karma.gif
new file mode 100644
index 0000000..f951999
Binary files /dev/null and b/docs/screens/radar-karma.gif differ
diff --git a/docs/screens/wetter-nacht.png b/docs/screens/wetter-nacht.png
new file mode 100644
index 0000000..0af1f16
Binary files /dev/null and b/docs/screens/wetter-nacht.png differ
diff --git a/src/AircraftLabel.h b/src/AircraftLabel.h
index 7a405ff..98fcf02 100644
--- a/src/AircraftLabel.h
+++ b/src/AircraftLabel.h
@@ -1,20 +1,274 @@
#pragma once
+// Display names for ICAO aircraft type designators, at most 18 characters so
+// they fit one line in large type. One code = exactly one text; where ICAO
+// itself groups variants under one code, the text names what the code covers.
+// Unknown codes are shown as the code itself. The table lives in flash.
#include
+#include
+#ifdef ARDUINO
+#include
+#else
+#ifndef PROGMEM
+#define PROGMEM
+#endif
+#ifndef memcpy_P
+#define memcpy_P memcpy
+#endif
+#endif
-// Stable display labels for known ICAO types, independent of metadata wording.
-static inline const char* aircraftDisplayLabel(const char* code) {
- if(!code||!*code)return nullptr;
- struct Label {const char* code;const char* text;};
- static const Label labels[]={
- {"E170","Embraer E170"},{"E175","Embraer E175"},
- {"E75L","Embraer E175"},{"E75S","Embraer E175"},
- {"E190","Embraer E190"},{"E195","Embraer E195"},
- {"E290","Embraer E190-E2"},{"E295","Embraer E195-E2"},
- {"A318","Airbus A318"},{"A319","Airbus A319"},{"A320","Airbus A320"},
- {"A321","Airbus A321"},{"A20N","Airbus A320neo"},{"A21N","Airbus A321neo"},
- {"B737","Boeing 737-700"},{"B738","Boeing 737-800"},{"B739","Boeing 737-900"},
- {"B38M","Boeing 737 MAX 8"},{"B39M","Boeing 737 MAX 9"}
+struct AircraftTypeName { char code[5]; char name[19]; };
+
+// Copies the display name for the code into out; false if the code is unknown.
+inline bool aircraftDisplayLabel(const char* code, char* out, size_t cap) {
+ static const AircraftTypeName table[] PROGMEM = {
+ // Airbus
+ {"A318","Airbus A318"},
+ {"A319","Airbus A319"},
+ {"A19N","Airbus A319neo"},
+ {"A320","Airbus A320"},
+ {"A20N","Airbus A320neo"},
+ {"A321","Airbus A321"},
+ {"A21N","Airbus A321neo"},
+ {"BCS1","Airbus A220-100"},
+ {"BCS3","Airbus A220-300"},
+ {"A306","Airbus A300-600"},
+ {"A310","Airbus A310"},
+ {"A332","Airbus A330-200"},
+ {"A333","Airbus A330-300"},
+ {"A338","Airbus A330-800"},
+ {"A339","Airbus A330-900"},
+ {"A342","Airbus A340-200"},
+ {"A343","Airbus A340-300"},
+ {"A345","Airbus A340-500"},
+ {"A346","Airbus A340-600"},
+ {"A359","Airbus A350-900"},
+ {"A35K","Airbus A350-1000"},
+ {"A388","Airbus A380-800"},
+ {"A3ST","Airbus Beluga"},
+ {"A337","Airbus BelugaXL"},
+ // Boeing
+ {"B712","Boeing 717-200"},
+ {"B732","Boeing 737-200"},
+ {"B733","Boeing 737-300"},
+ {"B734","Boeing 737-400"},
+ {"B735","Boeing 737-500"},
+ {"B736","Boeing 737-600"},
+ {"B737","Boeing 737-700"},
+ {"B738","Boeing 737-800"},
+ {"B739","Boeing 737-900"},
+ {"B37M","Boeing 737 MAX 7"},
+ {"B38M","Boeing 737 MAX 8"},
+ {"B39M","Boeing 737 MAX 9"},
+ {"B3XM","Boeing 737 MAX 10"},
+ {"B742","Boeing 747-200"},
+ {"B744","Boeing 747-400"},
+ {"B748","Boeing 747-8"},
+ {"B752","Boeing 757-200"},
+ {"B753","Boeing 757-300"},
+ {"B762","Boeing 767-200"},
+ {"B763","Boeing 767-300"},
+ {"B764","Boeing 767-400"},
+ {"B772","Boeing 777-200"},
+ {"B77L","Boeing 777-200LR/F"},
+ {"B773","Boeing 777-300"},
+ {"B77W","Boeing 777-300ER"},
+ {"B778","Boeing 777-8"},
+ {"B779","Boeing 777-9"},
+ {"B788","Boeing 787-8"},
+ {"B789","Boeing 787-9"},
+ {"B78X","Boeing 787-10"},
+ // McDonnell Douglas
+ {"MD11","MD-11"},
+ {"DC10","DC-10"},
+ {"MD82","MD-82"},
+ {"MD83","MD-83"},
+ {"MD88","MD-88"},
+ {"MD90","MD-90"},
+ // Embraer
+ {"E135","Embraer ERJ-135"},
+ {"E145","Embraer ERJ-145"},
+ {"E170","Embraer E170"},
+ {"E75S","Embraer E175 SW"},
+ {"E75L","Embraer E175 LW"},
+ {"E190","Embraer E190"},
+ {"E195","Embraer E195"},
+ {"E290","Embraer E190-E2"},
+ {"E295","Embraer E195-E2"},
+ {"E120","Embraer EMB-120"},
+ // Regional
+ {"CRJ1","Bombardier CRJ100"},
+ {"CRJ2","Bombardier CRJ200"},
+ {"CRJ7","Bombardier CRJ700"},
+ {"CRJ9","Bombardier CRJ900"},
+ {"CRJX","Bombardier CRJ1000"},
+ {"DH8A","Dash 8-100"},
+ {"DH8B","Dash 8-200"},
+ {"DH8C","Dash 8-300"},
+ {"DH8D","Dash 8-400"},
+ {"AT43","ATR 42-300/320"},
+ {"AT45","ATR 42-500"},
+ {"AT46","ATR 42-600"},
+ {"AT72","ATR 72-200"},
+ {"AT75","ATR 72-500"},
+ {"AT76","ATR 72-600"},
+ {"SF34","Saab 340"},
+ {"SB20","Saab 2000"},
+ {"F70","Fokker 70"},
+ {"F100","Fokker 100"},
+ {"RJ85","Avro RJ85"},
+ {"RJ1H","Avro RJ100"},
+ {"B461","BAe 146-100"},
+ {"B462","BAe 146-200"},
+ {"B463","BAe 146-300"},
+ {"D328","Dornier 328"},
+ {"J328","Dornier 328JET"},
+ {"D228","Dornier 228"},
+ {"DHC6","DHC-6 Twin Otter"},
+ {"B190","Beech 1900"},
+ {"JS41","Jetstream 41"},
+ {"SU95","Sukhoi Superjet"},
+ {"C919","COMAC C919"},
+ {"AJ27","COMAC ARJ21"},
+ // Fracht & Schwer
+ {"A124","Antonov An-124"},
+ {"AN12","Antonov An-12"},
+ {"IL76","Ilyushin Il-76"},
+ // Russland & GUS
+ {"T154","Tupolev Tu-154"},
+ {"T204","Tupolev Tu-204"},
+ {"T214","Tupolev Tu-214"},
+ {"IL62","Ilyushin Il-62"},
+ {"IL96","Ilyushin Il-96"},
+ {"A148","Antonov An-148"},
+ {"AN24","Antonov An-24"},
+ {"AN26","Antonov An-26"},
+ {"AN72","Antonov An-72"},
+ {"YK40","Yakovlev Jak-40"},
+ {"YK42","Yakovlev Jak-42"},
+ {"MI8","Mil Mi-8"},
+ // Militär
+ {"C17","Boeing C-17A"},
+ {"A400","Airbus A400M"},
+ {"C130","Lockheed C-130"},
+ {"C30J","Lockheed C-130J"},
+ {"C5M","Lockheed C-5M"},
+ {"K35R","Boeing KC-135R"},
+ {"E3TF","Boeing E-3 AWACS"},
+ {"P8","Boeing P-8A"},
+ {"P3","Lockheed P-3 Orion"},
+ {"C295","Airbus C295"},
+ {"CN35","CASA CN-235"},
+ {"C160","Transall C-160"},
+ {"EUFI","Eurofighter"},
+ {"TOR","Panavia Tornado"},
+ {"F35","Lockheed F-35"},
+ {"F16","Lockheed F-16"},
+ {"B52","Boeing B-52"},
+ {"B1","Boeing B-1B"},
+ {"B2","Northrop B-2"},
+ {"R135","Boeing RC-135"},
+ {"E6","Boeing E-6 Mercury"},
+ {"C5","Lockheed C-5"},
+ {"U2","Lockheed U-2"},
+ {"F15","Boeing F-15"},
+ {"F18","Boeing F/A-18"},
+ {"F22","Lockheed F-22"},
+ {"A10","Fairchild A-10"},
+ {"E2","Northrop E-2"},
+ {"T38","Northrop T-38"},
+ {"H64","Boeing AH-64"},
+ {"H53","Sikorsky CH-53"},
+ {"V22","Bell Boeing V-22"},
+ // Business
+ {"C510","Citation Mustang"},
+ {"C525","Citation CJ1"},
+ {"C25A","Citation CJ2"},
+ {"C25B","Citation CJ3"},
+ {"C25C","Citation CJ4"},
+ {"C56X","Citation Excel/XLS"},
+ {"C68A","Citation Latitude"},
+ {"C700","Citation Longitude"},
+ {"C750","Citation X"},
+ {"E50P","Embraer Phenom 100"},
+ {"E55P","Embraer Phenom 300"},
+ {"E35L","Legacy 600/650"},
+ {"CL30","Challenger 300"},
+ {"CL35","Challenger 350"},
+ {"CL60","Challenger 6XX"},
+ {"GL5T","Global 5000"},
+ {"GLEX","Global Express"},
+ {"GL7T","Global 7500"},
+ {"LJ35","Learjet 35"},
+ {"LJ45","Learjet 45"},
+ {"LJ60","Learjet 60"},
+ {"LJ75","Learjet 75"},
+ {"F2TH","Falcon 2000"},
+ {"FA50","Falcon 50"},
+ {"F900","Falcon 900"},
+ {"FA7X","Falcon 7X"},
+ {"FA8X","Falcon 8X"},
+ {"GLF4","Gulfstream IV/G450"},
+ {"GLF5","Gulfstream V/G550"},
+ {"GLF6","Gulfstream G650"},
+ {"G280","Gulfstream G280"},
+ {"GA5C","Gulfstream G500"},
+ {"GA6C","Gulfstream G600"},
+ {"H25B","Hawker 800/900"},
+ {"HDJT","HondaJet"},
+ {"PC24","Pilatus PC-24"},
+ {"SF50","Cirrus Vision Jet"},
+ // Allgemeine Luftfahrt
+ {"C152","Cessna 152"},
+ {"C172","Cessna 172"},
+ {"C182","Cessna 182"},
+ {"C206","Cessna 206"},
+ {"C208","Cessna 208 Caravan"},
+ {"P28A","Piper PA-28"},
+ {"PA34","Piper PA-34 Seneca"},
+ {"SR20","Cirrus SR20"},
+ {"SR22","Cirrus SR22"},
+ {"DA20","Diamond DA20"},
+ {"DA40","Diamond DA40"},
+ {"DA42","Diamond DA42"},
+ {"DA62","Diamond DA62"},
+ {"PC12","Pilatus PC-12"},
+ {"PC21","Pilatus PC-21"},
+ {"BE9L","King Air 90"},
+ {"BE20","King Air 200/250"},
+ {"B350","King Air 350"},
+ {"TBM7","Daher TBM 700"},
+ {"TBM8","Daher TBM 850"},
+ {"TBM9","Daher TBM 900-960"},
+ {"GLID","Segelflugzeug"},
+ {"BALL","Ballon"},
+ {"ULAC","Ultraleicht"},
+ // Hubschrauber
+ {"EC20","Airbus H120"},
+ {"AS50","Airbus H125/AS350"},
+ {"EC30","Airbus H130"},
+ {"EC35","Airbus H135"},
+ {"EC45","Airbus H145"},
+ {"EC55","Airbus H155"},
+ {"EC75","Airbus H175"},
+ {"BK17","MBB BK 117"},
+ {"A109","Leonardo AW109"},
+ {"A139","Leonardo AW139"},
+ {"A169","Leonardo AW169"},
+ {"A189","Leonardo AW189"},
+ {"NH90","NH90"},
+ {"H60","Sikorsky H-60"},
+ {"S92","Sikorsky S-92"},
+ {"CH47","Boeing CH-47"},
+ {"B06","Bell 206"},
+ {"B407","Bell 407"},
+ {"B412","Bell 412"},
+ {"R22","Robinson R22"},
+ {"R44","Robinson R44"},
};
- for(const auto& label:labels)if(!strcmp(code,label.code))return label.text;
- return nullptr;
+ if (!code || !*code || !out || !cap) return false;
+ for (size_t i = 0; i < sizeof(table) / sizeof(table[0]); i++) {
+ AircraftTypeName e; memcpy_P(&e, &table[i], sizeof(e));
+ if (!strcmp(code, e.code)) { strncpy(out, e.name, cap - 1); out[cap - 1] = 0; return true; }
+ }
+ return false;
}
diff --git a/src/Diagnostics.cpp b/src/Diagnostics.cpp
index 83272dc..6ef210c 100644
--- a/src/Diagnostics.cpp
+++ b/src/Diagnostics.cpp
@@ -11,35 +11,56 @@ static Marker marker={},previous={};static bool previousValid=false;
static char resetReason[64]={},resetInfo[192]={};
static uint32_t deferredAt=0,deferredFor=0;
static const char ops[][20] PROGMEM={"Start","Radar.Position","Radar.Route","Radar.Metadata","Radar.Airline","Wetter","VVO.Abfahrten","VVO.Suche","Ort.Suche","Ort.Karte","Tracker.Status","Tracker.Position","Tracker.Route","Speichern","Neustart","Countdown","WLAN"};
-static const char stages[][24] PROGMEM={"Start","TLS","HTTP","JSON","OK","Fehler","Heap-knapp","Pause","leer","Antwortformat","JSON:NoMemory","JSON:IncompleteInput","JSON:EmptyInput","JSON:TooDeep","JSON:InvalidInput","Empfang:Fehler","Datei:Fehler","Antwort:ZuGross","Geo:Vorbereitung","Geo:Verbinden","Geo:Empfang","Geo:TLS-frei"};
+static const char stages[][24] PROGMEM={"Start","TLS","HTTP","JSON","OK","Fehler","Heap-knapp","Pause","leer","Antwortformat","JSON:NoMemory","JSON:IncompleteInput","JSON:EmptyInput","JSON:TooDeep","JSON:InvalidInput","Empfang:Fehler","Datei:Fehler","Antwort:ZuGross","Geo:Vorbereitung","Geo:Verbinden","Geo:Empfang","Geo:TLS-frei","übersprungen"};
static uint32_t checksum(const Marker& m){uint32_t h=2166136261UL;const uint8_t* p=(const uint8_t*)&m;for(size_t i=0;i=DS_JSON_MEMORY&&stage<=DS_RESPONSE_LIMIT)){lastError=e;hasLastError=true;strlcpy(lastErrorLookup,lookupContext,sizeof(lastErrorLookup));}
marker.at=e.at;marker.heap=e.heap;marker.block=e.block;marker.value=value;marker.code=(uint32_t)(int32_t)code;marker.op=op;marker.stage=stage;writeMarker();
}
void deferBackgroundNetwork(uint32_t ms){deferredAt=millis();deferredFor=ms;}
bool backgroundNetworkReady(){return (uint32_t)(millis()-deferredAt)>=deferredFor;}
-DiagRequest::DiagRequest(DiagOp op):op_(op),started_(millis()){diagEvent(op_,DS_BEGIN);}
-DiagRequest::~DiagRequest(){diagEvent(op_,result_,code_,millis()-started_);deferBackgroundNetwork();}
-void DiagRequest::stage(DiagStage stage){diagEvent(op_,stage,code_);}
-void DiagRequest::http(int code){code_=code;diagEvent(op_,DS_HTTP,code);}
+void DiagRequest::note(DiagStage stage,int code){
+ if(!compact_){diagEvent(op_,stage,code);return;}
+ Event e={millis(),ESP.getFreeHeap(),ESP.getMaxFreeBlockSize(),0,(int16_t)code,(uint8_t)op_,(uint8_t)stage};
+ if(e.heap
enum DiagOp : uint8_t { D_BOOT,D_RADAR,D_RADAR_ROUTE,D_METADATA,D_AIRLINE,D_WEATHER,D_VVO,D_STOP_SEARCH,D_GEO_SEARCH,D_GEO_REVERSE,D_TRACK_STATUS,D_TRACK_LIVE,D_TRACK_ROUTE,D_CONFIG,D_REBOOT,D_COUNTDOWN,D_WIFI,D_COUNT };
-enum DiagStage : uint8_t { DS_BEGIN,DS_TLS,DS_HTTP,DS_JSON,DS_DONE,DS_FAILED,DS_HEAP,DS_WAIT,DS_EMPTY,DS_SCHEMA,DS_JSON_MEMORY,DS_JSON_INCOMPLETE,DS_JSON_EMPTY,DS_JSON_DEPTH,DS_JSON_INVALID,DS_TRANSFER_ERROR,DS_FILE_ERROR,DS_RESPONSE_LIMIT,DS_GEO_PREPARE,DS_GEO_CONNECT,DS_GEO_RECEIVE,DS_GEO_RELEASE };
+enum DiagStage : uint8_t { DS_BEGIN,DS_TLS,DS_HTTP,DS_JSON,DS_DONE,DS_FAILED,DS_HEAP,DS_WAIT,DS_EMPTY,DS_SCHEMA,DS_JSON_MEMORY,DS_JSON_INCOMPLETE,DS_JSON_EMPTY,DS_JSON_DEPTH,DS_JSON_INVALID,DS_TRANSFER_ERROR,DS_FILE_ERROR,DS_RESPONSE_LIMIT,DS_GEO_PREPARE,DS_GEO_CONNECT,DS_GEO_RECEIVE,DS_GEO_RELEASE,DS_SKIPPED };
void diagInit();
void diagEvent(DiagOp op,DiagStage stage,int code=0,uint32_t value=0);
void diagLookup(const char* aircraft,const char* callsign);
@@ -9,8 +9,14 @@ void diagPrint(Print& out);
const char* diagResetReason();
bool backgroundNetworkReady();
void deferBackgroundNetwork(uint32_t ms=750);
+// Radar positions run every few seconds: a successful request is logged as a
+// single line (with the lowest heap seen during it); the individual steps are
+// only written when the request fails. Other requests log every step.
class DiagRequest {
DiagOp op_; uint32_t started_; int code_=0; DiagStage result_=DS_FAILED;
+ bool compact_; uint8_t pending_=0; uint32_t minHeap_=0xFFFFFFFFUL,minBlock_=0xFFFFFFFFUL;
+ struct Step { uint32_t at,heap,block; int16_t code; uint8_t stage; } steps_[6];
+ void note(DiagStage stage,int code);
public:
explicit DiagRequest(DiagOp op);
~DiagRequest();
diff --git a/src/Flight.cpp b/src/Flight.cpp
index ea1c809..0f1b38d 100644
--- a/src/Flight.cpp
+++ b/src/Flight.cpp
@@ -1,6 +1,9 @@
#include "Version.h"
#include "Flight.h"
#include "AircraftPolicy.h"
+#include "AircraftLabel.h"
+#include "RadarFilter.h"
+#include "RadarScan.h"
#include "RadarPolicy.h"
#include "RequestPolicy.h"
#include "RoutePolicy.h"
@@ -40,6 +43,7 @@ static uint32_t g_lastEnrichmentMs=0;
static const char* g_routeStatus="nicht geprüft";
static const char* g_routeSource="keine";
static int g_routeHttp=0;
+static uint16_t g_scanned=0;
static float g_homeLat=NAN,g_homeLon=NAN;
static uint32_t g_intervalMs=0;
@@ -71,7 +75,7 @@ static float distanceKm(float lat1, float lon1, float lat2, float lon2) {
return radarFlatDistanceKm(lat1, lon1, lat2, lon2);
}
-// Fallback names for common airlines and aircraft types. The tables live in
+// Fallback names for common airlines (aircraft types: AircraftLabel.h). The tables live in
// flash (PROGMEM) and the match is copied into the caller's buffer.
struct NameEntry4 { char key[5]; char name[20]; };
static const NameEntry4 AIRLINE_NAMES[] PROGMEM = {
@@ -82,17 +86,6 @@ static const NameEntry4 AIRLINE_NAMES[] PROGMEM = {
{"BEL","Brussels Airlines"},{"UAE","Emirates"},{"QTR","Qatar Airways"},{"EXS","Jet2"},
{"TUI","TUI"},{"ITY","ITA Airways"},{"IBE","Iberia"},{"VLG","Vueling"}
};
-static const NameEntry4 TYPE_NAMES[] PROGMEM = {
- {"A20N","Airbus A320neo"},{"A21N","Airbus A321neo"},{"A320","Airbus A320"},
- {"A321","Airbus A321"},{"A319","Airbus A319"},{"A318","Airbus A318"},
- {"A359","Airbus A350-900"},{"A35K","Airbus A350-1000"},{"A333","Airbus A330-300"},
- {"A332","Airbus A330-200"},{"B738","Boeing 737-800"},{"B737","Boeing 737-700"},
- {"B38M","Boeing 737 MAX 8"},{"B39M","Boeing 737 MAX 9"},{"B788","Boeing 787-8"},
- {"B789","Boeing 787-9"},{"B772","Boeing 777-200"},{"B77W","Boeing 777-300ER"},
- {"E190","Embraer E190"},{"E195","Embraer E195"},{"E290","Embraer E190-E2"},
- {"E295","Embraer E195-E2"},{"CRJ9","CRJ900"},{"BCS1","Airbus A220-100"},
- {"BCS3","Airbus A220-300"},{"AT76","ATR 72-600"},{"DH8D","Dash 8 Q400"}
-};
// Copies the name for `key` (first `keyLen` chars, 0 = whole key) or `fallback`.
static void nameFromTable(const NameEntry4* table, size_t count, const char* key, size_t keyLen,
@@ -112,7 +105,9 @@ static RoutePoint jsonPoint(JsonObjectConst o,const char* latKey,const char* lon
}
static bool lookupRouteAdsbLol(const FlightSnapshot& f,RoutePoint pos,Enrichment& out) {
- if(adsbLolBudgetLow()||serviceWaitMs(SERVICE_ADSB_LOL)||serviceMinIntervalMs(SERVICE_ADSB_LOL)||!tlsHeapReady(adsbLolRx()))return false;
+ // Skipped requests are logged with a reason (value): 1 budget, 2 pause, 3 minimum interval, 4 memory.
+ uint8_t skip=adsbLolBudgetLow()?1:(serviceWaitMs(SERVICE_ADSB_LOL)?2:(serviceMinIntervalMs(SERVICE_ADSB_LOL)?3:(!tlsHeapReady(adsbLolRx())?4:0)));
+ if(skip){diagLookup(f.hex,f.callsign);diagEvent(D_RADAR_ROUTE,DS_SKIPPED,0,skip);return false;}
DiagRequest trace(D_RADAR_ROUTE);diagLookup(f.hex,f.callsign);trace.stage(DS_TLS);
BearSSL::WiFiClientSecure client;makeSecure(client,&g_routeSession,adsbLolRx());
HTTPClient http;http.setTimeout(5000);http.setReuse(false);
@@ -126,23 +121,26 @@ static bool lookupRouteAdsbLol(const FlightSnapshot& f,RoutePoint pos,Enrichment
int code=http.POST(body);request.clear();body=String();trace.http(code);g_routeHttp=code;
serviceResponse(SERVICE_ADSB_LOL,code,http.header("Retry-After").c_str());
if(serviceWaitMs(SERVICE_ADSB_LOL))diagEvent(D_RADAR,DS_WAIT,code,serviceWaitMs(SERVICE_ADSB_LOL));
- if(code!=200){if(code==201)trace.stage(DS_EMPTY);http.end();client.stop();return false;}
+ if(code!=200){if(code==201)trace.finish(true,DS_EMPTY);http.end();client.stop();return false;}
JsonDocument filter(networkJsonAllocator());JsonObject item=filter.to().add();
item["callsign"]=true;item["plausible"]=true;item["_airport_codes_iata"]=true;
JsonObject ap=item["_airports"].to().add();ap["lat"]=true;ap["lon"]=true;
trace.stage(DS_JSON);JsonDocument doc(networkJsonAllocator());if(!jsonFilterReady(filter,trace)){http.end();client.stop();return false;}AdsbLolBody routeBody(http);auto err=deserializeJson(doc,routeBody,DeserializationOption::Filter(filter));logJsonError(trace,err); filter.clear(); http.end(); client.stop();
- if(err||!doc.is()||!doc.size())return false;
+ if(err)return false;
+ // From here the answer was read; "leer" = no usable route for this flight.
+ if(!doc.is()||!doc.size()){trace.finish(true,DS_EMPTY);return false;}
JsonObjectConst r=doc[0];
- if(strcmp(r["callsign"]|"",f.callsign)||!r["plausible"].is()||!r["plausible"].as())return false;
- FlightRoute route={};if(!parseFlightRoute(r["_airport_codes_iata"]|"",route)||route.truncated)return false;
- JsonArrayConst airports=r["_airports"];if(airports.size()!=route.count)return false;
+ if(strcmp(r["callsign"]|"",f.callsign)||!r["plausible"].is()||!r["plausible"].as()){trace.finish(true,DS_EMPTY);return false;}
+ FlightRoute route={};if(!parseFlightRoute(r["_airport_codes_iata"]|"",route)||route.truncated){trace.finish(true,DS_EMPTY);return false;}
+ JsonArrayConst airports=r["_airports"];if(airports.size()!=route.count){trace.finish(true,DS_EMPTY);return false;}
for(uint8_t i=0;i();
routeFilter["callsign_icao"]=true;routeFilter["callsign"]=true;
routeFilter["airline"]["name"]=true;routeFilter["airline"]["icao"]=true;
for(const char* key:{"origin","midpoint","destination"}){
- routeFilter[key]["iata_code"]=true;routeFilter[key]["latitude"]=true;routeFilter[key]["longitude"]=true;
+ routeFilter[key]["iata_code"]=true;routeFilter[key]["icao_code"]=true;routeFilter[key]["latitude"]=true;routeFilter[key]["longitude"]=true;
}
trace.stage(DS_JSON);JsonDocument doc(networkJsonAllocator());if(!jsonFilterReady(filter,trace)){http.end();client.stop();return false;}auto err=deserializeJson(doc,http.getStream(),DeserializationOption::Filter(filter));logJsonError(trace,err); filter.clear(); http.end(); client.stop();if(err)return false;
trace.finish(true);
@@ -177,7 +176,8 @@ static bool lookupMetadata(const FlightSnapshot& f,RoutePoint pos,Enrichment& ou
strlcpy(out.airline,route["airline"]["name"]|"",sizeof(out.airline));
FlightRoute candidate={};RoutePoint points[3];uint8_t count=0;
for(const char* key:{"origin","midpoint","destination"}){
- JsonObjectConst ap=route[key];const char* code=ap["iata_code"]|"";
+ // IATA code, or the ICAO code for airfields without one.
+ JsonObjectConst ap=route[key];const char* code=ap["iata_code"]|"";if(!*code)code=ap["icao_code"]|"";
if(!*code&& !strcmp(key,"midpoint"))continue;
if(!appendRouteAirport(candidate,code))return true;
points[count++]=jsonPoint(ap,"latitude","longitude");
@@ -288,6 +288,7 @@ bool flightPollDue(uint16_t pollSec, float visibleShare) {
}
const FlightSnapshot& flightData() { return g_f; }
+uint16_t flightLastScanned() { return g_scanned; }
uint32_t flightPollIntervalMs() { return g_intervalMs ? g_intervalMs : RADAR_MOTION_MIN_MS; }
float flightLiveDistanceKm(const FlightSnapshot& f) {
if(!f.valid||!f.motion.hasMotion||isnan(g_homeLat)||isnan(g_homeLon))return f.distanceKm;
@@ -336,7 +337,62 @@ static void flightSuccess(const char* stage = "ok") {
g_lastOkMs = millis();
}
-bool flightFetch(float homeLat, float homeLon, uint16_t radiusKm) {
+// Fields the radar reads per aircraft.
+static void addAircraftFields(JsonObject f) {
+ f["flight"] = true; f["r"] = true; f["t"] = true; f["category"] = true;
+ f["lat"] = true; f["lon"] = true; f["alt_baro"] = true; f["hex"] = true;
+ f["gs"] = true; f["track"] = true; f["baro_rate"] = true; f["geom_rate"] = true; f["seen_pos"] = true;
+ f["squawk"] = true; f["dbFlags"] = true;
+}
+
+// One aircraft object into a snapshot; false without a usable position.
+static bool readAircraft(JsonObjectConst a, float homeLat, float homeLon, FlightSnapshot& next) {
+ strlcpy(next.origin,"N/A",sizeof(next.origin));
+ strlcpy(next.destination,"N/A",sizeof(next.destination));
+ const char* rawCall = a["flight"] | (a["hex"] | "");
+ strlcpy(next.callsign, rawCall, sizeof(next.callsign));
+ trimTail(next.callsign);
+ strlcpy(next.hex, a["hex"] | "", sizeof(next.hex));
+ strlcpy(next.registration, a["r"] | "", sizeof(next.registration));
+ strlcpy(next.category,a["category"]|"",sizeof(next.category));
+ strlcpy(next.typeCode, a["t"] | "", sizeof(next.typeCode));
+ strlcpy(next.squawk, a["squawk"] | "", sizeof(next.squawk));
+ next.military = ((int)(a["dbFlags"] | 0)) & 1;
+ next.onGround=a["alt_baro"].is()&&!strcmp(a["alt_baro"].as(),"ground");
+ next.altitudeKnown=a["alt_baro"].is();
+ next.altitudeFt=next.altitudeKnown?(int32_t)lroundf(a["alt_baro"].as()):0;
+ float acLat = NAN, acLon = NAN;
+ if (a["lat"].is()) acLat = a["lat"].as();
+ if (a["lon"].is()) acLon = a["lon"].as();
+ if(!isfinite(acLat)||!isfinite(acLon)||acLat<-90||acLat>90||acLon<-180||acLon>180)return false;
+ next.distanceKm = distanceKm(homeLat, homeLon, acLat, acLon);
+ // Motion for estimates until the next request (not on the ground).
+ RadarMotion& m = next.motion;
+ m.lat = acLat; m.lon = acLon;
+ float seen = a["seen_pos"] | 0.0f;
+ if (!(seen >= 0.0f) || seen > 60.0f) seen = 0.0f;
+ m.sampleMs = millis() - (uint32_t)(seen * 1000.0f);
+ float gs = a["gs"] | -1.0f, track = a["track"] | -1.0f;
+ next.speedKnown = gs >= 0.0f && gs <= 800.0f;
+ next.speedKt = next.speedKnown ? gs : 0.0f;
+ m.hasMotion = !next.onGround && next.speedKnown && track >= 0.0f && track <= 360.0f;
+ m.speedKt = m.hasMotion ? gs : 0.0f;
+ m.trackDeg = m.hasMotion ? track : 0.0f;
+ JsonVariantConst rate = a["baro_rate"].is() ? a["baro_rate"] : a["geom_rate"];
+ m.hasRate = !next.onGround && next.altitudeKnown && rate.is() && fabsf(rate.as()) <= 8000.0f;
+ m.rateFpm = m.hasRate ? rate.as() : 0.0f;
+ return true;
+}
+
+// Names from the built-in tables, only for the aircraft that is shown.
+static void labelAircraft(FlightSnapshot& f) {
+ if(!aircraftDisplayLabel(f.typeCode, f.typeName, sizeof(f.typeName))) strlcpy(f.typeName, f.typeCode, sizeof(f.typeName));
+ nameFromTable(AIRLINE_NAMES, sizeof(AIRLINE_NAMES)/sizeof(AIRLINE_NAMES[0]), f.callsign, 3, "", f.airline, sizeof(f.airline));
+}
+
+bool flightFetch(float homeLat, float homeLon, uint16_t radiusKm, uint8_t hideMask) {
+ const bool scan = hideMask != 0;
+ g_scanned = 0;
if(serviceWaitMs(SERVICE_ADSB_LOL))return false;
DiagRequest trace(D_RADAR);
struct Completion {~Completion(){g_lastPollMs=millis();}} completion;
@@ -365,7 +421,7 @@ bool flightFetch(float homeLat, float homeLon, uint16_t radiusKm) {
http.setTimeout(5000);
http.setReuse(false);
- String url = F("https://api.adsb.lol/v2/closest/");
+ String url = scan ? F("https://api.adsb.lol/v2/point/") : F("https://api.adsb.lol/v2/closest/");
url += String(homeLat, 4); url += '/';
url += String(homeLon, 4); url += '/';
url += String(radiusNm);
@@ -380,57 +436,47 @@ bool flightFetch(float homeLat, float homeLon, uint16_t radiusKm) {
if (code != HTTP_CODE_OK) { http.end(); client.stop(); const bool paused=(code==429||code==503)&&serviceWaitMs(SERVICE_ADSB_LOL);return flightFailure(adsbLolAccessDenied(code)?"Zugriff abgelehnt":(paused?"Abrufpause: Anbieter":(code < 0 ? "Verbindung fehlgeschlagen" : "HTTP-Fehler")),paused); }
JsonDocument filter(networkJsonAllocator());
- JsonObject f = filter["ac"][0].to();
- f["flight"] = true; f["r"] = true; f["t"] = true; f["category"] = true;
- f["lat"] = true; f["lon"] = true; f["alt_baro"] = true; f["hex"] = true;
- f["gs"] = true; f["track"] = true; f["baro_rate"] = true; f["geom_rate"] = true; f["seen_pos"] = true;
+ addAircraftFields(scan ? filter.to() : filter["ac"][0].to());
JsonDocument doc(networkJsonAllocator());
trace.stage(DS_JSON);
if(!jsonFilterReady(filter,trace)){http.end();client.stop();return flightFailure("JSON-Speicher knapp");}
AdsbLolBody body(http);
- auto err = deserializeJson(doc, body, DeserializationOption::Filter(filter));
- logJsonError(trace,err); filter.clear(); http.end(); client.stop();
- if (err) return flightFailure("JSON-Fehler");
-
- JsonArrayConst ac = doc["ac"].as();
- if(ac.isNull()){trace.stage(DS_SCHEMA);return flightFailure("Antwortformat-Fehler");}
- if (ac.size() == 0) {
+ bool found = false;
+ if (!scan) {
+ auto err = deserializeJson(doc, body, DeserializationOption::Filter(filter));
+ logJsonError(trace,err); filter.clear(); http.end(); client.stop();
+ if (err) return flightFailure("JSON-Fehler");
+ JsonArrayConst ac = doc["ac"].as();
+ if(ac.isNull()){trace.stage(DS_SCHEMA);return flightFailure("Antwortformat-Fehler");}
+ if (ac.size()) {
+ if(!readAircraft(ac[0].as(),homeLat,homeLon,next)){trace.stage(DS_SCHEMA);return flightFailure("Positionsdaten fehlen");}
+ found = true;
+ }
+ } else {
+ // All aircraft in the radius, read one at a time (RadarScan.h).
+ FlightSnapshot cand;
+ DeserializationError err;
+ g_scanned = radarScanArray(body, doc, filter, [&](JsonObjectConst a) {
+ memset(&cand, 0, sizeof(cand));
+ if (!readAircraft(a, homeLat, homeLon, cand) || radarHidden(cand.category, cand.onGround, hideMask)) return;
+ if (!found || cand.distanceKm < next.distanceKm) { next = cand; found = true; }
+ yield();
+ }, err);
+ if (err) {
+ logJsonError(trace,err); filter.clear(); http.end(); client.stop();
+ if (err == DeserializationError::InvalidInput && !g_scanned) { trace.stage(DS_SCHEMA); return flightFailure("Antwortformat-Fehler"); }
+ return flightFailure("JSON-Fehler");
+ }
+ filter.clear(); http.end(); client.stop();
+ }
+ if (!found) {
memset(&g_f, 0, sizeof(g_f));
g_f.error = false;
flightSuccess("keine Flugzeuge");trace.finish(true,DS_EMPTY);
return true;
}
-
- JsonObjectConst a = ac[0].as();
- const char* rawCall = a["flight"] | (a["hex"] | "");
- strlcpy(next.callsign, rawCall, sizeof(next.callsign));
- trimTail(next.callsign);
- strlcpy(next.hex, a["hex"] | "", sizeof(next.hex));
- strlcpy(next.registration, a["r"] | "", sizeof(next.registration));
- strlcpy(next.category,a["category"]|"",sizeof(next.category));
- strlcpy(next.typeCode, a["t"] | "", sizeof(next.typeCode));
- nameFromTable(TYPE_NAMES, sizeof(TYPE_NAMES)/sizeof(TYPE_NAMES[0]), next.typeCode, 0, next.typeCode, next.typeName, sizeof(next.typeName));
- nameFromTable(AIRLINE_NAMES, sizeof(AIRLINE_NAMES)/sizeof(AIRLINE_NAMES[0]), next.callsign, 3, "", next.airline, sizeof(next.airline));
- next.onGround=a["alt_baro"].is()&&!strcmp(a["alt_baro"].as(),"ground");
- next.altitudeKnown=a["alt_baro"].is();
- next.altitudeFt=next.altitudeKnown?(int32_t)lroundf(a["alt_baro"].as()):0;
- if (a["lat"].is() || a["lat"].is()) acLat = a["lat"].as();
- if (a["lon"].is() || a["lon"].is()) acLon = a["lon"].as();
- if(!isfinite(acLat)||!isfinite(acLon)||acLat<-90||acLat>90||acLon<-180||acLon>180){trace.stage(DS_SCHEMA);return flightFailure("Positionsdaten fehlen");}
- if (!isnan(acLat) && !isnan(acLon)) next.distanceKm = distanceKm(homeLat, homeLon, acLat, acLon);
- // Motion for estimates until the next request (not on the ground).
- RadarMotion& m = next.motion;
- m.lat = acLat; m.lon = acLon;
- float seen = a["seen_pos"] | 0.0f;
- if (!(seen >= 0.0f) || seen > 60.0f) seen = 0.0f;
- m.sampleMs = millis() - (uint32_t)(seen * 1000.0f);
- float gs = a["gs"] | -1.0f, track = a["track"] | -1.0f;
- m.hasMotion = !next.onGround && gs >= 0.0f && gs <= 800.0f && track >= 0.0f && track <= 360.0f;
- m.speedKt = m.hasMotion ? gs : 0.0f;
- m.trackDeg = m.hasMotion ? track : 0.0f;
- JsonVariantConst rate = a["baro_rate"].is() ? a["baro_rate"] : a["geom_rate"];
- m.hasRate = !next.onGround && next.altitudeKnown && rate.is() && fabsf(rate.as()) <= 8000.0f;
- m.rateFpm = m.hasRate ? rate.as() : 0.0f;
+ labelAircraft(next);
+ acLat = next.motion.lat; acLon = next.motion.lon;
next.valid = true;
next.error = false;
}
diff --git a/src/Flight.h b/src/Flight.h
index 4183825..af3ea3e 100644
--- a/src/Flight.h
+++ b/src/Flight.h
@@ -13,20 +13,28 @@ struct FlightSnapshot {
char typeCode[8];
char category[4];
char typeName[80];
- char origin[4];
- char destination[4];
+ char origin[ROUTE_CODE_SIZE];
+ char destination[ROUTE_CODE_SIZE];
FlightRoute route;
float distanceKm;
int32_t altitudeFt;
bool altitudeKnown;
bool onGround;
RadarMotion motion; // for estimates between requests
+ char squawk[5]; // transponder code, "7700" etc.
+ bool military; // adsb.lol database flag
+ bool speedKnown;
+ float speedKt; // ground speed
};
void flightReset();
// visibleShare: fraction of the time the radar is on screen (for the daily budget).
bool flightPollDue(uint16_t pollSec, float visibleShare = 1.0f);
-bool flightFetch(float homeLat, float homeLon, uint16_t radiusKm);
+// hideMask (RadarFilter.h) > 0 asks for all aircraft in the radius and picks the
+// nearest one that is not hidden; 0 asks adsb.lol for the nearest aircraft only.
+bool flightFetch(float homeLat, float homeLon, uint16_t radiusKm, uint8_t hideMask = 0);
+// Aircraft examined in the last filtered request (0 without filter).
+uint16_t flightLastScanned();
const FlightSnapshot& flightData();
// Distance and altitude continued from speed, track and vertical rate.
float flightLiveDistanceKm(const FlightSnapshot& f);
diff --git a/src/FlightRoute.h b/src/FlightRoute.h
index cfc7676..38244ce 100644
--- a/src/FlightRoute.h
+++ b/src/FlightRoute.h
@@ -3,20 +3,29 @@
#include
// Fixed storage keeps API-controlled data bounded on the ESP8266.
+// Airport codes: 3 letters (IATA) or 4 characters (ICAO, for airfields without
+// an IATA code; letter first, then letters or digits).
+static constexpr uint8_t ROUTE_CODE_SIZE=5;
struct FlightRoute {
static constexpr uint8_t capacity=8;
- char airports[capacity][4];
+ char airports[capacity][ROUTE_CODE_SIZE];
uint8_t count;
bool truncated;
};
static inline bool routeCode(const char* code) {
- if(!code||strlen(code)!=3)return false;
- for(uint8_t i=0;i<3;i++)if(code[i]<'A'||code[i]>'Z')return false;
+ if(!code)return false;
+ size_t len=strlen(code);
+ if(len!=3&&len!=4)return false;
+ if(code[0]<'A'||code[0]>'Z')return false;
+ for(uint8_t i=1;i='A'&&code[i]<='Z',digit=code[i]>='0'&&code[i]<='9';
+ if(!letter&&!(digit&&len==4))return false;
+ }
return true;
}
static inline bool appendRouteAirport(FlightRoute& route,const char* code) {
if(!routeCode(code))return false;
- if(route.count='a'&&c<='z')c-=32;
- if(len>=3)return false;
+ if(len>=ROUTE_CODE_SIZE-1)return false;
code[len++]=c;
}
if(!appendRouteAirport(next,code))return false;
diff --git a/src/MilitaryOperator.h b/src/MilitaryOperator.h
new file mode 100644
index 0000000..681c580
--- /dev/null
+++ b/src/MilitaryOperator.h
@@ -0,0 +1,61 @@
+#pragma once
+// Branch names for well-known military callsign prefixes, for the radar's
+// operator display (variant B: branch, variant C: branch / unit). Unknown
+// callsigns return false, so the display keeps the name of the callsign (A).
+#include
+#include
+#include
+
+struct MilitaryOperator { const char* prefix; const char* de; const char* en; const char* unit; };
+
+inline const MilitaryOperator* militaryOperatorFor(const char* callsign) {
+ static const MilitaryOperator table[] = {
+ {"RCH","US Air Force","US Air Force","AMC"}, // Air Mobility Command ("Reach")
+ {"SAM","US Air Force","US Air Force","SAM"}, // Special Air Mission
+ {"CNV","US Navy","US Navy",""},
+ {"PAT","US Army","US Army",""},
+ {"GAF","Luftwaffe","German Air Force",""},
+ {"GAM","Heer","German Army",""},
+ {"GNY","Marine","German Navy",""},
+ {"RRR","Royal Air Force","Royal Air Force",""},
+ {"RFR","Royal Air Force","Royal Air Force",""},
+ {"CTM","French Air Force","French Air Force","COTAM"},
+ {"FAF","French Air Force","French Air Force",""},
+ {"IAM","Italian Air Force","Italian Air Force",""},
+ {"AME","Spanish Air Force","Spanish Air Force",""},
+ {"BAF","Belgian Air Force","Belgian Air Force",""},
+ {"NAF","Royal Neth. AF","Royal Neth. AF",""},
+ {"PLF","Polish Air Force","Polish Air Force",""},
+ {"CEF","Czech Air Force","Czech Air Force",""},
+ {"HAF","Hellenic Air Force","Hellenic Air Force",""},
+ {"SUI","Swiss Air Force","Swiss Air Force",""},
+ {"CFC","Royal Canadian AF","Royal Canadian AF",""},
+ {"ASY","Royal Austr. AF","Royal Austr. AF",""},
+ {"NATO","NATO","NATO","AWACS"},
+ {"RFF","Russian Air Force","Russian Air Force",""},
+ };
+ if (!callsign || !*callsign) return nullptr;
+ for (const auto& m : table) {
+ size_t n = strlen(m.prefix);
+ if (!strncmp(callsign, m.prefix, n)) {
+ // A prefix must be followed by the flight number (digits), not more letters.
+ char next = callsign[n];
+ if (n == 4 || (next >= '0' && next <= '9')) return &m;
+ }
+ }
+ return nullptr;
+}
+
+// variant 1 = branch, 2 = branch / unit (if it fits in `limit` characters).
+inline bool militaryOperatorText(const char* callsign, uint8_t variant, bool english, char* out, size_t cap, size_t limit = 18) {
+ const MilitaryOperator* m = (variant == 1 || variant == 2) ? militaryOperatorFor(callsign) : nullptr;
+ if (!m || !out || !cap) return false;
+ const char* branch = english ? m->en : m->de;
+ out[0] = 0;
+ if (variant == 2 && m->unit[0] && strlen(branch) + 3 + strlen(m->unit) <= limit && strlen(branch) + 3 + strlen(m->unit) < cap) {
+ strcpy(out, branch); strcat(out, " / "); strcat(out, m->unit);
+ } else {
+ strncpy(out, branch, cap - 1); out[cap - 1] = 0;
+ }
+ return true;
+}
diff --git a/src/RadarFilter.h b/src/RadarFilter.h
new file mode 100644
index 0000000..a73d4c8
--- /dev/null
+++ b/src/RadarFilter.h
@@ -0,0 +1,37 @@
+#pragma once
+// Which aircraft the radar may skip, by the ADS-B emitter category the aircraft
+// sends itself (A1 light ... A7 rotorcraft, B1 glider, B2 balloon, B4 ultralight,
+// B6 drone, C1-C3 surface vehicles/obstacles) and the ground flag. Aircraft
+// without a category are never hidden by the category filters.
+#include
+#include
+
+enum : uint8_t {
+ RADAR_HIDE_HELI = 1, // A7
+ RADAR_HIDE_LIGHT = 2, // A1
+ RADAR_HIDE_SPORT = 4, // B1, B2, B4, B6
+ RADAR_HIDE_GROUND = 8, // on the ground and surface vehicles (C*)
+ RADAR_HIDE_ALL = 15
+};
+
+inline bool radarHidden(const char* category, bool onGround, uint8_t mask) {
+ if (!mask) return false;
+ const char* c = category ? category : "";
+ if ((mask & RADAR_HIDE_GROUND) && (onGround || c[0] == 'C')) return true;
+ if ((mask & RADAR_HIDE_HELI) && !strcmp(c, "A7")) return true;
+ if ((mask & RADAR_HIDE_LIGHT) && !strcmp(c, "A1")) return true;
+ if ((mask & RADAR_HIDE_SPORT) && (!strcmp(c, "B1") || !strcmp(c, "B2") || !strcmp(c, "B4") || !strcmp(c, "B6"))) return true;
+ return false;
+}
+
+// Emergency squawks: 7500 unlawful interference, 7600 radio failure, 7700 general emergency.
+inline bool radarEmergencySquawk(const char* squawk) {
+ return squawk && (!strcmp(squawk, "7500") || !strcmp(squawk, "7600") || !strcmp(squawk, "7700"));
+}
+
+// Climb/descent indicator: +1 climbing, -1 descending, 0 level or unknown.
+static const float RADAR_TREND_FPM = 300.0f;
+inline int8_t radarTrend(bool hasRate, float rateFpm) {
+ if (!hasRate) return 0;
+ return rateFpm >= RADAR_TREND_FPM ? 1 : (rateFpm <= -RADAR_TREND_FPM ? -1 : 0);
+}
diff --git a/src/RadarScan.h b/src/RadarScan.h
new file mode 100644
index 0000000..ecbde4e
--- /dev/null
+++ b/src/RadarScan.h
@@ -0,0 +1,44 @@
+#pragma once
+// Reads the "ac" array of an adsb.lol answer one aircraft at a time, so the
+// memory need does not grow with the number of aircraft in the radius.
+// Body needs read() and peek() (-1 at the end) and works as an ArduinoJson
+// reader; visit(JsonObjectConst) is called for every aircraft object.
+#include
+#include
+
+template
+inline bool radarScanSkipTo(Body& body, const char* key) {
+ // Find "key" (with quotes) and the following '['.
+ size_t matched = 0, len = strlen(key);
+ for (;;) {
+ int c = body.read();
+ if (c < 0) return false;
+ if (matched < len) {
+ matched = (c == key[matched]) ? matched + 1 : (c == key[0] ? 1 : 0);
+ } else if (c == '[') {
+ return true;
+ } else if (c != ':' && c != ' ' && c != '\n' && c != '\r' && c != '\t') {
+ matched = (c == key[0]) ? 1 : 0; // "ac" was a value or part of another key
+ }
+ }
+}
+
+// Returns the number of objects read; err is set on a JSON error.
+template
+inline uint16_t radarScanArray(Body& body, JsonDocument& doc, const JsonDocument& filter,
+ Visit visit, DeserializationError& err, uint16_t limit = 800) {
+ err = DeserializationError::Ok;
+ if (!radarScanSkipTo(body, "\"ac\"")) { err = DeserializationError::InvalidInput; return 0; }
+ uint16_t n = 0;
+ while (n < limit) {
+ int c = body.peek();
+ while (c == ',' || c == ' ' || c == '\n' || c == '\r' || c == '\t') { body.read(); c = body.peek(); }
+ if (c != '{') break; // ']' or end of data
+ doc.clear();
+ err = deserializeJson(doc, body, DeserializationOption::Filter(filter));
+ if (err) return n;
+ ++n;
+ visit(doc.as());
+ }
+ return n;
+}
diff --git a/src/TrackFlight.cpp b/src/TrackFlight.cpp
index a6bdf97..f473768 100644
--- a/src/TrackFlight.cpp
+++ b/src/TrackFlight.cpp
@@ -154,10 +154,12 @@ bool trackedFlightFetchStatus(const String& apiKey, const String& flightNumber)
item["flight"]["iata"] = true;
item["flight"]["icao"] = true;
item["departure"]["iata"] = true;
+ item["departure"]["icao"] = true;
item["departure"]["scheduled"] = true;
item["departure"]["estimated"] = true;
item["departure"]["actual"] = true;
item["arrival"]["iata"] = true;
+ item["arrival"]["icao"] = true;
item["arrival"]["scheduled"] = true;
item["arrival"]["estimated"] = true;
item["arrival"]["actual"] = true;
@@ -203,8 +205,9 @@ bool trackedFlightFetchStatus(const String& apiKey, const String& flightNumber)
strlcpy(next.flightIata, x["flight"]["iata"] | next.requested, sizeof(next.flightIata));
strlcpy(next.flightIcao, x["flight"]["icao"] | "", sizeof(next.flightIcao));
strlcpy(next.airline, x["airline"]["name"] | "", sizeof(next.airline));
- strlcpy(next.origin, x["departure"]["iata"] | "N/A", sizeof(next.origin));
- strlcpy(next.destination, x["arrival"]["iata"] | "N/A", sizeof(next.destination));
+ // IATA code, or the ICAO code for airfields without one.
+ strlcpy(next.origin, x["departure"]["iata"] | (x["departure"]["icao"] | "N/A"), sizeof(next.origin));
+ strlcpy(next.destination, x["arrival"]["iata"] | (x["arrival"]["icao"] | "N/A"), sizeof(next.destination));
strlcpy(next.status, x["flight_status"] | "unknown", sizeof(next.status));
strlcpy(next.registration, x["aircraft"]["registration"] | "", sizeof(next.registration));
strlcpy(next.typeCode, x["aircraft"]["icao"] | "", sizeof(next.typeCode));
@@ -309,7 +312,7 @@ bool trackedFlightFetchRoute() {
if(g_t.route.count>2||(positioned?g_routePositionDone:g_routeInitialDone))return false;
if(positioned)g_routePositionDone=true;
g_routeInitialDone=true;
- FlightRoute route={};char origin[4]={},destination[4]={};
+ FlightRoute route={};char origin[ROUTE_CODE_SIZE]={},destination[ROUTE_CODE_SIZE]={};
const char* call=g_t.flightIcao[0]?g_t.flightIcao:g_t.flightIata;
if(!trackerRouteLookup(call,g_routeLat,g_routeLon,route,origin,destination))return false;
// A static route may be stale. Accept it only if it contains this reported leg.
diff --git a/src/TrackFlight.h b/src/TrackFlight.h
index 6d66fb1..46bf79f 100644
--- a/src/TrackFlight.h
+++ b/src/TrackFlight.h
@@ -11,8 +11,8 @@ struct TrackedFlightSnapshot {
char flightIata[12];
char flightIcao[12];
char airline[28];
- char origin[4];
- char destination[4];
+ char origin[ROUTE_CODE_SIZE];
+ char destination[ROUTE_CODE_SIZE];
FlightRoute route;
char status[16];
char depScheduled[6];
diff --git a/src/TrackerRoute.cpp b/src/TrackerRoute.cpp
index 9cf0d45..d31f20c 100644
--- a/src/TrackerRoute.cpp
+++ b/src/TrackerRoute.cpp
@@ -31,16 +31,16 @@ static void makeSecure(BearSSL::WiFiClientSecure& client, BearSSL::Session* sess
client.setTimeout(9000);
}
-static void routeFallback(char outOrigin[4], char outDestination[4]) {
- strlcpy(outOrigin, "N/A", 4);
- strlcpy(outDestination, "N/A", 4);
+static void routeFallback(char outOrigin[ROUTE_CODE_SIZE], char outDestination[ROUTE_CODE_SIZE]) {
+ strlcpy(outOrigin, "N/A", ROUTE_CODE_SIZE);
+ strlcpy(outDestination, "N/A", ROUTE_CODE_SIZE);
}
-static bool routeComplete(const char origin[4], const char destination[4]) {
+static bool routeComplete(const char origin[ROUTE_CODE_SIZE], const char destination[ROUTE_CODE_SIZE]) {
return routeCode(origin) && routeCode(destination);
}
-static bool lookupRouteAdsbLol(const char* callsign, float lat, float lon, char origin[4], char destination[4], FlightRoute& chain) {
+static bool lookupRouteAdsbLol(const char* callsign, float lat, float lon, char origin[ROUTE_CODE_SIZE], char destination[ROUTE_CODE_SIZE], FlightRoute& chain) {
DiagRequest trace(D_TRACK_ROUTE);trace.stage(DS_TLS);
if (serviceWaitMs(SERVICE_ADSB_LOL)||!tlsHeapReady(g_adsbLolRx ? g_adsbLolRx : 512)) return false;
const uint16_t rx=adsbLolRx();
@@ -87,14 +87,23 @@ static bool lookupRouteAdsbLol(const char* callsign, float lat, float lon, char
route.trim();
if (!route.length() || route == "unknown") return false;
if (!parseFlightRoute(route.c_str(), chain)) return false;
- strlcpy(origin, chain.airports[0], 4);
+ strlcpy(origin, chain.airports[0], ROUTE_CODE_SIZE);
// Preserve the true final airport even if the bounded display chain overflows.
String last=route.substring(route.lastIndexOf('-')+1);last.trim();last.toUpperCase();
- strlcpy(destination, last.c_str(), 4);
+ strlcpy(destination, last.c_str(), ROUTE_CODE_SIZE);
bool ok=routeComplete(origin,destination);trace.finish(ok);return ok;
}
-static bool lookupRouteAdsbDb(const char* callsign, char origin[4], char destination[4], FlightRoute& chain) {
+// adsbdb: IATA code, or the ICAO code if the airport has none.
+static String airportCode(JsonObjectConst ap) {
+ String code = ap["iata_code"] | "";
+ code.trim();
+ if (!code.length()) { code = ap["icao_code"] | ""; code.trim(); }
+ code.toUpperCase();
+ return code;
+}
+
+static bool lookupRouteAdsbDb(const char* callsign, char origin[ROUTE_CODE_SIZE], char destination[ROUTE_CODE_SIZE], FlightRoute& chain) {
DiagRequest trace(D_TRACK_ROUTE);trace.stage(DS_TLS);
if (serviceWaitMs(SERVICE_ADSB_DB)||!tlsHeapReady(4096)) return false;
BearSSL::Session routeSession;
@@ -116,9 +125,10 @@ static bool lookupRouteAdsbDb(const char* callsign, char origin[4], char destina
if (code != HTTP_CODE_OK) { http.end(); return false; }
JsonDocument filter(networkJsonAllocator());
- filter["response"]["flightroute"]["origin"]["iata_code"] = true;
- filter["response"]["flightroute"]["destination"]["iata_code"] = true;
- filter["response"]["flightroute"]["midpoint"]["iata_code"] = true;
+ for (const char* key : {"origin", "destination", "midpoint"}) {
+ filter["response"]["flightroute"][key]["iata_code"] = true;
+ filter["response"]["flightroute"][key]["icao_code"] = true; // for airfields without IATA code
+ }
JsonDocument doc(networkJsonAllocator());
trace.stage(DS_JSON);
if(!jsonFilterReady(filter,trace)){http.end();client.stop();return false;}
@@ -126,21 +136,19 @@ static bool lookupRouteAdsbDb(const char* callsign, char origin[4], char destina
logJsonError(trace,err); filter.clear(); http.end(); client.stop();
if (err) return false;
- String a = doc["response"]["flightroute"]["origin"]["iata_code"] | "";
- String b = doc["response"]["flightroute"]["destination"]["iata_code"] | "";
- a.trim(); b.trim(); a.toUpperCase(); b.toUpperCase();
- if (a.length() == 3) strlcpy(origin, a.c_str(), 4);
- if (b.length() == 3) strlcpy(destination, b.c_str(), 4);
+ String a = airportCode(doc["response"]["flightroute"]["origin"]);
+ String b = airportCode(doc["response"]["flightroute"]["destination"]);
+ if (routeCode(a.c_str())) strlcpy(origin, a.c_str(), ROUTE_CODE_SIZE);
+ if (routeCode(b.c_str())) strlcpy(destination, b.c_str(), ROUTE_CODE_SIZE);
if (!routeComplete(origin,destination)) return false;
chain={};appendRouteAirport(chain,origin);
- String midpoint=doc["response"]["flightroute"]["midpoint"]["iata_code"] | "";
- midpoint.trim();midpoint.toUpperCase();
+ String midpoint=airportCode(doc["response"]["flightroute"]["midpoint"]);
if(midpoint.length())appendRouteAirport(chain,midpoint.c_str());
appendRouteAirport(chain,destination);
trace.finish(true);return true;
}
-static bool performRouteLookup(const char* callsign, float lat, float lon, char origin[4], char destination[4], FlightRoute& chain) {
+static bool performRouteLookup(const char* callsign, float lat, float lon, char origin[ROUTE_CODE_SIZE], char destination[ROUTE_CODE_SIZE], FlightRoute& chain) {
routeFallback(origin, destination);
chain={};
bool ok = !isnan(lat) && !isnan(lon) && lookupRouteAdsbLol(callsign, lat, lon, origin, destination, chain);
@@ -151,7 +159,7 @@ static bool performRouteLookup(const char* callsign, float lat, float lon, char
return ok;
}
-bool trackerRouteLookup(const char* callsign,float lat,float lon,FlightRoute& route,char origin[4],char destination[4]) {
+bool trackerRouteLookup(const char* callsign,float lat,float lon,FlightRoute& route,char origin[ROUTE_CODE_SIZE],char destination[ROUTE_CODE_SIZE]) {
if(!callsign||strlen(callsign)<3||WiFi.status()!=WL_CONNECTED )return false;
return performRouteLookup(callsign,lat,lon,origin,destination,route);
}
diff --git a/src/TrackerRoute.h b/src/TrackerRoute.h
index 7813c84..ee3c05a 100644
--- a/src/TrackerRoute.h
+++ b/src/TrackerRoute.h
@@ -4,4 +4,4 @@
// Tracker enrichment is independent of the restored radar implementation.
bool trackerRouteLookup(const char* callsign, float lat, float lon, FlightRoute& route,
- char origin[4], char destination[4]);
+ char origin[ROUTE_CODE_SIZE], char destination[ROUTE_CODE_SIZE]);
diff --git a/src/Version.h b/src/Version.h
index 8b04ae3..49837a7 100644
--- a/src/Version.h
+++ b/src/Version.h
@@ -1,6 +1,6 @@
#pragma once
// Single place for name and version; every User-Agent is built from it.
#define FW_NAME "PixelStop"
-#define FW_VERSION "0.5.2-dev"
+#define FW_VERSION "0.5.3-dev"
#define FW_REPO "github.com/du13500/pixelstop"
#define FW_USER_AGENT FW_NAME "/" FW_VERSION " (+https://" FW_REPO ")"
diff --git a/src/main.cpp b/src/main.cpp
index 77f56fe..3d356bb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,5 +1,6 @@
#include
+#include
#include
#include
#include
@@ -26,6 +27,8 @@
#include "TimeZones.h"
#include "WeatherVisual.h"
#include "AircraftLabel.h"
+#include "MilitaryOperator.h"
+#include "RadarFilter.h"
#include "DestinationFormat.h"
#include "webui_en.h"
@@ -55,6 +58,7 @@
#define C_DGRAY 0x4208
#define C_BLUE 0x041F
#define C_CYAN 0x07FF
+#define C_KHAKI 0xBDAD
enum AppMode : uint8_t {
MODE_DEPARTURES = 0,
@@ -65,7 +69,14 @@ enum AppMode : uint8_t {
MODE_COUNTDOWN1 = 5,
MODE_COUNTDOWN2 = 6,
MODE_COUNTDOWN3 = 7,
- MODE_COUNTDOWN4 = 8
+ MODE_COUNTDOWN4 = 8,
+ MODE_FORECAST = 9 // three-day forecast; appended so stored masks keep their bits
+};
+static const uint8_t MODE_COUNT = 10;
+// Rotation follows the order of the list in the web interface.
+static const uint8_t ROTATION_ORDER[MODE_COUNT] = {
+ MODE_DEPARTURES, MODE_WEATHER, MODE_FORECAST, MODE_PLANE, MODE_TRACKED_FLIGHT, MODE_CLOCK,
+ MODE_COUNTDOWN1, MODE_COUNTDOWN2, MODE_COUNTDOWN3, MODE_COUNTDOWN4
};
enum Language : uint8_t { LANG_DE = 0, LANG_EN = 1 };
@@ -96,8 +107,9 @@ struct Settings {
uint8_t mode = MODE_DEPARTURES; // current runtime view
uint16_t rotationMask = (1U << MODE_DEPARTURES);
- uint16_t rotationSec[9] = {30,20,20,15,20,20,20,20,20};
+ uint16_t rotationSec[MODE_COUNT] = {30,20,20,15,20,20,20,20,20,15};
uint8_t brightness = 70;
+ uint8_t backlightMode = 0; // 0 = PWM, 1 = sigma-delta (test against flashes)
String timeZone = "Europe/Berlin";
bool nightEnabled = true;
@@ -114,7 +126,6 @@ struct Settings {
bool departureCompactDestinations = false;
bool departureAbbreviate = true; // Hbf, Str., Pl. ...
bool departureDropTown = true; // "Dresden Bühlau" -> "Bühlau"
- bool weatherForecast = true; // alternate with a three-day forecast page
String weatherCity = "Dresden"; // selected real place / fallback title
String weatherDisplayName = ""; // optional display-only title
@@ -134,6 +145,11 @@ struct Settings {
bool planeShowPlace = false;
bool planeShowAge = true;
uint16_t planePlaceToggleSec = 10;
+ uint8_t planeOperator = 0; // 0 = name of the callsign, 1 = branch, 2 = both
+ uint8_t planeSpeed = 0; // 0 = off, 1 = km/h, 2 = knots
+ bool planeTrend = false; // climb/descent arrow
+ bool planeMarkMilitary = true; // "MIL" next to the callsign
+ uint8_t planeHide = 0; // RadarFilter.h bits
String trackedFlightNo = "";
String aviationstackKey = "";
@@ -154,7 +170,6 @@ static uint32_t lastModeSwitchMs = 0;
static String lastCountdownRendered[4];
static uint8_t departurePage = 0;
static uint8_t weatherPage = 0; // 0 = today, 1 = three-day forecast
-static uint32_t lastWeatherPageSwitchMs = 0;
static bool departurePagingReady = false;
static uint32_t lastDeparturePageSwitchMs = 0;
static bool planePlacePhase = false;
@@ -200,25 +215,25 @@ static const char WEBUI[] PROGMEM = R"HTML(
-
PixelStop
v)HTML" FW_VERSION R"HTML(
-
+
PixelStop
Anzeige
v)HTML" FW_VERSION R"HTML(
+
Anzeigerotation
Programme anhaken und je Ansicht die Anzeigedauer festlegen. Mit nur einem Haken bleibt die Ansicht dauerhaft stehen.
-
+
Sigma-Delta dimmt über einen eigenen Baustein des Chips und wird nicht von WLAN-Aufgaben unterbrochen. Bitte nachts bei geringer Helligkeit vergleichen.
Zeitzone
Gilt für Uhr, Footer, Nachtmodus, Wetter-Zeitangaben und Tages-Countdowns. Sommer- und Winterzeit werden nach den Regeln der ausgewählten Zone umgestellt.
Nachtmodus
Abfahrtsmonitor
Live vom Verkehrsverbund Oberelbe (VVO). Haltestelle suchen, Treffer wählen und Verkehrsmittel auswählen.
Darstellung Fahrziel
Beispiel: „Dresden Bühlau“ wird zu „Bühlau“, wenn die Haltestelle in Dresden liegt.
-
Wetter
Live von Open-Meteo. Ort suchen und den Beobachtungspunkt auf der Karte exakt setzen. Standort gilt nur für dieses Programm.
Zeigt die Sekunden seit dem letzten erfolgreichen Positionsabruf.
Entfernung und Höhe werden zwischen den Abrufen aus Geschwindigkeit, Kurs und Steigrate weitergerechnet. Der Punkt unten links zeigt den Stand: kurz weiß bei neuen Daten, grün im normalen Takt, gelb Abruf überfällig, grau Werte angehalten.
adsb.lol lehnt den Key ab – vermutlich ist er abgelaufen. Neuen Key holen und hier eintragen.
adsb.lol lehnt Anfragen ohne Key ab. Mit einem kostenlosen Key geht es weiter.
ⓘ Mehr dazu
Ohne Schlüssel erlaubt adsb.lol nur eine begrenzte Zahl von Anfragen pro Tag und Internetanschluss; für den Dauerbetrieb ohne Schlüssel 3 min wählen. „-“ eintragen und speichern entfernt einen gespeicherten Schlüssel.
adsb.lol kann Abfragen je nach Serverauslastung vorübergehend begrenzen. Während einer Anbieterpause bleibt das zuletzt empfangene Flugzeug stehen. Nach einer Anbieterbegrenzung verlängert sich das Aktualisierungsintervall automatisch. Nach 10 Minuten ohne erneute Begrenzung gilt wieder das ausgewählte Intervall.
+
Flugradar
Live von adsb.lol. Ort suchen und den Beobachtungspunkt auf der Karte exakt setzen. Standort gilt nur für dieses Programm.
Zeigt die Sekunden seit dem letzten erfolgreichen Positionsabruf.
Entfernung und Höhe werden zwischen den Abrufen aus Geschwindigkeit, Kurs und Steigrate weitergerechnet. Der Punkt unten links zeigt den Stand: kurz weiß bei neuen Daten, grün im normalen Takt, gelb Abruf überfällig, grau Werte angehalten.
Darstellung
Beispiel RCH5060: „Air Mobility Command“, „US Air Force“ oder „US Air Force / AMC“. Oberbegriff und „Beides“ gelten für bekannte Militär-Rufzeichen; sonst bleibt der Name zum Rufzeichen.
Im Wechsel mit dem Kennzeichen, alle 3 Sekunden.
Ausblenden
Mit Filter fragt PixelStop alle Flugzeuge im Radius ab und zeigt das nächste passende. Die Antwort ist größer, bei großem Radius dauert der Abruf etwas länger. Flugzeuge ohne Kategorie werden nie ausgeblendet. Notfälle (Squawk 7500/7600/7700) erscheinen immer rot.
adsb.lol lehnt den Key ab – vermutlich ist er abgelaufen. Neuen Key holen und hier eintragen.
adsb.lol lehnt Anfragen ohne Key ab. Mit einem kostenlosen Key geht es weiter.
ⓘ Mehr dazu
Ohne Schlüssel erlaubt adsb.lol nur eine begrenzte Zahl von Anfragen pro Tag und Internetanschluss; für den Dauerbetrieb ohne Schlüssel 3 min wählen. „-“ eintragen und speichern entfernt einen gespeicherten Schlüssel.
adsb.lol kann Abfragen je nach Serverauslastung vorübergehend begrenzen. Während einer Anbieterpause bleibt das zuletzt empfangene Flugzeug stehen. Nach einer Anbieterbegrenzung verlängert sich das Aktualisierungsintervall automatisch. Nach 10 Minuten ohne erneute Begrenzung gilt wieder das ausgewählte Intervall.
Flug-Tracker
Verfolgt genau einen Flug. Plan-/Ist-Zeiten kommen von aviationstack; Höhe und Geschwindigkeit während des Fluges zusätzlich über adsb.lol.
Statusabfragen laufen sparsam und nur, wenn der Tracker tatsächlich angezeigt wird.