- Add n4 parameter to control server, LED bar receiver, and test script - Create segmented_movement pattern with alternating forward/backward movement - Pattern supports n1 (segment length), n2 (spacing), n3 (forward speed), n4 (backward speed) - Fix test script to send all messages instead of just the first one - Add segmented_movement to patterns_needing_params for proper parameter transmission - Pattern intelligently handles all cases: alternating, forward-only, backward-only, or static - Implements repeating segments with configurable spacing across LED strip
1.6 KiB
1.6 KiB
ESP32-C3 Debug Patch
Issue Found
The ESP32-C3 firmware sends status messages every 5 seconds when SPI transactions fail (line 208 in main.c), which could interfere with ESP NOW communication and cause pattern pauses.
Debugging Steps
1. Monitor ESP32-C3 Status Messages
The ESP32-C3 sends status messages every 5 seconds, which may interrupt ESP NOW communication.
2. Check SPI Communication
Pattern stops could be caused by:
- SPI transaction failures causing 5-second delays
- ESP NOW interference with SPI operations
- Memory/buffer issues during concurrent operations
3. Monitor ESP NOW Traffic
Use the debug scripts to monitor:
- ESP NOW message transmission timing
- Message gaps between transmissions
- ESP32-C3 vs LED bar timing differences
4. Potential Fixes
Immediate fixes:
- Reduce status message frequency from 5 seconds to 30 seconds
- Add ESP NOW debug logging to see message transmission times
- Remove blocking delays on SPI failures
Firmware modifications needed:
- Change
pdMS_TO_TICKS(5000)
topdMS_TO_TICKS(30000)
for status messages - Add debug printf statements for ESP NOW transmissions
- Make SPI error handling non-blocking
5. Testing Strategy
- Apply firmware patches
- Monitor ESP NOW traffic with debug scripts
- Observe pattern continuity
- Check timing of ESP NOW vs SPI operations
Current Status
- ESP32-C3 runs status sender task every 10 seconds
- ESP32-C3 sends status via ESP NOW every 5 seconds on SPI errors
- Original heartbeat in control server was disabled (this was correct)
- Issue likely in ESP32-C3 firmware timing