Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f053e12
Additional clarity on country legal requirements
KPrivitt Aug 28, 2026
c8b7944
Merge branch 'dev' of https://github.com/meshcore-dev/MeshCore into dev
KPrivitt Sep 2, 2026
ef84dab
Doc change to clarify radio setting country reqs.
KPrivitt Sep 2, 2026
48732a3
Merge remote-tracking branch 'upstream/dev' into dev
KPrivitt Oct 20, 2026
cc88567
docs: describe stats-core output and its error flags
Blake-Latchford Nov 7, 2026
1e2c555
gps: support time sync on rak i2c gps
fdlamotte Nov 14, 2026
0c5ddd7
Merge pull request #37 from Dutch-MeshCore/chore/dmc-dev-upstream-syn…
Elektr0Vodka Nov 15, 2026
ca58046
Merge pull request #3843 from fdlamotte/raki2cgps_time_sync
fdlamotte Nov 16, 2026
0e164ae
* refactored UITask from repeater/room/sensor to /helpers/ui/server
ripplebiz Nov 18, 2026
7b8ac81
* companion UI's moved/refactored to src/helpers/ui
ripplebiz Nov 18, 2026
363b391
* interface manager now injected via begin()
ripplebiz Nov 18, 2026
e5ca7a0
ui-task: apply refactoring on thinknode_m5 (#3869)
fdlamotte Nov 18, 2026
0820673
* UITask constructors now with same params, so don't have to have sep…
ripplebiz Nov 19, 2026
314a947
Merge commit 'e5ca7a0e49c3ffe9b25464d2845fc85492c36509' into ui-task-…
ripplebiz Nov 19, 2026
8fae584
* thinknode_m5: simplified the target.* modules
ripplebiz Nov 19, 2026
adac387
* lotsa super boring refactoring
ripplebiz Nov 19, 2026
89d805a
* 2nd round of .ini refactors
ripplebiz Nov 19, 2026
baed105
* misc fixes
ripplebiz Nov 19, 2026
79121ea
* more fixes
ripplebiz Nov 19, 2026
2ab6f41
* final fix
ripplebiz Nov 19, 2026
15c3eba
Merge pull request #3776 from Blake-Latchford/docs/stats-core-error-f…
fdlamotte Nov 19, 2026
1c1a73d
* unit test fix
ripplebiz Nov 20, 2026
34811a4
* removed various copied 'dirty' members
ripplebiz Nov 20, 2026
914882a
Merge pull request #3881 from meshcore-dev/ui-task-refactor
ripplebiz Nov 20, 2026
88bbae2
Merge pull request #3882 from meshcore-dev/common-prefs-fix
fdlamotte Nov 20, 2026
7df63ae
* copied sensor telemetry push
ripplebiz Nov 21, 2026
4245169
Document the companion buzzer CLI command
Blake-Latchford Nov 21, 2026
23af733
Merge pull request #3892 from meshcore-dev/repeater-telem-push
ripplebiz Nov 21, 2026
d27a8bc
BaseChatMesh: test an ACK's route before marking it do-not-retransmit
hamsolodev Nov 22, 2026
00e2947
Merge pull request #3895 from Blake-Latchford/docs/companion-buzzer-cli
ripplebiz Nov 22, 2026
d2a31d9
Merge pull request #3348 from KPrivitt/dev
liamcottle Nov 22, 2026
ae28381
Merge pull request #3903 from hamsolodev/fix/ack-flood-path-retry
ripplebiz Nov 22, 2026
22d7f3c
Merge upstream/dev ae283810 into dmc-dev (sync 2026-11-23)
Elektr0Vodka Nov 22, 2026
289fbe6
test(gps): include the companion NodePrefs from its new upstream loca…
Elektr0Vodka Nov 23, 2026
bca5508
Merge dmc-dev upstream sync 2026-11-23 into dmc-observer-dev
Elektr0Vodka Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion docs/cli_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ Find more information in [neighbour_discovery_reference.md](neighbour_discovery_

**Serial Only:** Yes

**Note:** Output format: `{"battery_mv":<mV>,"uptime_secs":<secs>,"errors":<flags>,"queue_len":<count>}`

**Note:** `errors` is a bitmask shown as "Debug flags" in the app's repeater status.

| Value | Flag | Meaning |
|-------|------|---------|
| 1 | `ERR_EVENT_FULL` | A packet failed to send because the memory pool was full. |
| 2 | `ERR_EVENT_CAD_TIMEOUT` | After waiting 4 seconds for a gap, a packet was transmitted into a busy network. |
| 4 | `ERR_EVENT_STARTRX_TIMEOUT` | The radio was out of receive mode for more than 8 seconds. |

Flags stay set until the node reboots or `clear stats` is run.

---

### Radio Stats - Noise floor, Last RSSI/SNR, Airtime, Receive errors
Expand Down Expand Up @@ -415,6 +427,10 @@ Find more information in [companion_snmp_ota_reference.md](companion_snmp_ota_re

**Note:** Requires reboot to apply

**Notes:** These settings control the setup of the radio parameters.
Refer to the node's manual for the correct settings to use.
**Setting a value too high or too low may violate the laws in your country.**

---

#### View or change this node's transmit power
Expand All @@ -429,7 +445,9 @@ Find more information in [companion_snmp_ota_reference.md](companion_snmp_ota_re

**Default:** Varies by board

**Notes:** This setting only controls the power level of the LoRa chip. Some nodes have an additional power amplifier stage which increases the total output. Refer to the node's manual for the correct setting to use. **Setting a value too high may violate the laws in your country.**
**Notes:** This setting only controls the power level of the LoRa chip. Some nodes have an additional power amplifier stage which increases the total output.
Refer to the node's manual for the correct setting to use.
**Setting a value too high may violate the laws in your country.**

---

Expand All @@ -444,6 +462,10 @@ Find more information in [companion_snmp_ota_reference.md](companion_snmp_ota_re
- `cr`: Coding rate (5-8)
- `timeout_mins`: Duration in minutes (must be > 0)

**Notes:** These settings control the setup of the radio parameters.
Refer to the node's manual for the correct settings to use.
**Setting a value too high or too low may violate the laws in your country.**

**Note:** This is not saved to preferences and will clear on reboot

---
Expand Down Expand Up @@ -918,6 +940,9 @@ congestion response. Region gating is off by default, so enabling it layers on
top of an existing filter configuration without disturbing it. Directed
(non-flood) traffic is never region-gated.

**Notes:** Refer to the node's manual for the correct settings to use.
**Setting a value too high may violate the laws in your country.**

---

#### View or change the airtime factor (duty cycle limit)
Expand Down
14 changes: 14 additions & 0 deletions docs/companion_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ Since version 1.18 meshcore companion radio firmware has a CLI interface, which

---

#### View or change the buzzer state
**Usage:**
- `get buzzer`
- `set buzzer <state>`

**Parameters:**
- `state`: `on`|`off`

**Default:** `on`

**Note:** Only available on boards with a buzzer (`PIN_BUZZER`). This is the same setting as the buzzer toggle in the device UI.

---

### Radio

Radio parameters are common to all roles and handled by `CommonRadioPrefs`.
Expand Down
2 changes: 1 addition & 1 deletion examples/companion_radio/DataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <helpers/IdentityStore.h>
#include <helpers/ContactInfo.h>
#include <helpers/ChannelDetails.h>
#include "NodePrefs.h"
#include <helpers/CompanionNodePrefs.h>

class DataStoreHost {
public:
Expand Down
29 changes: 0 additions & 29 deletions examples/companion_radio/MyMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,20 +408,6 @@ void MyMesh::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path
if (!is_new) dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY); // only schedule lazy write for contacts that are in contacts[]
}

static int sort_by_recent(const void *a, const void *b) {
return ((AdvertPath *) b)->recv_timestamp - ((AdvertPath *) a)->recv_timestamp;
}

int MyMesh::getRecentlyHeard(AdvertPath dest[], int max_num) {
if (max_num > ADVERT_PATH_TABLE_SIZE) max_num = ADVERT_PATH_TABLE_SIZE;
qsort(advert_paths, ADVERT_PATH_TABLE_SIZE, sizeof(advert_paths[0]), sort_by_recent);

for (int i = 0; i < max_num; i++) {
dest[i] = advert_paths[i];
}
return max_num;
}

void MyMesh::onContactPathUpdated(const ContactInfo &contact) {
out_frame[0] = PUSH_CODE_PATH_UPDATED;
memcpy(&out_frame[1], contact.id.pub_key, PUB_KEY_SIZE);
Expand Down Expand Up @@ -2716,21 +2702,6 @@ void MyMesh::loop() {
}
}

bool MyMesh::advert() {
mesh::Packet* pkt;
if (_prefs.advert_loc_policy == ADVERT_LOC_NONE) {
pkt = createSelfAdvert(_prefs.node_name);
} else {
pkt = createSelfAdvert(_prefs.node_name, sensors.node_lat, sensors.node_lon);
}
if (pkt) {
sendZeroHop(pkt);
return true;
} else {
return false;
}
}

// To check if there is pending work
bool MyMesh::hasPendingWork() const {
return _mgr->getOutboundTotal() > 0 || dirty_contacts_expiry != 0;
Expand Down
47 changes: 11 additions & 36 deletions examples/companion_radio/MyMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "CompanionNet.h"
#include "MeshcomodPrefs.h"
#include "DataStore.h"
#include "NodePrefs.h"
#include <helpers/CompanionNodePrefs.h>

#include <RTClib.h>
#include <helpers/ArduinoHelpers.h>
Expand Down Expand Up @@ -75,17 +75,14 @@
#ifdef WITH_MQTT_BRIDGE
#include <helpers/CompanionObserver.h>
#endif
#include <helpers/MeshEventListener.h>

/* -------------------------------------------------------------------------------------- */

#define REQ_TYPE_GET_STATUS 0x01 // same as _GET_STATS
#define REQ_TYPE_KEEP_ALIVE 0x02
#define REQ_TYPE_GET_TELEMETRY_DATA 0x03

// Copied from simple_repeater
#define CTL_TYPE_NODE_DISCOVER_REQ 0x80
#define CTL_TYPE_NODE_DISCOVER_RESP 0x90

struct AdvertPath {
uint8_t pubkey_prefix[7];
uint8_t path_len;
Expand All @@ -100,30 +97,11 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost
#endif
{
public:
class Listener {
public:
virtual void onMessageRecv(mesh::Packet *pkt, const ContactInfo &from, uint8_t txt_type, uint32_t sender_timestamp, const char* text) = 0;
virtual void onChannelMessageRecv(mesh::Packet *pkt, ChannelDetails& channel_details, const char* text) = 0;
virtual void onQueueSizeChanged(int msgcount) = 0;
virtual void onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path_len, const uint8_t* path) { }
virtual void onControlDataRecv(const mesh::Packet* pkt) { }
virtual void onChannelDataRecv(mesh::Packet *pkt, const mesh::GroupChannel &channel, uint16_t data_type,
const uint8_t *data, size_t data_len) { }
virtual void onACKRecv(uint32_t ack_crc) { }
virtual uint8_t onUnhandledRequest(const ContactInfo &contact, uint32_t sender_timestamp, const uint8_t *data,
uint8_t len, uint8_t *reply) { return 0; /* unknown request type */ }
virtual bool onUnhandledResponse(const ContactInfo &from, uint32_t tag, const uint8_t* data, uint8_t len) { return false; /* not handled */ }
virtual void onTraceRecv(mesh::Packet *pkt, uint32_t tag, uint32_t auth_code, uint8_t flags,
const uint8_t *path_snrs, const uint8_t *path_hashes, uint8_t path_len) { }
virtual void onRawDataRecv(mesh::Packet *pkt) { }
virtual ~Listener() { }
};

MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMeshTables &tables, DataStore& store);

void begin();
void startInterface(BaseSerialInterface &serial);
void setListener(Listener* listener) { _listener = listener; }
void setListener(MeshEventListener* listener) { _listener = listener; }

const char *getNodeName();
NodePrefs *getNodePrefs();
Expand All @@ -132,10 +110,14 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost

void loop();
void handleCmdFrame(size_t len);
bool advert();
void enterCLIRescue();

int getRecentlyHeard(AdvertPath dest[], int max_num);
void enterCLIRescue() override;
void savePrefs() override {
_prefs.node_lat = sensors.node_lat;
_prefs.node_lon = sensors.node_lon;
_store->savePrefs(_prefs);
_prefs.clearDirty();
}

// NodeDiagHost (memory, stats-radio-diag)
int getDiagQueueSize() override;
Expand Down Expand Up @@ -237,13 +219,6 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost
}

public:
void savePrefs() {
_prefs.node_lat = sensors.node_lat;
_prefs.node_lon = sensors.node_lon;
_store->savePrefs(_prefs);
_prefs.clearDirty();
}

#if ENV_INCLUDE_GPS == 1
void applyGpsPrefs() {
if (_prefs.gps_interval > 0 &&
Expand Down Expand Up @@ -299,7 +274,7 @@ class MyMesh : public BaseChatMesh, public DataStoreHost, public NodeDiagHost
uint32_t pending_telemetry, pending_discovery; // pending _TELEMETRY_REQ
uint32_t pending_req; // pending _BINARY_REQ
BaseSerialInterface *_serial;
Listener* _listener;
MeshEventListener* _listener;

ContactsIterator _iter;
uint32_t _iter_filter_since;
Expand Down
10 changes: 4 additions & 6 deletions examples/companion_radio/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ MultiSerialInterface interface_manager;
#endif

/* GLOBAL OBJECTS */
#ifdef DISPLAY_CLASS
#include "UITask.h"
UITask ui_task(&board, &interface_manager);
#endif

StdRNG fast_rng;
SimpleMeshTables tables;
#ifdef COMPANION_MESH_IN_PSRAM
Expand Down Expand Up @@ -384,7 +379,10 @@ void setup() {
#endif

#ifdef DISPLAY_CLASS
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
#ifdef WITH_MQTT_BRIDGE
ui_task.setObserver(&the_mesh.getObserver());
#endif
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs(), &interface_manager, &the_mesh, the_mesh.getBLEPin(), FIRMWARE_VERSION, FIRMWARE_BUILD_DATE);
the_mesh.setListener(&ui_task);
#ifdef EINK_REFRESH_LOOP
if (disp != NULL) disp->setBusyHook(loopDuringDisplayRefresh);
Expand Down
Loading
Loading