Repository navigation
Headless mode - #8
Merged
Merged
Conversation
Stage 0 (re-sync of shared headers + full working-tree mirror from the WLED-LoRa fork canonical) and Stage 1 PR-1 (wire-protocol extension for runtime RF config) of the multi-gateway plan, combined here since this repo had no interim Stage-0 commit. PR-1 adds: - OPC_RF_CONFIG (0x0D) and OPC_GET_RF_CONFIG (0x0E) with 12-byte P_RfConfig payload (freq_hz / bw_khz_x10 / sf / cr_den / sync_word / tx_power_dbm / preamble, all LE). Unicast-only — broadcast forbidden by design (analog to OPC_CONFIG). - USB-CDC additions: EV_RF_CHANGED (0xF6) with RfChangeReason enum, GW_CMD_SET_RF_CONFIG (0x02) carrying a persist/volatile flag for the channel-scan workflow, GW_CMD_GET_RF_CONFIG (0x03). - RULES[] entries + static_asserts. Stage 0 brings the rest of the working tree in line with canonical (racelink_wled.cpp/h, transport_core.h, headless.h, indicators.h, docs/). Co-Authored-By: Claude Opus 4.7 <[email protected]>
…lers Stage 1 PR-3 of the multi-gateway plan. Mirrors the gateway-side PR-2 (commit d115966 in RaceLink_Gateway) on the WLED node side, so a host can change a node's LoRa PHY parameters at runtime, persist them across reboots, and read them back. New file rf_config_nvs.h (header-only, WLED-fork-local): - Same NVS namespace (rl_rf) + schema (magic + CRC16 over P_RfConfig) + range validator as the gateway copy. A cross-flashed image therefore picks up the existing slot interpretably. - bootCounterIncrement / Clear / wipe for boot-loop recovery: after 3 consecutive failed boots the persisted slot is wiped on the next radioInit() so beginCommon() lands on the compile defaults. racelink_wled.cpp / racelink_wled.h changes: - radioInit() now ticks the boot counter, loads g_activeRfConfig from NVS (with compile-time defaults as fallback, persisted on first boot), builds PhyCfg from it, and clears the counter after a successful beginCommon(). The RACELINK_FREQ_HZ / RACELINK_BW_KHZ / RACELINK_SF / RACELINK_CR / RACELINK_SYNC_WORD / RACELINK_PREAMBLE / RACELINK_TX_POWER defines remain the compile-default source. - New OPC_RF_CONFIG (0x0D) handler: validate -> NACK on out-of-range, ACK_ERROR on NVS write failure, ACK_OK + delay(50) + ESP.restart() on success. Broadcast frames are rejected at the receiver (defence in depth; the rules table already forbids broadcast). - New OPC_GET_RF_CONFIG (0x0E) handler: validates the reserved byte, emits a P_RfConfig reply via sendRfConfigReplyTo() carrying g_activeRfConfig (which mirrors the NVS slot 1:1 after radioInit). - sendRfConfigReplyTo() builds the 12 B P_RfConfig N2M reply via the standard build() helper for byte-layout symmetry with the master side. Build verified: pio run -e RaceLink_Node_v1_c3_ct62 succeeds (RAM 21.6%, Flash 70.8%). Co-Authored-By: Claude Opus 4.7 <[email protected]>
- Introduced persistedMasterLast3 and persistedMasterFull6 to maintain a snapshot of the master state independently of live variables. - Updated addToConfig and readFromConfig methods to ensure consistent handling of persisted values. - Improved comments for clarity on persistence behavior and its interaction with macFilterPersist. - Added boot-loop recovery mechanisms in rf_config_nvs.h to manage corrupted configurations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key changes:
TX Latency Reduction and Non-Blocking Transmission
transmit()to non-blockingsetTx()with DIO1 IRQ, reducing main loop blocking and improving on-air latency by ~300 µs. Added mechanisms to preload the TX FIFO and optimize standby transitions, resulting in faster and more efficient packet transmission.IRQ Robustness and Deadlock Prevention
Post-Review Hardening and Defensive Fixes