Compare commits

..
Author SHA1 Message Date
Ricardo Guzman a665e2c16a Merge commit 'refs/pr/476' into remove-btstop 2026-11-17 16:15:59 -03:00
Ricardo Guzman 116e8a8159 mqtt timeouts fix 2026-11-17 15:55:51 -03:00
Ricardo Guzman cff8abc248 Merge commit 'refs/pr/478' into fix-aprs-is-connection 2026-11-17 14:36:09 -03:00
Ricardo Guzman a9cf1a150b Merge commit 'refs/pr/480' into phone-text-webpage-fix 2026-11-17 14:20:16 -03:00
Walter Dunckel 9aa4062d7b Web page: let the title bar grow on phones instead of overflowing
The bar had a fixed height of 56 px. On a phone held upright (every width from 320 to 430 px) the title wraps to three or four lines next to the
four buttons and sticks out of the bar, so its first line slides under the browser's address bar. The bar now has a minimum height; below 576 px wide
the title takes its own row and the buttons sit on the row below.

Measured at 320 to 768 px wide: nothing sticks out any more, widths from 768 px up are unchanged (56 px), and between 440 and 640 px the bar is up to
12 px taller than before.
2026-11-01 12:51:46 -08:00
Walter Dunckel 12c8e40b3c APRS-IS: read each server line up to the newline, not up to the carriage return
APRS-IS lines end with CR LF. readStringUntil('\r') returns at the CR and leaves the LF in the buffer; the next call finds one byte
available, reads it, and then waits the stream's default timeout (1 s) for another CR. The main loop, and so the radio, stalls for a
second after every line the server sends.

Measured on a LILYGO LoRa32 V2.1 with WiFi and APRS-IS connected: the longest main-loop pass in a minute was 1033 ms before this change
and 35 to 98 ms after it.
2026-11-01 12:46:23 -08:00
Walter DunckelandClaude Sonnet 5.5 e1bff11d79 Remove btStop() so the Bluetooth controller memory is released
Referencing btStop() links esp32-hal-bt.c, whose btInUse() returns true,
so initArduino() skips esp_bt_controller_mem_release(). Nothing in this
project uses Bluetooth, so removing the call frees the memory.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 17:50:31 -07:00
5 changed files with 22 additions and 5 deletions

No files matched your search

