Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
run: |
set -o pipefail
pio run -e smalltv_ultra 2>&1 | tee build.log
python3 tools/check_ram.py build.log

- name: Ergebnis vorbereiten
if: always()
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Änderungen

## v0.5.3.1-dev

- **Radar: Speicher zurückgeholt.** v0.5.3 belegte 748 Byte mehr festen Arbeitsspeicher als v0.5.2; während einer TLS-Abfrage blieben dadurch zeitweise nur ~4,3 KB frei, und die Antwort ließ sich nicht mehr einlesen („JSON:NoMemory“, Radar ohne Daten). Die Militär-Tabelle liegt jetzt im Flash, ebenso einige kurze Anzeigetexte.
- **Build-Prüfung:** `tools/check_ram.py` lässt den Build scheitern, wenn der feste RAM-Verbrauch über 51.600 Byte steigt.

## 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.
Expand Down
4 changes: 2 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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.

[![Build](https://github.com/du13500/pixelstop/actions/workflows/build.yml/badge.svg)](https://github.com/du13500/pixelstop/actions/workflows/build.yml)
![Version](https://img.shields.io/badge/version-v0.5.3--dev-orange)
![Version](https://img.shields.io/badge/version-v0.5.3.1--dev-orange)
![Hardware](https://img.shields.io/badge/hardware-ESP8266%20%C2%B7%20SmallTV--Ultra-blue)
![Hardware test](https://img.shields.io/badge/hardware%20test-v0.5.3%20pending-yellow)
![Hobby project](https://img.shields.io/badge/hobby%20project-non--commercial-lightgrey)
Expand Down Expand Up @@ -59,7 +59,7 @@ Plus night mode, brightness down to 1 %, place search with a map, Greek and Cyri

</details>

## Status: v0.5.3-dev
## Status: v0.5.3.1-dev

| Area | Status |
| --- | --- |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Gekauft als kleiner WLAN-Würfel mit eher bescheidener Werksfirmware – und von Anfang an mit dem Plan, etwas Eigenes daraus zu machen.

[![Build](https://github.com/du13500/pixelstop/actions/workflows/build.yml/badge.svg)](https://github.com/du13500/pixelstop/actions/workflows/build.yml)
![Version](https://img.shields.io/badge/version-v0.5.3--dev-orange)
![Version](https://img.shields.io/badge/version-v0.5.3.1--dev-orange)
![Hardware](https://img.shields.io/badge/hardware-ESP8266%20%C2%B7%20SmallTV--Ultra-blue)
![Hardwaretest](https://img.shields.io/badge/hardwaretest-v0.5.3%20offen-yellow)
![Hobbyprojekt](https://img.shields.io/badge/hobbyprojekt-nicht%20kommerziell-lightgrey)
Expand Down Expand Up @@ -59,7 +59,7 @@ Dazu kommen Nachtmodus, Helligkeit ab 1 %, Ortssuche mit Karte, griechische und

</details>

## Entwicklungsstand: v0.5.3-dev
## Entwicklungsstand: v0.5.3.1-dev

| Bereich | Stand |
| --- | --- |
Expand Down
4 changes: 3 additions & 1 deletion TESTPLAN.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Testplan

Stand: v0.5.3-dev (09.11.2026). Dieser Plan wird mit jeder Version aktualisiert; frühere Pläne stehen in der Git-Historie, Änderungen in [`CHANGELOG.md`](CHANGELOG.md).
Stand: v0.5.3.1-dev (10.11.2026). Dieser Plan wird mit jeder Version aktualisiert; frühere Pläne stehen in der Git-Historie, Änderungen in [`CHANGELOG.md`](CHANGELOG.md).

## Hardwaretest v0.5.3-dev

0. **v0.5.3.1:** Radar über mehrere Stunden ohne „JSON:NoMemory“ im Log; kleinster freier Speicher der Radar-Zeilen wieder um 5 KB.

1. **Dimmverfahren:** Nachts bei 1–10 % unter *Anzeige → Dimmverfahren* zwischen Standard (PWM) und Sigma-Delta wechseln. Aufblitzen, Fiepen und saubere Helligkeitsstufen vergleichen; dabei auch Radar mit Abrufen und offenes Webinterface laufen lassen.
2. **Webinterface:** Menü hinter ☰ öffnen und schließen (Tippen daneben, Escape), Seitenname unter dem Titel; Auge-Symbol nur beim Tippen, nach dem Speichern wieder verdeckt und leer.
3. **3-Tage-Vorhersage:** nach dem Update als eigene Zeile unter „Wetter“ angehakt (wenn sie vorher aktiv war); eigene Dauer, ▶ Jetzt anzeigen; Wetter-Reiter ohne die alte Checkbox. Rotation in der Reihenfolge der Liste.
Expand Down
42 changes: 28 additions & 14 deletions src/MilitaryOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@
// 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).
// The table lives in flash; entries are copied out one at a time.
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#ifdef ARDUINO
#include <pgmspace.h>
#else
#ifndef PROGMEM
#define PROGMEM
#endif
#ifndef memcpy_P
#define memcpy_P memcpy
#endif
#endif

struct MilitaryOperator { const char* prefix; const char* de; const char* en; const char* unit; };
struct MilitaryOperator { char prefix[5]; char de[19]; char en[19]; char unit[6]; };

inline const MilitaryOperator* militaryOperatorFor(const char* callsign) {
static const MilitaryOperator table[] = {
// Copies the entry for the callsign into out; false if none matches.
inline bool militaryOperatorFor(const char* callsign, MilitaryOperator& out) {
static const MilitaryOperator table[] PROGMEM = {
{"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",""},
Expand All @@ -34,26 +46,28 @@ inline const MilitaryOperator* militaryOperatorFor(const char* callsign) {
{"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)) {
if (!callsign || !*callsign) return false;
for (size_t i = 0; i < sizeof(table) / sizeof(table[0]); i++) {
memcpy_P(&out, &table[i], sizeof(out));
size_t n = strlen(out.prefix);
if (!strncmp(callsign, out.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;
if (n == 4 || (next >= '0' && next <= '9')) return true;
}
}
return nullptr;
return false;
}

// 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;
MilitaryOperator m;
if ((variant != 1 && variant != 2) || !out || !cap || !militaryOperatorFor(callsign, m)) return false;
const char* branch = english ? m.en : m.de;
size_t combined = strlen(branch) + 3 + strlen(m.unit);
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);
if (variant == 2 && m.unit[0] && combined <= limit && combined < cap) {
strcpy(out, branch); strcat(out, " / "); strcat(out, m.unit);
} else {
strncpy(out, branch, cap - 1); out[cap - 1] = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Version.h
Original file line number Diff line number Diff line change
@@ -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.3-dev"
#define FW_VERSION "0.5.3.1-dev"
#define FW_REPO "github.com/du13500/pixelstop"
#define FW_USER_AGENT FW_NAME "/" FW_VERSION " (+https://" FW_REPO ")"
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ static const int PLANE_FOOTER_X=18;
// Name of the position source in the footer (prepared for further sources).
static const char* planeSourceLabel="ADSB.LOL";
static String planeFooterLabel() {
return flightProviderPaused()?String(TR("ABRUFPAUSE","PAUSED")):(flightData().error?String(TR("LETZTER STAND","LAST DATA")):String(planeSourceLabel)+" LIVE");
return flightProviderPaused()?String(TR("ABRUFPAUSE","PAUSED")):(flightData().error?String(TR("LETZTER STAND","LAST DATA")):String(planeSourceLabel)+F(" LIVE"));
}
static void drawPlaneAge() {
if(!cfg.planeShowAge||!flightData().valid)return;
Expand Down Expand Up @@ -1097,7 +1097,7 @@ static String planeOperatorText(const FlightSnapshot& f) {
return f.airline[0]?String(f.airline):String("N/A");
}
static String planeSpeedText(const FlightSnapshot& f) {
return cfg.planeSpeed==2?String((int)lroundf(f.speedKt))+" kt":String((int)lroundf(f.speedKt*1.852f))+" km/h";
return cfg.planeSpeed==2?String((int)lroundf(f.speedKt))+F(" kt"):String((int)lroundf(f.speedKt*1.852f))+F(" km/h");
}
static void drawPlane(bool force=true) {
const FlightSnapshot& f=flightData();
Expand All @@ -1122,7 +1122,7 @@ static void drawPlane(bool force=true) {
if(full||callKey!=lastPlaneCall){
if(!full)gfx->fillRect(8,35,224,40,C_BLACK);
String cs=f.callsign[0]?String(f.callsign):String("N/A");centerText(cs,42,cs.length()<=6?4:3,emergency?C_RED:C_WHITE);
if(cfg.planeMarkMilitary&&f.military)printDisplayTextAt(214,38,"MIL",1,C_KHAKI);
if(cfg.planeMarkMilitary&&f.military)printDisplayTextAt(214,38,String(F("MIL")),1,C_KHAKI);
}
lastPlaneCall=callKey;
String op=planeOperatorText(f);
Expand All @@ -1133,7 +1133,7 @@ static void drawPlane(bool force=true) {
lastPlaneOperator=op;
const bool routeKnown=f.route.count>0||(f.origin[0]&&strcmp(f.origin,"N/A"));
// In an emergency the whole route line is red: route and squawk alternate.
String routeKey=emergency?((second||!routeKnown)?String("SQUAWK ")+f.squawk:String("!")):String();
String routeKey=emergency?((second||!routeKnown)?String(F("SQUAWK "))+f.squawk:String(F("!"))):String();
if(full||routeKey!=lastPlaneRoute||strcmp(f.origin,lastPlaneRendered.origin)||strcmp(f.destination,lastPlaneRendered.destination)||
f.route.count!=lastPlaneRendered.route.count||f.route.truncated!=lastPlaneRendered.route.truncated||
memcmp(f.route.airports,lastPlaneRendered.route.airports,sizeof(f.route.airports))){
Expand Down
17 changes: 17 additions & 0 deletions tools/check_ram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
"""Fails the build when the static RAM use grows past the limit.

The ESP8266 has ~80 KB RAM; every byte of static data is missing from the heap
during TLS requests, where only a few KB are left. v0.5.3 lost ~750 bytes this
way and radar answers no longer fit. Raise the limit only on purpose.
"""
import re, sys
LIMIT = 51600 # bytes; v0.5.2 used 51396
log = open(sys.argv[1] if len(sys.argv) > 1 else 'build.log', encoding='utf-8', errors='replace').read()
m = re.search(r'RAM:.*?used (\d+) bytes from (\d+) bytes', log)
if not m:
sys.exit('RAM line not found in build log')
used = int(m.group(1))
print(f'Static RAM: {used} bytes (limit {LIMIT}, {LIMIT - used:+d} bytes headroom)')
if used > LIMIT:
sys.exit(f'Static RAM {used} bytes exceeds the limit of {LIMIT} bytes – move constant data to flash (PROGMEM/F()).')
1 change: 1 addition & 0 deletions tools/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def struct(name,file):
#include "RadarFilter.h"
#include "MilitaryOperator.h"
#define PSTR(x) (x)
#define F(x) (x)
#define FPSTR(x) (x)
#define PGM_P const char*
struct String:std::string {
Expand Down
Loading