Compare commits

..
8 Commits
Author SHA1 Message Date
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
Ricardo Guzman 9db47174f6 update 2026-11-17 13:59:13 -03:00
Ricardo Guzman 8fb5135746 new changes to RP2035 update 2026-11-17 13:55:33 -03:00
Ricardo Guzman 23f042c83d Merge branch 'rp2035-merge' into rp2035-with-IS2 2026-11-17 13:55:17 -03:00
Ricardo Guzman 2b6012a0ca Wifi Fix when returning from backupMode 2026-11-17 13:48:50 -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
9 changed files with 52 additions and 13 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);
+1 -1
View File
@@ -69,7 +69,7 @@ ___________________________________________________________________*/
#endif
String versionDate = "2026-10-29";
String versionDate = "2026-11-17";
String versionNumber = "4.0.5";
Configuration Config;
WiFiClient aprsIsClient;
+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);
}
+31 -2
View File
@@ -3,6 +3,7 @@
#include <APRSPacketLib.h>
#include "configuration.h"
#include "station_rp2350.h"
#include "syslog_rp2350.h"
extern Configuration Config;
// Inbox store (eth_web.cpp) — poll() runs in netTask, same task that owns it.
@@ -20,6 +21,18 @@ static const uint32_t SILENT_DROP_MS = 60000;
// Parse one APRS-IS line; if it's a message addressed to our callsign, record it
// in the inbox and ack it (if it carries a {msgid}).
static void processAprsisLine(const String &line) {
// Login answer: "# logresp CALL verified, server T2XXX" / "... unverified, ...".
// Like the ESP32 (APRS_IS_Utils::processAPRSISPacket), a rejected passcode stops APRS-IS
// (until the next boot or config save) instead of reconnecting every 10 s and uploading
// packets the server ignores. Only an explicit "unverified" blocks: if a server never
// answers, behaviour stays as before. "unverified" contains "verified", so test it first.
if (line.startsWith("# logresp") && line.indexOf(Config.callsign) >= 0 && line.indexOf("unverified") >= 0) {
Serial.println("\n****APRS PASSCODE NOT VALID****\n");
Syslog::logTx("*** APRS-IS passcode NOT valid -> APRS-IS stopped ***");
aprsClient.stop();
Config.aprs_is.active = false; // in memory only: the saved config keeps APRS-IS enabled
return;
}
if (line.length() == 0 || line[0] == '#') return; // server comment / keepalive
int gt = line.indexOf('>');
int dc = line.indexOf("::");
@@ -110,7 +123,22 @@ void send(const String &line) {
// Gate rules of APRS_IS_Utils::processLoRaPacket. This build never gates APRS-IS
// back to RF (no messagesToRF/objectsToRF), so it is a receive-only iGate and
// uses qAO, like the ESP32 with messagesToRF off (buildPacketToUpload).
void forward(const String &packet) {
// IS2PLAIN metadata line sent right before the gated packet (same as buildIS2Meta()
// in the ESP32 aprs_is_utils.cpp). rx_modem=2 is LoRa; the bit rate is derived from
// the RX SF/BW/CR, which only change with a config save (= reboot), so it is cached.
static String buildIS2Meta(int rssi, float snr) {
static String fixedTail;
if (fixedTail == "") {
// LoRa bit rate = SF * (BW / 2^SF) * 4/CR (CR = denominator: 5..8)
uint32_t bitrate = (uint32_t)(Config.loramodule.rxSpreadingFactor
* ((float)Config.loramodule.rxSignalBandwidth / (1 << Config.loramodule.rxSpreadingFactor))
* (4.0 / Config.loramodule.rxCodingRate4));
fixedTail = " rx_modem=2 rx_bitrate=" + String(bitrate) + " rx_frequency=" + String(Config.loramodule.rxFreq);
}
return "#is2-meta rx_rssi_dbm=" + String(rssi) + " rx_snr_db=" + String(snr, 1) + fixedTail;
}
void forward(const String &packet, int rssi, float snr) {
if (!aprsClient.connected()) return;
if (packet.length() < 5) return;
String body = packet.substring(3); // skip the 3-byte LoRa-APRS header
@@ -133,7 +161,8 @@ void forward(const String &packet) {
line += ",qAO,";
line += Config.callsign;
line += APRSPacketLib::checkForStartingBytes(body.substring(colon));
aprsClient.print(line + "\r\n");
if (Config.aprs_is.is2Metadata) aprsClient.print(buildIS2Meta(rssi, snr) + "\r\n" + line + "\r\n"); // meta line + packet in one write
else aprsClient.print(line + "\r\n");
Serial.println("[aprsis] up: " + line);
}
+1 -1
View File
@@ -11,5 +11,5 @@ namespace AprsIs {
void poll(); // drain incoming server lines (keepalive); drops a silent connection
bool silentFor(uint32_t ms); // no line from the server for `ms` (feeds the backup digi)
void send(const String &line); // send a raw APRS-IS line (e.g. beacon)
void forward(const String &loraPacket); // RX LoRa packet -> APRS-IS (qAO: receive-only iGate)
void forward(const String &loraPacket, int rssi, float snr); // RX LoRa packet -> APRS-IS (qAO: receive-only iGate); rssi/snr feed the IS2 meta line
}
+1
View File
@@ -112,6 +112,7 @@ bool applyConfigForm(const String &contentType, const String &body) {
if (Config.aprs_is.active) {
Config.aprs_is.messagesToRF = fHas("aprs_is.messagesToRF");
Config.aprs_is.objectsToRF = fHas("aprs_is.objectsToRF");
Config.aprs_is.is2Metadata = fHas("aprs_is.is2Metadata");
Config.aprs_is.server = getParamStringSafe("aprs_is.server", Config.aprs_is.server);
Config.aprs_is.passcode = getParamStringSafe("aprs_is.passcode", Config.aprs_is.passcode);
Config.aprs_is.port = getParamIntSafe("aprs_is.port", Config.aprs_is.port);
+7 -2
View File
@@ -167,7 +167,8 @@ void loraTask(void *) {
// it was a query addressed to us — answered over RF, don't gate/digi
} else {
// gate to APRS-IS (handed to netTask, the W5500 owner)
String *p = new String(pkt);
// "rssi\tsnr\tframe": the signal stats travel with the frame for the IS2 meta line
String *p = new String(String(rssi) + "\t" + String(snr, 1) + "\t" + pkt);
if (xQueueSend(rxQueue, &p, 0) != pdTRUE) delete p; // drop if full
// digipeat: rewrite WIDEn-N and enqueue for anti-collision TX
if (Digi::enabled()) {
@@ -293,7 +294,11 @@ void netTask(void *) {
// forward any LoRa packets handed over by loraTask
String *p;
while (xQueueReceive(rxQueue, &p, 0) == pdTRUE) {
if (Config.aprs_is.active) AprsIs::forward(*p);
if (Config.aprs_is.active) {
int t1 = p->indexOf('\t');
int t2 = (t1 >= 0) ? p->indexOf('\t', t1 + 1) : -1;
if (t2 > t1) AprsIs::forward(p->substring(t2 + 1), p->substring(0, t1).toInt(), p->substring(t1 + 1, t2).toFloat());
}
delete p;
}
// store any incoming messages addressed to us (for GET /messages.json)
+4 -4
View File
@@ -49,12 +49,12 @@ namespace WIFI_Utils {
uint32_t currentTime = millis();
if (backupDigiMode) {
if (!networkManager->isWiFiConnected() && ((currentTime - lastBackupDigiTime) >= 15 * 60 * 1000)) {
Serial.println("*** Stopping BackUp Digi Mode ***");
if (lastServerCheck > lastBackupDigiTime) { // APRS-IS server spoke after entering backup (with or without a WiFi drop)
Serial.println("*** APRS-IS Server Back (Stopping Backup Digi Mode) ***");
backupDigiMode = false;
wifiCounter = 0;
} else if (networkManager->isWiFiConnected()) {
Serial.println("*** WiFi Reconnect Success (Stopping Backup Digi Mode) ***");
} else if (!networkManager->isWiFiConnected() && ((currentTime - lastBackupDigiTime) >= 15 * 60 * 1000)) {
Serial.println("*** Stopping BackUp Digi Mode ***"); // no WiFi for 15 min: leave backup to retry WiFi
backupDigiMode = false;
wifiCounter = 0;
}