Agent skill
test-privacylrs-hardware
Flash and test code on PrivacyLRS/ExpressLRS ESP32 hardware modules (TX/RX)
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/test-privacylrs-hardware
SKILL.md
Test PrivacyLRS/ELRS Hardware
Flash and test firmware on ESP32-based PrivacyLRS/ExpressLRS hardware modules.
Hardware Setup
-
Connect Device via USB:
bash# Verify connection ls -la /dev/ttyUSB* pio device list -
Identify Device:
- TX modules: Transmitter/Handset
- RX modules: Receiver
- Note MAC address for tracking
Building Production Firmware
cd PrivacyLRS/src
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400" pio run -e <target> --target upload
Common targets: namimnorc-tx, namimnorc-rx (check platformio.ini for more)
Creating Standalone Test Firmware
For isolated testing:
1. Create Test Project
mkdir -p PrivacyLRS/test_esp32_standalone/{src}
cd PrivacyLRS/test_esp32_standalone
2. Create platformio.ini
[env:esp32test]
platform = espressif32@6.4.0
board = esp32dev
framework = arduino
upload_port = /dev/ttyUSB0
monitor_port = /dev/ttyUSB0
monitor_speed = 115200
lib_deps =
; Add libraries as needed
3. Create src/main.cpp
#include <Arduino.h>
void setup() {
Serial.begin(115200);
delay(2000);
Serial.println("Test starting...");
// Your test code
}
void loop() {
delay(5000);
Serial.println("Running...");
}
4. Build and Upload
pio run -e esp32test --target upload
Capturing Serial Output
Simple Capture
stty -F /dev/ttyUSB0 115200
timeout 30 cat /dev/ttyUSB0 | tee output.txt
Continuous Monitor
stty -F /dev/ttyUSB0 115200
cat /dev/ttyUSB0 # Ctrl+C to stop
Capture Boot Sequence
# Upload resets device automatically
pio run -e esp32test --target upload
sleep 2
timeout 10 cat /dev/ttyUSB0 > boot.txt
cat boot.txt
Troubleshooting
Device Not Found
lsusb # Check USB devices
ls -la /dev/ttyUSB* /dev/ttyACM* # Check serial ports
sudo usermod -a -G dialout $USER # Fix permissions (logout/login after)
Garbled Output
# Try different baud rates
stty -F /dev/ttyUSB0 115200 # Standard
stty -F /dev/ttyUSB0 460800 # High speed
Crash (Boot Loop)
Look for:
Guru Meditation Error- ESP32 crashpanic'ed (LoadProhibited)- Memory access errorEXCVADDR: 0x00000000- Null pointer dereferencePC: 0x...- Crash address
Decode crash address:
xtensa-esp32-elf-addr2line -e .pio/build/esp32test/firmware.elf <PC_address>
Incremental Testing
For debugging, test incrementally:
- Minimal - Just
Serial.println("Hello") - Add includes - One header at a time
- Create objects - Instantiate classes
- Initialize - Call setup methods
- Operations - Test functionality
- Stress test - Loops and benchmarks
Stop at first failure to isolate the problem!
Memory Check
Watch build output:
RAM: [= ] 6.6% (21552 / 327680 bytes)
Flash: [== ] 20.2% (265285 / 1310720 bytes)
Safe limits: RAM < 80%, Flash < 90%
Common Build Flags
# Required for some builds
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400"
# Enable encryption
PLATFORMIO_BUILD_FLAGS="-DUSE_ENCRYPTION"
# Multiple flags
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400 -DUSE_ENCRYPTION"
Expected Output
Normal Boot
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET)
...
Test starting...
Running...
Crash
Guru Meditation Error: Core 1 panic'ed (LoadProhibited)
PC: 0x400d4314 EXCVADDR: 0x00000000
Rebooting...
Best Practices
- Start with minimal test code
- Use Serial.println() for debugging
- Save all output to files
- Commit working states to git
- Document device MAC and test results
Related Skills
- privacylrs-test-runner - Run unit tests before hardware testing
- create-pr - Create pull request after validating on hardware
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?