Co-authored-by: Genaker <9213670+Genaker@users.noreply.github.com>
7.1 KiB
Troubleshooting Guide
Common Issues and Solutions
Build and Compilation Issues
Error: "Unknown board ID"
Symptom: Build fails with Error: Unknown board ID 'heltec_wifi_lora_32_V3'
Solution: Update your ESP32 Espressif catalog:
pio pkg update -g -p espressif32
Build Timeout or Slow First Build
Symptom: First compilation takes very long (>5 minutes)
Solution: This is normal - PlatformIO needs to download and compile all libraries on first run. Subsequent builds will be much faster (~30-60 seconds).
Upload Issues
Cannot Upload to Board
Symptom: Upload fails with "Failed to connect to ESP32"
Solution:
- Press and hold BOOT button
- Press RESET button once
- Release BOOT button
- Try upload again within 5 seconds
USB Driver Not Found (Windows)
Symptom: Device not recognized or COM port not showing
Solution: Install CP2101 USB drivers:
- Download from: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
- For Windows: Use the executable installer
- For macOS: Use legacy driver if standard driver doesn't work
Runtime Errors
No Display Output
Symptom: Device powers on but screen stays blank
Solution:
- Check if correct board is selected in
platformio.ini - Verify
src_dirmatches your board type:srcfor OLED displays (Heltec V3, LilyGo)tft_srcfor TFT displays (Vision Master T190)eink_srcfor e-ink displays (Vision Master E290)
Scan Results Show No Signals
Symptom: Spectrum analyzer runs but shows no activity
Solution:
- Check antenna is properly connected
- Verify frequency range matches your region's LoRa bands
- Adjust threshold in configuration (try lower value like -120 dBm)
- Test with known active frequency (e.g., WiFi 2.4 GHz)
Python Scripts Fail to Connect
Symptom: ASCII_SA.py or SpectrumScan.py cannot open serial port
Solution:
-
Close Arduino IDE or PlatformIO serial monitor (only one program can use serial port)
-
Check permissions on Linux:
sudo usermod -a -G dialout $USER # Then logout and login again -
Verify correct port:
- Linux: Usually
/dev/ttyUSB0or/dev/ttyACM0 - Windows: Check Device Manager for COM port number
- macOS: Usually
/dev/cu.usbserial-*
- Linux: Usually
-
Set port via environment variable:
export LORA_SA_PORT=/dev/ttyUSB0 python3 ASCII_SA.py
Configuration Issues
OSD Feature Not Working
Symptom: Compiled with OSD_ENABLED but no video output
Solution:
- Verify DFRobot OSD wiring (see main README)
- Check SPI pins match your board configuration
- Test camera independently before connecting to OSD
Custom Frequency Range Not Working
Symptom: Device scans wrong frequencies despite configuration
Solution:
- Ensure
SCAN_DIAPAZONESis properly formatted:int SCAN_DIAPAZONES[] = {850890, 920950}; // Two ranges: 850-890 and 920-950 - If using single range, set
RANGE_PER_PAGE = FREQ_END - FREQ_BEGIN - Frequency values must be within radio chip capabilities:
- SX1262: 150-960 MHz
- SX1280: 2400-2500 MHz
- LR1121: 150-960 MHz, 2400-2500 MHz
Python Script Errors
ModuleNotFoundError: No module named 'serial_utils'
Symptom: Python scripts fail with import error
Solution: Ensure you're running scripts from the repository root:
cd /path/to/LoraSA
python3 ASCII_SA.py
Or install in development mode:
export PYTHONPATH="${PYTHONPATH}:/path/to/LoraSA"
ValueError: Invalid SCAN_RESULT format
Symptom: Script crashes when parsing serial data
Solution:
- This indicates corrupted serial data
- Check USB cable quality (use high-quality, short cables)
- Reduce baudrate in configuration if errors persist:
export SERIAL_BAUDRATE=57600 - Update to latest firmware version
Performance Issues
Slow Scan Rate
Symptom: Less than 1 scan per second
Solution:
- Reduce scan range: smaller
FREQ_END - FREQ_BEGIN - Increase bandwidth setting (faster but less sensitive)
- Disable waterfall if enabled
- Disable WiFi/BT scanning if not needed
High Battery Drain
Symptom: Battery depletes quickly
Solution:
- Reduce screen brightness
- Use power-saving mode (press P button on startup)
- Disable Bluetooth/WiFi if not in use
- Use sleep mode between scans
Network and Communication
BLE/WiFi Scanning Not Working
Symptom: WIFI_SCANNING_ENABLED or BT_SCANNING_ENABLED doesn't show results
Solution:
- Ensure OSD is enabled (required for WiFi/BT scanning)
- Verify defines are set:
#define OSD_ENABLED true #define WIFI_SCANNING_ENABLED true #define BT_SCANNING_ENABLED true - Check antenna placement (WiFi/BT uses different antenna than LoRa on some boards)
LoRa Communication Between Devices Fails
Symptom: Data not transmitting via LoRa
Solution:
- Verify both devices use same frequency configuration
- Check
is_hostsetting (one device should be host, one client) - Ensure LoRa TX/RX are properly configured in
lib/config/config.h - Test with shorter distance first (<100m)
Getting Additional Help
If none of these solutions work:
-
Check Serial Monitor Output: Connect via USB and monitor serial output for error messages
pio device monitor -
Enable Debug Logging: Add to build flags:
build_flags = -DCORE_DEBUG_LEVEL=5 -
Report Issue: Include:
- Board model and version
- PlatformIO environment used
- Complete error message
- Serial output log
- Steps to reproduce
-
Community Resources:
- GitHub Issues: https://github.com/Genaker/LoraSA/issues
- Check existing issues for similar problems
- Provide hardware details when asking for help
Environment Variables Reference
The Python scripts now support environment variables for easier configuration:
# Serial port configuration
export LORA_SA_PORT=/dev/ttyUSB0 # LoRa device port
export DRONE_PORT=/dev/ttyACM0 # Drone/FC port (rpi-proxy-fc.py)
export SERIAL_BAUDRATE=115200 # Communication speed
export SERIAL_TIMEOUT=5 # Read timeout in seconds
# Run script with custom config
python3 ASCII_SA.py
# Or inline
LORA_SA_PORT=/dev/ttyUSB1 python3 SpectrumScan.py
Advanced Debugging
Memory Issues
If experiencing crashes or freezes:
-
Check Memory Usage:
Serial.printf("Free heap: %d bytes\n", ESP.getFreeHeap()); -
Reduce Buffer Sizes: Edit configuration to use less memory
-
Disable Features: Turn off waterfall, WiFi scanning to save memory
Timing Issues
If scans appear delayed or unresponsive:
- Disable Watchdog: May need to increase timeout
- Profile Code: Add timing measurements
- Reduce Display Updates: Update less frequently
Radio Issues
If radio performance is poor:
- Check Antenna: Measure VSWR if possible
- Verify Frequency: Use SDR to confirm actual transmission frequency
- Test with Known Good Hardware: Isolate hardware vs software issues