simple_room_server: dfu, radio silence watchdog and get boot via NodeMaintenance
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ced8502a0
commit
a8f0c3dca6
3 files changed
+17
-3
No files matched your search
@@ -718,7 +718,7 @@ so the icon and the Grafana percentage tell one story.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
#### Radio silence watchdog (repeater and sensor)
|
#### Radio silence watchdog (repeater, sensor, room server)
|
||||||
**Usage:**
|
**Usage:**
|
||||||
- `get radio.silence`
|
- `get radio.silence`
|
||||||
- `set radio.silence <minutes>`
|
- `set radio.silence <minutes>`
|
||||||
@@ -735,7 +735,7 @@ To keep a quiet site out of a reboot loop, each such reboot doubles the threshol
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
#### Reboot into the bootloader (repeater and sensor, nRF52, local console only)
|
#### Reboot into the bootloader (repeater, sensor, room server; nRF52, local console only)
|
||||||
**Usage:**
|
**Usage:**
|
||||||
- `dfu [uf2|serial|ota]`
|
- `dfu [uf2|serial|ota]`
|
||||||
|
|
||||||
@@ -743,7 +743,7 @@ To keep a quiet site out of a reboot loop, each such reboot doubles the threshol
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
#### Why the board last reset (repeater and sensor)
|
#### Why the board last reset (repeater, sensor, room server)
|
||||||
**Usage:**
|
**Usage:**
|
||||||
- `get boot`
|
- `get boot`
|
||||||
|
|
||||||
|
|||||||
@@ -950,6 +950,10 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
|
|||||||
command += 3;
|
command += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CUSTOM (TeTeHacko): dfu (local only), radio silence watchdog, `get boot`.
|
||||||
|
extern bool maintHandleCommand(uint32_t sender_timestamp, const char* command, char* reply);
|
||||||
|
if (maintHandleCommand(sender_timestamp, command, reply)) return;
|
||||||
|
|
||||||
// handle ACL related commands
|
// handle ACL related commands
|
||||||
if (memcmp(command, "setperm ", 8) == 0) { // format: setperm {pubkey-hex} {permissions-int8}
|
if (memcmp(command, "setperm ", 8) == 0) { // format: setperm {pubkey-hex} {permissions-int8}
|
||||||
char* hex = &command[8];
|
char* hex = &command[8];
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <Mesh.h>
|
#include <Mesh.h>
|
||||||
|
|
||||||
#include "MyMesh.h"
|
#include "MyMesh.h"
|
||||||
|
#include <helpers/NodeMaintenance.h>
|
||||||
|
|
||||||
#ifdef ETHERNET_ENABLED
|
#ifdef ETHERNET_ENABLED
|
||||||
#define ETHERNET_CLI_BANNER "MeshCore Room Server CLI"
|
#define ETHERNET_CLI_BANNER "MeshCore Room Server CLI"
|
||||||
@@ -17,6 +18,12 @@ StdRNG fast_rng;
|
|||||||
SimpleMeshTables tables;
|
SimpleMeshTables tables;
|
||||||
MyMesh the_mesh(board, radio_driver, *new ArduinoMillis(), fast_rng, rtc_clock, tables);
|
MyMesh the_mesh(board, radio_driver, *new ArduinoMillis(), fast_rng, rtc_clock, tables);
|
||||||
|
|
||||||
|
// CUSTOM (TeTeHacko): dfu, radio silence watchdog, `get boot` -- see NodeMaintenance.h.
|
||||||
|
static NodeMaintenance maint(board, radio_driver);
|
||||||
|
bool maintHandleCommand(uint32_t sender_timestamp, const char* command, char* reply) {
|
||||||
|
return maint.handleCommand(sender_timestamp, command, reply);
|
||||||
|
}
|
||||||
|
|
||||||
void halt() {
|
void halt() {
|
||||||
while (1) ;
|
while (1) ;
|
||||||
}
|
}
|
||||||
@@ -31,6 +38,7 @@ void setup() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
board.begin();
|
board.begin();
|
||||||
|
maint.printBootDiag();
|
||||||
|
|
||||||
#ifdef HAS_EXTERNAL_WATCHDOG
|
#ifdef HAS_EXTERNAL_WATCHDOG
|
||||||
external_watchdog.begin();
|
external_watchdog.begin();
|
||||||
@@ -86,6 +94,7 @@ void setup() {
|
|||||||
sensors.begin();
|
sensors.begin();
|
||||||
|
|
||||||
the_mesh.begin(fs);
|
the_mesh.begin(fs);
|
||||||
|
maint.begin(fs, the_mesh.getNodePrefs(), &the_mesh);
|
||||||
|
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
ui_task.begin(the_mesh.getNodePrefs(), FIRMWARE_BUILD_DATE, FIRMWARE_VERSION);
|
||||||
@@ -157,6 +166,7 @@ void loop() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
the_mesh.loop();
|
the_mesh.loop();
|
||||||
|
maint.loop();
|
||||||
sensors.loop();
|
sensors.loop();
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
ui_task.loop();
|
ui_task.loop();
|
||||||
|
|||||||
Reference in new issue
Block a user