mavsdk_drone_show

Hardware Configuration Update - Implementation Summary

Date: November 5, 2025 Version: 3.2 Status: ✅ COMPLETE


Overview

Successfully implemented per-drone hardware configuration support by adding serial_port and baudrate columns to config.csv, enabling mixed hardware fleets (Raspberry Pi 4, Raspberry Pi 5, Jetson, etc.) to operate from a single repository.


Changes Implemented

Phase 1: Backend (Python) ✅

File Lines Changed Description
gcs-server/config.py 17 Added serial_port and baudrate to CONFIG_COLUMNS
functions/read_config.py 1-41 Added backward compatibility, returns dict instead of Drone object
src/drone_config.py 213-246 Added get_serial_port() and get_baudrate() accessor methods

Key Features:

Phase 2: Frontend (JavaScript/React) ✅

File Lines/Sections Changed Description
missionConfigUtilities.js 5 locations Updated parser, validator, exporter with backward compatibility
MissionConfig.js 206-218 Added defaults to addNewDrone() function
DroneConfigCard.js Multiple Added display fields and dropdown selectors

Key Features:

Phase 3: Configuration Files ✅

File Change Default Values
config.csv 8 → 10 columns /dev/ttyS0, 57600
config_sitl.csv 8 → 10 columns N/A, N/A
*.csv.backup Created Backup of original files

Phase 4: Testing ✅

Test Status Results
Backend CSV loading ✅ PASS All 10 drones loaded correctly
SITL CSV loading ✅ PASS N/A values handled correctly
Backward compatibility ✅ PASS 8-column CSVs auto-upgrade
Accessor methods ✅ PASS get_serial_port() and get_baudrate() working
Column validation ✅ PASS All rows have 10 columns
Backup files ✅ PASS Backups created successfully

Test Script: test_config_simple.py

Phase 5: Documentation ✅

Document Purpose Location
Migration Guide Complete migration instructions docs/CONFIG_CSV_MIGRATION_GUIDE.md
Implementation Summary This document IMPLEMENTATION_SUMMARY.md
Test Script Validation tool test_config_simple.py

Architecture Decision

Why config.csv Instead of Alternative Approaches?

Considered Alternatives:

  1. .hwType files + hardware_config.csv
  2. ❌ Environment variables (like MDS_REPO_URL)
  3. .hwID file content
  4. config.csv columns (chosen)

Rationale:


Hardware Support Matrix

Platform Serial Port Default Baudrate Status
Raspberry Pi 4 /dev/ttyS0 57600 ✅ Tested
Raspberry Pi 5 /dev/ttyAMA0 57600 ✅ Ready
Raspberry Pi Zero /dev/ttyS0 57600 ✅ Ready
NVIDIA Jetson /dev/ttyTHS1 921600 ✅ Ready
SITL/Simulation N/A N/A ✅ Tested

Backward Compatibility

Automatic Migration

Old 8-column CSVs are automatically upgraded:

  1. Frontend detects old format
  2. Shows toast notification to user
  3. Adds default values (/dev/ttyS0, 57600)
  4. User saves to persist new format

Fallback Behavior

If columns missing, accessor methods fall back to global defaults:

# src/drone_config.py
def get_serial_port(self):
    if self.config and 'serial_port' in self.config:
        return self.config['serial_port']
    return Params.serial_mavlink_port  # /dev/ttyS0

Files Modified

Summary

Complete List

Backend:
  ✓ gcs-server/config.py
  ✓ functions/read_config.py
  ✓ src/drone_config.py

Frontend:
  ✓ app/dashboard/drone-dashboard/src/utilities/missionConfigUtilities.js
  ✓ app/dashboard/drone-dashboard/src/pages/MissionConfig.js
  ✓ app/dashboard/drone-dashboard/src/components/DroneConfigCard.js

Configuration:
  ✓ config.csv
  ✓ config_sitl.csv
  ✓ config.csv.backup (new)
  ✓ config_sitl.csv.backup (new)

Documentation:
  ✓ docs/CONFIG_CSV_MIGRATION_GUIDE.md (new)
  ✓ IMPLEMENTATION_SUMMARY.md (new)

Testing:
  ✓ test_config_simple.py (new)
  ✓ test_config_update.py (new)

Migration Path for Users

New Installations

No action required - everything configured with defaults

Existing Deployments

Option A: Automatic (Recommended)

  1. Upload existing config.csv via Mission Config UI
  2. System detects old format and auto-upgrades
  3. Save to persist new format

Option B: Manual

  1. Backup: cp config.csv config.csv.old
  2. Add columns: ,serial_port,baudrate
  3. Add values: ,/dev/ttyS0,57600 (or appropriate for hardware)
  4. Verify: python3 test_config_simple.py
  5. Restart services

Risk Assessment

Risk Severity Mitigation Status
Breaking existing deployments Medium Backward compatibility + auto-migration ✅ Mitigated
Data loss during migration High Automatic backups created ✅ Mitigated
Frontend/backend mismatch Medium Coordinated file updates ✅ Mitigated
Wrong serial port configured Medium Hardware reference docs + UI dropdowns ✅ Mitigated
CSV parse errors Low Robust error handling + validation ✅ Mitigated

Performance Impact

Conclusion: No measurable performance impact


Next Steps

Immediate

Future Enhancements (Optional)


Deployment Checklist

Pre-Deployment

Deployment

Post-Deployment


Success Metrics

Implementation Goals Achieved:

Code Quality:

User Experience:


Lessons Learned

What Went Well

Improvements for Future


Contact / Support

Developer: Claude Code + User Date Completed: November 5, 2025 Repository: https://github.com/alireza787b/mavsdk_drone_show

For Issues:


Conclusion

The hardware configuration update has been successfully implemented with:

The system now supports mixed hardware fleets while maintaining clean architecture and excellent user experience.

Status:READY FOR DEPLOYMENT


End of Implementation Summary