Skip to content

Add firmware log event support and update trace payloads - #24

Open
usrflo wants to merge 24 commits into
Brent-A:mainfrom
usrflo:main
Open

Add firmware log event support and update trace payloads#24
usrflo wants to merge 24 commits into
Brent-A:mainfrom
usrflo:main

Conversation

@usrflo

@usrflo usrflo commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

AI added a firmware log event so DEBUG output is merged into the JSON log output.
This way I can see output like the following that I didn't expect or wasn't aware of so far.
The trace output would have revealed this as well but filtering the JSON output can be done better.

1 line needs to be patched in Meshcore.h, see the modification in the patch file.
I worked on Linux but should be re-checked on Windows IMHO.

{
  "type": "LOG",
  "timestamp": "2025-01-01T00:02:02.000Z",
  "origin": "Repeater2",
  "line": "DEBUG: 00:00:00 - 1/1/2024 U Dispatcher::loop(): ERROR: send start failed!"
}
{
  "type": "PACKET",
  "timestamp": "2025-01-01T00:02:02.000Z",
  "origin": "Repeater3",
  "direction": "TX",
  "payload_hash": "841DBF8FD9CC7CEF",
  "packet_start_time_s": 122.0001,
  "packet_end_time_s": 122.399972
}

usrflo and others added 23 commits April 30, 2026 07:51
…fixed notifyTxComplete

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
- Introduced `SendChannelTextMessageWithCorridor` command for corridor-scoped message delivery.
- Added `corridor` field to `ChannelMessageConfig` for specifying geo-corridor triples.
- Implemented geographic position fields in node configurations for corridor checks.
- Updated protocol constants and added new properties for corridor configuration.
- Created example behaviors and topologies to demonstrate corridor-scoped message forwarding.
- Enhanced tests to validate corridor-based message delivery and repeater behavior.
- Introduced `max_resend_attempts` field in NodeConfig, RepeaterConfig, CompanionConfig, and RoomServerConfig to control firmware-level resend attempts per packet.
- Updated default values and added methods to set max resend attempts in respective structs.
- Enhanced simulation building to incorporate max resend attempts from YAML configurations.
- Added a new example topology demonstrating the impact of resend attempts in an 8-hop chain scenario.
- Introduced `path_warmup_count` to control the number of uncounted warmup DMs sent before the main session.
- Updated `Agent` state machine to manage warmup DMs and their ACKs.
- Enhanced metrics tracking to differentiate between warmup and counted DMs.
- Modified example behaviors and topologies to demonstrate the new warmup functionality.
Added simulation support for repeated sending and the corridor approach
- Introduced TraceConfig struct for configuring TRACE sending behavior.
- Updated AgentConfig to include TRACE configuration.
- Implemented TRACE state machine in Agent for sending and handling TRACE packets.
- Added properties for TRACE configuration in the model, including enabling, startup timing, and message limits.
- Created example YAML files for TRACE stress testing and retry scenarios.
- Enhanced existing properties and registry to support TRACE functionality.
…Core dev branch plus experimental features by usrflo
The sim shims (simulator/*/sim_main.cpp) assigned
`prefs->max_resend_attempts` unconditionally, coupling mcsim to a firmware
field that only exists on pr-2670 branches. Building against firmware
branches lacking the field (e.g. dev / bugfix/login-msg-timer) failed with
"no member named 'max_resend_attempts' in 'NodePrefs'".

Feature-detect the field in build.rs (grep CommonCLI.h and
companion_radio/NodePrefs.h) and define SIM_FW_HAS_MAX_RESEND_ATTEMPTS only
when present; wrap the shim assignment in #ifdef so it is skipped on
firmwares without the field. Also define MESH_DEBUG=1 in the build so
firmware DEBUG prints on any branch via the existing
`#if MESH_DEBUG && ARDUINO` path, instead of requiring a firmware-side
`|| defined(MESHCORE_SIMULATOR)` debug guard.

mcsim now builds+runs against both ufo/pr-2670 and branches without it.
- Introduced `LoginConfig` struct for server login behavior.
- Updated `AgentConfig` to include login configuration.
- Implemented login state machine in the agent for handling login attempts.
- Added properties for login configuration in the properties module.
- Created example YAML files for login behavior and topology.
- Introduced `app_clock_offset_secs` in `AgentConfig` to model clock divergence.
- Updated message timestamp generation to incorporate app clock offset.
- Added new property `AGENT_APP_CLOCK_OFFSET_S` for configuration.
- Enhanced example behaviors to demonstrate app clock divergence handling.
- Introduced `login_repro_2hop_noresend.yaml` and `login_repro_noresend.yaml` to test scenarios with repeated sending disabled.
- Added `retry_showcase_dus.yaml` to simulate an 11-repeater, 12-hop path in Düsseldorf, reflecting real-world conditions.
- Created `swarm_relay.yaml` and `swarm_relay_5hop.yaml` to demonstrate neighbour-swarm relay mechanics, enhancing packet delivery through opportunistic relaying.
- Updated `sim_api.h` and `sim_radio.h` to support new swarm relay features, including SNR thresholds and flood suppression parameters.
- Enhanced `sim_main.cpp` to configure swarm relay and flood suppression settings based on simulation parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant