Compare commits

...
Author SHA1 Message Date
Ricardo Guzman 6460b4be2a TXon fix 2026-11-24 10:09:17 -03:00
Ricardo Guzman ab6ae015ae date update 2026-11-23 16:28:58 -03:00
Ricardo Guzman b2fd00242f UEM fix 2026-11-23 16:28:31 -03:00
Ricardo Guzman fe9640161a Merge commit 'refs/pr/483' into readme-pico2-link 2026-11-18 12:14:21 -03:00
CValdesS 1bed2adeb0 README: link the Pico 2 + W5500 board too 2026-11-17 21:35:49 +01:00
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
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
7 changed files with 40 additions and 8 deletions

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ ____________________________________________________
- Wemos Lolin32 Oled + SX1278 DIY Version.
- RP2350 (Raspberry Pi Pico 2) + WIZnet W5500 Ethernet + Ebyte E22 LoRa Module, wired DIY version (see [Wiznet_5500_EVB_Pico2_E22P](https://github.com/cvaldess/Wiznet_5500_EVB_Pico2_E22P)).
- RP2350 (Raspberry Pi Pico 2) + WIZnet W5500 Ethernet + Ebyte E22 LoRa Module, wired DIY version (see [Wiznet_5500_EVB_Pico2_E22P](https://github.com/cvaldess/Wiznet_5500_EVB_Pico2_E22P) and [Pico2_W5500_E22](https://github.com/cvaldess/Pico2_W5500_E22)).
- and many more...
+1 -1
View File
@@ -69,7 +69,7 @@ ___________________________________________________________________*/
#endif
String versionDate = "2026-11-17";
String versionDate = "2026-11-23";
String versionNumber = "4.0.5";
Configuration Config;
WiFiClient aprsIsClient;
+8 -2
View File
@@ -305,8 +305,14 @@ namespace LoRa_Utils {
String receivePacketFromSleep() {
String packet = "";
int state = radio.readData(packet);
if (state == RADIOLIB_ERR_NONE) {
Utils::println("<--- LoRa Packet Rx : " + packet.substring(3));
if (state == RADIOLIB_ERR_NONE && packet != "") {
String sender = packet.substring(3, packet.indexOf(">"));
if (packet.substring(0,3) == "\x3c\xff\x01" && !STATION_Utils::isBlacklisted(sender)) {
Utils::println("<--- LoRa Packet Rx : " + packet.substring(3));
lastAprsPacket = APRSPacketLib::processReceivedPacket(packet.substring(3), 0, 0, 0); // processLoRaPacket() relies on it (RSSI/SNR/FreqErr not used in UEM)
} else {
packet = ""; // not a LoRa-APRS packet, or blacklisted
}
} else {
packet = "";
}
+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;
}
}
+6 -2
View File
@@ -32,6 +32,7 @@ extern float snr;
extern int freqError;
extern bool shouldSleepLowVoltage;
extern bool saveNewDigiEcoModeConfig;
extern bool pendingTxOff;
extern String versionNumber;
@@ -123,7 +124,10 @@ namespace QUERY_Utils {
default: answer = "DigiEcoMode:OFF/Only Serial Output";
}
} else if (queryQuestion.startsWith("?TX=ON")) {
if (radioTxActive) {
if (pendingTxOff) { // cancel a TX=OFF that has not been applied yet
pendingTxOff = false;
answer = "TX=ON";
} else if (radioTxActive) {
answer = "TX was ON";
} else {
Config.loramodule.txActive = true;
@@ -133,7 +137,7 @@ namespace QUERY_Utils {
if (!radioTxActive) {
answer = "TX was OFF";
} else {
Config.loramodule.txActive = false;
pendingTxOff = true; // applied once this answer has been transmitted (see processOutputPacketBuffer)
answer = "TX=OFF";
}
} else if (queryQuestion.startsWith("?TX=?")) {
+9
View File
@@ -49,6 +49,7 @@ struct Packet25SegBuffer {
std::vector<Packet25SegBuffer> packet25SegBuffer;
bool saveNewDigiEcoModeConfig = false;
bool pendingTxOff = false; // ?TX=OFF received: Tx is disabled after the answer has been sent
bool packetIsBeacon = false;
@@ -199,6 +200,10 @@ namespace STATION_Utils {
currentIndex++;
}
outputPacketBuffer.clear();
if (pendingTxOff) {
Config.loramodule.txActive = false;
pendingTxOff = false;
}
//
if (saveNewDigiEcoModeConfig) {
Config.writeFile();
@@ -225,6 +230,10 @@ namespace STATION_Utils {
delay(4000);
}
}
if (pendingTxOff && outputPacketBuffer.empty()) { // answer to ?TX=OFF (and any ack) already sent
Config.loramodule.txActive = false;
pendingTxOff = false;
}
if (saveNewDigiEcoModeConfig) {
Config.writeFile();
delay(1000);
-1
View File
@@ -139,7 +139,6 @@ namespace WIFI_Utils {
void setup() {
if (Config.digi.ecoMode == 0) startWiFi();
btStop();
}
}