+2 -1
View File
@@ -22,8 +22,9 @@
[data-variant="night"] .btn-save{background:#000;border-color:#000;color:#ff6b6b;}
[data-variant="night"] .btn-save:hover{background:#1a0000;color:#ff8a8a;}
body{background:var(--msh-bg);color:var(--msh-text);font-family:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;}
.app-topbar{background:#b21d1d;border-bottom:1px solid rgba(0,0,0,.25);height:56px;z-index:1030;}
.app-topbar{background:#b21d1d;border-bottom:1px solid rgba(0,0,0,.25);min-height:56px;padding-top:.35rem;padding-bottom:.35rem;z-index:1030;}
.app-topbar .brand{font-weight:600;color:#fff;font-size:1.1rem;}
@media(max-width:575.98px){.app-topbar{flex-wrap:wrap;row-gap:.35rem;}.app-topbar .brand{flex:1 1 100%;font-size:.95rem;line-height:1.25;}}
.btn-icon{background:transparent;border:1px solid rgba(255,255,255,.45);color:#fff;display:inline-flex;align-items:center;}
.btn-icon:hover{background:rgba(255,255,255,.15);color:#fff;}
.btn-save{background:#fff;border:1px solid #fff;color:#b21d1d;font-weight:600;}
+1 -1
View File
@@ -215,7 +215,7 @@
void listenAPRSIS() {
if (SerialAT.available()) {
String packetAPRSIS = SerialAT.readStringUntil('\r');
String packetAPRSIS = SerialAT.readStringUntil('\n'); // modem lines end with "\r\n": reading up to '\r' left the '\n' and the next call stalled for the 1 s stream timeout (same fix as listenAPRSIS in aprs_is_utils.cpp); trim() removes the '\r'
packetAPRSIS.trim();
if (!packetAPRSIS.startsWith("#") && packetAPRSIS.indexOf("+IPD") == -1 && packetAPRSIS.indexOf("RECV") == -1 && packetAPRSIS.length() > 0) {
APRS_IS_Utils::processAPRSISPacket(packetAPRSIS);
+4 -1
View File
@@ -376,7 +376,10 @@ namespace APRS_IS_Utils {
#else
if (aprsIsClient.connected()) {
if (aprsIsClient.available()) {
String aprsisPacket = aprsIsClient.readStringUntil('\r');
// APRS-IS lines end with "\r\n". Reading up to '\r' left the '\n' in the buffer, and the next call then waited the stream's default 1 s
// for another '\r' before returning, so the main loop (and with it the radio) stalled for a second after every line from the server.
// Read up to '\n' instead; trim() below removes the '\r'.
String aprsisPacket = aprsIsClient.readStringUntil('\n');
aprsisPacket.trim(); // Serial.println(aprsisPacket);
processAPRSISPacket(aprsisPacket);
}
+15 -1
View File
@@ -57,13 +57,24 @@ namespace MQTT_Utils {
STATION_Utils::addToOutputPacketBuffer(String(payload, length));
}
// Connecting blocks the main loop for as long as it takes (DNS, TCP connect, wait for the broker's CONNACK), and the loop used to retry on every
// pass. Now: after a failed attempt wait 15 s before the next one, then twice as long each time, up to 5 minutes (a success starts over at 15 s);
// and each attempt is shorter (TCP connect 3 s, CONNACK wait 5 s, instead of 3 s and 15 s).
static const uint32_t RETRY_FIRST_MS = 15000;
static const uint32_t RETRY_MAX_MS = 300000;
static uint32_t nextTry = 0; // earliest time of the next connect attempt
static uint32_t retryDelayMs = RETRY_FIRST_MS;
void connect() {
if (pubSub.connected()) return;
if (Config.mqtt.server.isEmpty() || Config.mqtt.port <= 0) {
Serial.println("Connect to MQTT server KO because no host or port given");
return;
}
if ((int32_t)(millis() - nextTry) < 0) return; // still waiting after a failed attempt
pubSub.setServer(Config.mqtt.server.c_str(), Config.mqtt.port);
mqttClient.setTimeout(3); // seconds: TCP connect (same as the WiFiClient default, kept explicit)
pubSub.setSocketTimeout(5); // seconds: wait for the broker's CONNACK, and for the rest of a partly received packet (default 15)
Serial.print("Trying to connect with MQTT Server: " + String(Config.mqtt.server) + " MqttServerPort: " + String(Config.mqtt.port));
bool connected = false;
@@ -74,6 +85,7 @@ namespace MQTT_Utils {
}
if (connected) {
retryDelayMs = RETRY_FIRST_MS; // the next drop starts again at 15 s
Serial.println(" -> Connected !");
const String subscribedTopic = Config.mqtt.topic + "/" + Config.callsign + "/#";
if (!pubSub.subscribe(subscribedTopic.c_str())) {
@@ -82,7 +94,9 @@ namespace MQTT_Utils {
Serial.print("Subscribed to MQTT topic : ");
Serial.println(subscribedTopic);
} else {
Serial.println(" -> Not Connected (Retry in a few secs)");
nextTry = millis() + retryDelayMs; // counted from the end of the attempt
Serial.println(" -> Not Connected (retry in " + String(retryDelayMs / 1000) + " s)");
retryDelayMs = (retryDelayMs * 2 > RETRY_MAX_MS) ? RETRY_MAX_MS : retryDelayMs * 2;
}
}
-1
View File
@@ -139,7 +139,6 @@ namespace WIFI_Utils {
void setup() {
if (Config.digi.ecoMode == 0) startWiFi();
btStop();
}
}