Repeater: TX stall watchdog -- packets queued, nothing sent for 15 min: re-arm, then reboot
pub-release / release (push) Successful in 39m1s
pub-release / release (push) Successful in 39m1s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
01d66a66ce
commit
d9c7b9c008
6 files changed
+167
-4
No files matched your search
@@ -16,12 +16,15 @@
|
||||
// set radio.silence <min> radio silence watchdog, 0/off = disabled (#6)
|
||||
// get radio.silence threshold, backoff, quiet time, stage
|
||||
// get radio.reboots reboots done by the watchdog, survives power loss
|
||||
// get radio.txstall TX stall watchdog: threshold, queue, time without TX
|
||||
// set radio.txstall <min> 0/off = disabled; RAM only, RADIO_TXSTALL_MIN at boot
|
||||
// get boot why the board last reset, and the hardfault record
|
||||
//
|
||||
// Wiring (see simple_sensor/main.cpp):
|
||||
// setup(): maint.printBootDiag() early, maint.begin(fs, prefs, cb) after the
|
||||
// mesh has loaded its prefs
|
||||
// loop(): maint.loop()
|
||||
// loop(): maint.loop(), or maint.loop(queued, due) to arm the TX stall
|
||||
// watchdog (outbound packets in total / due now)
|
||||
// commands: if (maint.handleCommand(sender_timestamp, command, reply)) return;
|
||||
|
||||
#include <Arduino.h>
|
||||
@@ -46,7 +49,8 @@ public:
|
||||
void printBootDiag();
|
||||
|
||||
void begin(FILESYSTEM* fs, NodePrefs* prefs, CommonCLICallbacks* callbacks);
|
||||
void loop();
|
||||
// tx_queued < 0: the role does not report its queue, no TX stall watchdog.
|
||||
void loop(int tx_queued = -1, int tx_due = -1);
|
||||
|
||||
// sender_timestamp == 0 means the local console (the same test CommonCLI uses
|
||||
// for `erase`); `dfu` refuses anything else.
|
||||
@@ -70,6 +74,8 @@ private:
|
||||
void silenceSave(uint8_t backoff);
|
||||
bool dfuCommand(uint32_t sender_timestamp, const char* command, char* reply);
|
||||
bool silenceCommand(const char* command, char* reply);
|
||||
void txStallTick(int tx_queued, int tx_due);
|
||||
bool txStallCommand(const char* command, char* reply);
|
||||
void dfuTick();
|
||||
|
||||
mesh::MainBoard& _board;
|
||||
@@ -83,6 +89,8 @@ private:
|
||||
#endif
|
||||
RadioSilenceWatchdog _silence;
|
||||
uint32_t _silence_reboots = 0;
|
||||
RadioSilenceWatchdog _txstall; // same staging, `activity` = packets sent
|
||||
int _tx_queued = -1, _tx_due = -1;
|
||||
|
||||
unsigned long _dfu_at = 0; // 0 = nothing armed
|
||||
uint8_t _dfu_mode = 0; // 0=uf2 1=serial 2=ota
|
||||
|
||||
Reference in new issue
Block a user