SenseCAP Indicator: RP2040 peripherals for the main firmware - #6220
SenseCAP Indicator: RP2040 peripherals for the main firmware#6220caveman99 wants to merge 38 commits into
Conversation
3c30821 to
65b50ba
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR integrates a secondary SenseCap Indicator MCU by removing the local COBS implementation and introducing proxy UART/I2C bridges to tunnel sensor and NMEA data over Meshtastic interdevice messages.
- Removed in-tree COBS serialization in favor of external or consolidated implementation
- Added
FakeUART/FakeI2CandSensecapIndicatorto proxy serial and I²C traffic - Updated build flags, main setup, and GPS class to select the fake transports under
SENSECAP_INDICATOR
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| variants/seeed-sensecap-indicator/platformio.ini | Switched build flags to esp32s3_base and added RingBuffer dependency |
| src/serialization/cobs.h & cobs.cpp | Removed local COBS encode/decode files |
| src/modules/Telemetry/Sensor/IndicatorSensor.* | Removed the IndicatorSensor class and its integration |
| src/modules/Telemetry/EnvironmentTelemetry.cpp | Cleaned out indicatorSensor instantiation and calls |
| src/mesh/comms/FakeUART.h & FakeUART.cpp | Introduced FakeUART to simulate serial and forward NMEA over uplink |
| src/mesh/comms/FakeI2C.h & FakeI2C.cpp | Introduced FakeI2C to simulate I²C and forward commands/responses |
| src/mesh/IndicatorSerial.h & IndicatorSerial.cpp | Added SensecapIndicator thread to encode/decode interdevice protobuf messages |
| src/main.cpp | Wired up the indicator thread and replaced native Wire1 with FakeI2C under the feature flag |
| src/gps/GPS.h & GPS.cpp | Switched GPS serial backend to FakeUART when SENSECAP_INDICATOR is defined |
Comments suppressed due to low confidence (3)
src/mesh/comms/FakeUART.h:24
- The
flush(bool)signature doesn’t match theStream::flush()override (which takes no parameters), potentially leading to unexpected behavior; consider renaming or correctly overridingvoid flush().
void flush(bool wait = true);
src/mesh/comms/FakeI2C.cpp:37
- Returning
0xFFwhenquantity != 1may be misinterpreted as 255 bytes available; return0to match the Wire API's convention of 0 bytes read on failure.
if (quantity != 1) return 0xFF;
45ecd13 to
0fad1a5
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR adds a protobuf-framed SenseCAP Indicator link with tunneled I2C, UART, GPS, and filesystem operations. It initializes the bridge during boot, routes peripherals through it, removes legacy telemetry paths, and updates logging, hardware settings, and pinned revisions. ChangesSenseCAP Indicator support
Estimated code review effort: 5 (Critical) | ~120 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant main
participant SensecapIndicator
participant I2CProxy
participant RemoteSDService
participant IndicatorRemoteFS
main->>SensecapIndicator: construct and wait_ready
I2CProxy->>SensecapIndicator: send tunneled I2C request
SensecapIndicator-->>I2CProxy: return correlated I2C response
RemoteSDService->>IndicatorRemoteFS: read or write remote file
IndicatorRemoteFS->>SensecapIndicator: send file request
SensecapIndicator-->>IndicatorRemoteFS: return file response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⚡ Try this PR in the Web FlasherWarning This is an automated, unreviewed CI test build. Back up your device configuration Supported boards built by this PR (31)
Build artifacts expire on 2026-08-25. Updated for |
8d1c7ae to
3bc42a3
Compare
3bc42a3 to
1737793
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/gps/GPS.cpp (1)
1433-1454: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winPreserve GPS-mode checks for the bridged backend.
This skips both
GpsMode_NOT_PRESENTand disabled-mode exits, whilecreateGps()always creates the GPS object for SenseCAP. Since this variant defaults GPS to not present, incoming RP2040 NMEA can still be processed and published despite the user disabling GPS. Keep the configuration checks and only bypass physical probing/setup.Also applies to: 1917-1920
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/gps/GPS.cpp` around lines 1433 - 1454, Preserve the GPS mode checks in the SenseCAP/bridged backend path: ensure GpsMode_NOT_PRESENT exits before processing incoming NMEA, and GpsMode_ENABLED is required before publishing updates. Restrict the conditional compilation around GPS physical probing and setup only, updating the initialization logic near GPSInitFinished and the corresponding code near createGps() so bridged input cannot bypass configuration.
🧹 Nitpick comments (9)
src/RedirectablePrint.cpp (2)
81-83: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winComment exceeds the 1–2 line limit.
This explanatory comment spans three lines. As per coding guidelines, "Keep code comments minimal: one or two lines maximum, only when the reason is not obvious, and do not restate the next line."
✏️ Suggested trim
- // A leading "[Tag] " in the message simulates the thread name tag (used - // by contexts without an OSThread, e.g. the device-ui task). Print it - // before applying the level color so it renders like a real thread name. + // A leading "[Tag] " simulates a thread-name tag (e.g. for device-ui); + // print it uncolored, before the level color codes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/RedirectablePrint.cpp` around lines 81 - 83, Shorten the explanatory comment near the level-color printing logic to no more than two lines while preserving only the essential reason for printing the leading “[Tag] ” before applying the color. Remove redundant wording that restates the surrounding code.Source: Coding guidelines
85-89: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueTag-detection window is a magic number.
The hardcoded
24bound for the tag scan window has no named constant or brief rationale. Consider extracting it (e.g.constexpr size_t kMaxTagScanLen = 24;) for readability.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/RedirectablePrint.cpp` around lines 85 - 89, Extract the hardcoded 24-byte scan bound in the tag-detection logic around printBuf into a named constexpr constant such as kMaxTagScanLen, and use that symbol in the memchr length expression while preserving the existing limit.src/mesh/IndicatorSerial.cpp (2)
256-258: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten this implementation comment.
It exceeds the two-line limit and largely describes the following operations.
As per coding guidelines, “Keep code comments minimal: one or two lines maximum.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mesh/IndicatorSerial.cpp` around lines 256 - 258, Shorten the comment above the protobuf decoding logic to one or two concise lines, retaining only that decoding occurs and any remaining buffer bytes are preserved for the next packet.Source: Coding guidelines
47-58: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
Throttlefor the timeout checks.Both loops implement elapsed-time checks with raw
millis()subtraction.As per coding guidelines, use
Throttleinstead of rawmillis()arithmetic for “did N ms pass” checks.Also applies to: 173-185
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mesh/IndicatorSerial.cpp` around lines 47 - 58, Update SensecapIndicator::wait_response and the other referenced response-wait loop to use the existing Throttle mechanism for elapsed-time checks instead of millis() subtraction. Configure Throttle with the requested timeout and use its expiration/check API while preserving the current flag handling, pumping, delay, and timeout return behavior.Source: Coding guidelines
src/mesh/IndicatorSerial.h (1)
33-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep implementation comments to two lines or fewer.
These newly added comments exceed the repository limit; condense each without restating implementation details.
As per coding guidelines, “Keep code comments minimal: one or two lines maximum.”
Also applies to: 38-40, 54-56, 71-74
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mesh/IndicatorSerial.h` around lines 33 - 35, Condense the newly added comments in IndicatorSerial around the request/response flow and the corresponding sections at the other referenced locations so each is no more than two lines. Keep only the essential intent, removing redundant implementation details and preserving the surrounding code unchanged.Source: Coding guidelines
src/mesh/comms/FakeUART.cpp (1)
58-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
setRxBufferSizereports success without actually resizing anything.Returning
sizeunconditionally (regardless of the fixedBUF_SIZE = 2048buffer) can mislead callers expecting the requested capacity was honored. Consider returning the actualBUF_SIZEinstead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mesh/comms/FakeUART.cpp` around lines 58 - 61, Update FakeUART::setRxBufferSize to return the actual fixed receive-buffer capacity, BUF_SIZE, instead of the requested size; leave the existing buffer behavior unchanged.src/mesh/comms/FakeI2C.cpp (1)
44-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSilent clamp of
requestFromlength instead of an invariant check.
lenis silently truncated toMAX_READ(line 47-48) rather than treated as a caller bug.MAX_READis derived from the negotiated protobuf limit (line 50-51 in the header), so any caller requesting more indicates a driver bug, not a runtime condition to gracefully clamp.🛡️ Suggested change
size_t FakeI2C::requestFrom(uint8_t address, size_t len, bool stopBit) { (void)stopBit; - if (len > MAX_READ) - len = MAX_READ; + assert(len <= MAX_READ);As per coding guidelines, "Use
assert()for invariants that should never fail."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mesh/comms/FakeI2C.cpp` around lines 44 - 60, Replace the silent len truncation in FakeI2C::requestFrom with an assert that len does not exceed MAX_READ, preserving the existing transaction flow for valid requests. Include the appropriate assert support if needed and remove the clamp assignment.Source: Coding guidelines
src/mesh/comms/FakeI2C.h (1)
8-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winClass doc comment exceeds the 1–2 line limit.
This 15-line block comment explains multiple behaviors (buffering semantics, repeated-start combining, bus-0 construction rationale) in one long explanatory block.
✏️ Suggested trim
-/** - * TwoWire implementation that tunnels bus traffic to the RP2040 over the - * interdevice serial link, making the sensors attached to the secondary MCU - * usable by the regular sensor drivers of the main firmware. - * - * beginTransmission()/write() buffer an outgoing write. The buffered write is - * executed as a single serial round trip on endTransmission(true). A write - * followed by endTransmission(false) and requestFrom() is combined into one - * write+read transaction with repeated start, matching driver access - * patterns. - * - * Constructed on bus number 0: TwoWire::begin() is final and cannot be - * intercepted, but it returns without touching hardware when the bus is - * already initialized, which is always true for bus 0 (local touch panel). - */ +// Tunnels TwoWire traffic over the interdevice serial link to the RP2040. +// write()+endTransmission(false)+requestFrom() combine into one repeated-start transaction.As per coding guidelines, "Keep code comments minimal: one or two lines maximum, only when the reason is not obvious, and do not restate the next line."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mesh/comms/FakeI2C.h` around lines 8 - 22, Shorten the class-level documentation for TwoWire to one or two lines, retaining only the non-obvious purpose or rationale. Remove the detailed buffering, transaction, and bus-0 behavior explanation from the comment without changing the implementation.Source: Coding guidelines
src/mesh/comms/FakeUART.h (1)
23-23: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win
flush(bool wait = true)also hides rather than overridesPrint::flush().Same root cause as the
write()mismatch:Print::flush()takes no arguments, so this signature hides it instead of overriding. Likely intentional to mirrorHardwareSerial::flush(bool), but worth confirming it's never called through aStream&/Print&reference where the argument would be silently dropped.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/mesh/comms/FakeUART.h` at line 23, Update FakeUART::flush so it does not hide Print::flush(): preserve the bool-based HardwareSerial-compatible API while also exposing a no-argument flush path that correctly overrides Print::flush(). Ensure calls through Stream& or Print& invoke the no-argument override, and retain the existing wait behavior for direct bool-based calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mesh/comms/FakeUART.cpp`:
- Around line 73-87: Update FakeUART::write to reserve one byte in
message.data.nmea for the null terminator by limiting the copied size to at most
sizeof(message.data.nmea) - 1. Preserve the existing truncation, logging,
send_uplink, and returned-size behavior while ensuring the buffer remains
null-terminated.
In `@src/mesh/IndicatorSerial.cpp`:
- Around line 61-64: Move the packets_received readiness checks in i2c_transact
and the other indicated request paths below their respective link_lock LockGuard
acquisitions. Ensure each check and subsequent transaction logic uses the
protected value, while preserving the existing fail-fast return behavior when no
packets have been received.
- Around line 188-205: Update SensecapIndicator::send_uplink to serialize all
access to the shared pb_tx_buf using link_lock, while preserving a private
lock-held sender for request methods that already hold the lock. Ensure
FakeUART::write and GPS uplink paths use the public locking sender, and request
methods call the private variant to avoid recursive locking.
- Around line 208-219: Update SensecapIndicator::serial_check and the
corresponding frame-length handling at the referenced path to reserve space for
the four-byte header and reject oversized payloads before filling pb_rx_buf.
Check available capacity before writing each byte, preventing the current
write-before-boundary-check overflow while preserving normal frame reads.
- Around line 61-75: Add a per-transaction correlation ID to
meshtastic_InterdeviceMessage, assign and retain the expected ID in
SensecapIndicator::i2c_transact, and include it in the request. Update
handle_packet() to compare incoming replies against the active transaction ID
and ignore mismatches before setting i2c_result_ready or copying the result.
---
Outside diff comments:
In `@src/gps/GPS.cpp`:
- Around line 1433-1454: Preserve the GPS mode checks in the SenseCAP/bridged
backend path: ensure GpsMode_NOT_PRESENT exits before processing incoming NMEA,
and GpsMode_ENABLED is required before publishing updates. Restrict the
conditional compilation around GPS physical probing and setup only, updating the
initialization logic near GPSInitFinished and the corresponding code near
createGps() so bridged input cannot bypass configuration.
---
Nitpick comments:
In `@src/mesh/comms/FakeI2C.cpp`:
- Around line 44-60: Replace the silent len truncation in FakeI2C::requestFrom
with an assert that len does not exceed MAX_READ, preserving the existing
transaction flow for valid requests. Include the appropriate assert support if
needed and remove the clamp assignment.
In `@src/mesh/comms/FakeI2C.h`:
- Around line 8-22: Shorten the class-level documentation for TwoWire to one or
two lines, retaining only the non-obvious purpose or rationale. Remove the
detailed buffering, transaction, and bus-0 behavior explanation from the comment
without changing the implementation.
In `@src/mesh/comms/FakeUART.cpp`:
- Around line 58-61: Update FakeUART::setRxBufferSize to return the actual fixed
receive-buffer capacity, BUF_SIZE, instead of the requested size; leave the
existing buffer behavior unchanged.
In `@src/mesh/comms/FakeUART.h`:
- Line 23: Update FakeUART::flush so it does not hide Print::flush(): preserve
the bool-based HardwareSerial-compatible API while also exposing a no-argument
flush path that correctly overrides Print::flush(). Ensure calls through Stream&
or Print& invoke the no-argument override, and retain the existing wait behavior
for direct bool-based calls.
In `@src/mesh/IndicatorSerial.cpp`:
- Around line 256-258: Shorten the comment above the protobuf decoding logic to
one or two concise lines, retaining only that decoding occurs and any remaining
buffer bytes are preserved for the next packet.
- Around line 47-58: Update SensecapIndicator::wait_response and the other
referenced response-wait loop to use the existing Throttle mechanism for
elapsed-time checks instead of millis() subtraction. Configure Throttle with the
requested timeout and use its expiration/check API while preserving the current
flag handling, pumping, delay, and timeout return behavior.
In `@src/mesh/IndicatorSerial.h`:
- Around line 33-35: Condense the newly added comments in IndicatorSerial around
the request/response flow and the corresponding sections at the other referenced
locations so each is no more than two lines. Keep only the essential intent,
removing redundant implementation details and preserving the surrounding code
unchanged.
In `@src/RedirectablePrint.cpp`:
- Around line 81-83: Shorten the explanatory comment near the level-color
printing logic to no more than two lines while preserving only the essential
reason for printing the leading “[Tag] ” before applying the color. Remove
redundant wording that restates the surrounding code.
- Around line 85-89: Extract the hardcoded 24-byte scan bound in the
tag-detection logic around printBuf into a named constexpr constant such as
kMaxTagScanLen, and use that symbol in the memchr length expression while
preserving the existing limit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2654ff4f-f2ad-4822-9b32-96312efbe48b
⛔ Files ignored due to path filters (2)
src/mesh/generated/meshtastic/interdevice.pb.cppis excluded by!**/generated/**,!src/mesh/generated/**src/mesh/generated/meshtastic/interdevice.pb.his excluded by!**/generated/**,!src/mesh/generated/**
📒 Files selected for processing (21)
platformio.iniprotobufssrc/RedirectablePrint.cppsrc/configuration.hsrc/detect/ScanI2CTwoWire.cppsrc/gps/GPS.cppsrc/gps/GPS.hsrc/graphics/tftSetup.cppsrc/main.cppsrc/mesh/IndicatorSerial.cppsrc/mesh/IndicatorSerial.hsrc/mesh/comms/FakeI2C.cppsrc/mesh/comms/FakeI2C.hsrc/mesh/comms/FakeUART.cppsrc/mesh/comms/FakeUART.hsrc/modules/Telemetry/EnvironmentTelemetry.cppsrc/modules/Telemetry/Sensor/IndicatorSensor.cppsrc/modules/Telemetry/Sensor/IndicatorSensor.hsrc/serialization/cobs.cppsrc/serialization/cobs.hvariants/esp32s3/seeed-sensecap-indicator/variant.h
💤 Files with no reviewable changes (5)
- src/serialization/cobs.cpp
- src/modules/Telemetry/Sensor/IndicatorSensor.h
- src/modules/Telemetry/Sensor/IndicatorSensor.cpp
- src/serialization/cobs.h
- src/modules/Telemetry/EnvironmentTelemetry.cpp
7beaaf3 to
5fe2ed5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/gps/GPS.cpp (1)
1433-1454: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve GPS mode and serial guards for SENSECAP builds.
Compiling out this entire block causes
SENSECAP_INDICATORbuilds to ignoreGPS_NOT_PRESENT, other non-enabled GPS modes, and_serial_gps == nullptr;runOnce()proceeds directly into active GPS processing. Keep those common guards outside the preprocessor branch, while only bypassing hardware probing/setup for the tunneled backend.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/gps/GPS.cpp` around lines 1433 - 1454, Move the GPS mode and _serial_gps guards from the `#if` !defined(SENSECAP_INDICATOR) block into shared runOnce() logic so SENSECAP builds still disable for GPS_NOT_PRESENT, non-enabled modes, and a null serial interface. Keep only hardware probing/setup and GNSS detection conditional, bypassing those operations for the tunneled backend while preserving GPSInitFinished and publishUpdate behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/gps/GPS.cpp`:
- Around line 1917-1920: Update the GPS::createGps() guard around _rx_gpio and
_serial_gps to validate _serial_gps for SENSECAP_INDICATOR as well, preventing
construction when the serial dependency is null. Restore the SENSECAP-specific
protection or use a guaranteed runtime getter instead of relying on the cross-TU
FakeSerial initialization.
---
Outside diff comments:
In `@src/gps/GPS.cpp`:
- Around line 1433-1454: Move the GPS mode and _serial_gps guards from the `#if`
!defined(SENSECAP_INDICATOR) block into shared runOnce() logic so SENSECAP
builds still disable for GPS_NOT_PRESENT, non-enabled modes, and a null serial
interface. Keep only hardware probing/setup and GNSS detection conditional,
bypassing those operations for the tunneled backend while preserving
GPSInitFinished and publishUpdate behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9a30ca51-4457-4ea7-a312-bf500853a20a
⛔ Files ignored due to path filters (2)
src/mesh/generated/meshtastic/interdevice.pb.cppis excluded by!**/generated/**,!src/mesh/generated/**src/mesh/generated/meshtastic/interdevice.pb.his excluded by!**/generated/**,!src/mesh/generated/**
📒 Files selected for processing (21)
platformio.iniprotobufssrc/RedirectablePrint.cppsrc/configuration.hsrc/detect/ScanI2CTwoWire.cppsrc/gps/GPS.cppsrc/gps/GPS.hsrc/graphics/tftSetup.cppsrc/main.cppsrc/mesh/IndicatorSerial.cppsrc/mesh/IndicatorSerial.hsrc/mesh/comms/FakeI2C.cppsrc/mesh/comms/FakeI2C.hsrc/mesh/comms/FakeUART.cppsrc/mesh/comms/FakeUART.hsrc/modules/Telemetry/EnvironmentTelemetry.cppsrc/modules/Telemetry/Sensor/IndicatorSensor.cppsrc/modules/Telemetry/Sensor/IndicatorSensor.hsrc/serialization/cobs.cppsrc/serialization/cobs.hvariants/esp32s3/seeed-sensecap-indicator/variant.h
💤 Files with no reviewable changes (5)
- src/modules/Telemetry/EnvironmentTelemetry.cpp
- src/serialization/cobs.cpp
- src/serialization/cobs.h
- src/modules/Telemetry/Sensor/IndicatorSensor.h
- src/modules/Telemetry/Sensor/IndicatorSensor.cpp
🚧 Files skipped from review as they are similar to previous changes (14)
- protobufs
- src/configuration.h
- src/mesh/IndicatorSerial.h
- src/graphics/tftSetup.cpp
- src/mesh/comms/FakeI2C.h
- variants/esp32s3/seeed-sensecap-indicator/variant.h
- src/mesh/comms/FakeUART.cpp
- src/mesh/comms/FakeUART.h
- src/RedirectablePrint.cpp
- src/mesh/comms/FakeI2C.cpp
- src/detect/ScanI2CTwoWire.cpp
- src/gps/GPS.h
- src/main.cpp
- src/mesh/IndicatorSerial.cpp
9d9c50c to
36b1be7
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/modules/Telemetry/EnvironmentTelemetry.cpp`:
- Around line 676-684: Replace the sprintf call in the notification construction
block with snprintf, passing sizeof(notification->message) as the buffer size
while preserving the existing format string and arguments.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 22f28c40-3a0a-4870-9d06-b32aa56a27fd
⛔ Files ignored due to path filters (2)
src/mesh/generated/meshtastic/interdevice.pb.cppis excluded by!**/generated/**,!src/mesh/generated/**src/mesh/generated/meshtastic/interdevice.pb.his excluded by!**/generated/**,!src/mesh/generated/**
📒 Files selected for processing (20)
platformio.inisrc/RedirectablePrint.cppsrc/configuration.hsrc/detect/ScanI2CTwoWire.cppsrc/gps/GPS.cppsrc/gps/GPS.hsrc/graphics/tftSetup.cppsrc/main.cppsrc/mesh/IndicatorSerial.cppsrc/mesh/IndicatorSerial.hsrc/mesh/comms/FakeI2C.cppsrc/mesh/comms/FakeI2C.hsrc/mesh/comms/FakeUART.cppsrc/mesh/comms/FakeUART.hsrc/modules/Telemetry/EnvironmentTelemetry.cppsrc/modules/Telemetry/Sensor/IndicatorSensor.cppsrc/modules/Telemetry/Sensor/IndicatorSensor.hsrc/serialization/cobs.cppsrc/serialization/cobs.hvariants/esp32s3/seeed-sensecap-indicator/variant.h
💤 Files with no reviewable changes (4)
- src/modules/Telemetry/Sensor/IndicatorSensor.h
- src/serialization/cobs.h
- src/modules/Telemetry/Sensor/IndicatorSensor.cpp
- src/serialization/cobs.cpp
🚧 Files skipped from review as they are similar to previous changes (14)
- src/configuration.h
- platformio.ini
- src/gps/GPS.h
- variants/esp32s3/seeed-sensecap-indicator/variant.h
- src/mesh/comms/FakeUART.h
- src/RedirectablePrint.cpp
- src/mesh/comms/FakeI2C.h
- src/detect/ScanI2CTwoWire.cpp
- src/gps/GPS.cpp
- src/mesh/IndicatorSerial.h
- src/graphics/tftSetup.cpp
- src/mesh/comms/FakeI2C.cpp
- src/mesh/comms/FakeUART.cpp
- src/mesh/IndicatorSerial.cpp
The busy retry re-armed its own budget on every busy answer, so a co-processor that stayed busy kept the caller in the loop with no way out. Transport retries and the wait for a busy card are now separate budgets that only count down.
A byte run lost mid-response (a UART overflow during a 4KB tile chunk, when the display starves the RX interrupt) misaligns the assembly buffer. The buffer was never reset, so the poison outlived the request and cascaded into the following chunks of the same tile: one glitch dropped a whole multi-chunk tile, while single-chunk tiles resynced in the idle gap and survived. Each request now flushes the buffer first, bounding a glitch to the one chunk it hit. Adds resync/decode/timeout counters, logged rarely, to see the rate.
The heap was 3MB and the image cache reserves 1.5MB of it, so a low-zoom map tile could not find a large enough contiguous block to decode and rendered white. 5MB of the 8MB PSRAM fixes it with room to spare.
…mits Point the protobufs submodule at the merged SD command protos (protobufs #986) so it matches the checked in interdevice sources, and bump the device-ui archive to the current indicator branch tip that carries the SD button and format UI.
Resolve the device-ui pin to the indicator branch merge commit, which carries both develop's device-ui updates and the remote SD support, so neither side is lost. Take develop's protobufs pointer, which already contains the merged SD command protos.
|
@github-copilot merge develop into this branch, use commit reference 3d4f718cfb68e2d1052e1d1127b91fd74a753574 to resolve the merge conflict in platformio.ini. |
|
@coderabbitai merge develop into this branch, use commit reference 3d4f718cfb68e2d1052e1d1127b91fd74a753574 to resolve the merge conflict in platformio.ini. |
|
✅ Merge conflicts resolved successfully! Resolved 2 conflict file(s). Commit: 28 file operation(s)
View agent analysis |
Resolved conflicts in: - platformio.ini (content) - src/graphics/tftSetup.cpp (content) Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
|
|
mverch67
left a comment
There was a problem hiding this comment.
Removed the SpiLockBreak from IndicatorRemoteFS and I2CProxy. The reentrant lock already implemented in PR11278 ensures the bus is free during the phases where those calls happen.
The Indicator's RP2040 co-processor serves as a generic peripheral bridge over a serial protobuf link (interdevice.proto). Companion PRs: meshtastic/protobufs#721 (protocol), meshtastic/device-ui#342 (map tile and SD card services), meshtastic/indicator_rp2040#3 (co-processor firmware).
The generated interdevice bindings are included in-tree; the protobufs submodule stays on the develop pin until meshtastic/protobufs#721 merges, after which a regeneration commit follows the usual flow.
Verified on hardware: bridged sensor scan and telemetry (AHT10, SCD41), GPS fix, map tiles and SD statistics all work end to end.
Summary by CodeRabbit