Step-by-step instructions to create your own fork of drone-mesh-mapper on GitHub with all the enhanced firmware, base station scripts, and mapper patches integrated.
- Go to github.com/colonelpanichacks/drone-mesh-mapper
- Click Fork (top right)
- Select your account as the destination
- Uncheck "Copy the main branch only" (keep all branches)
- Click Create Fork
You now have github.com/YOUR_USERNAME/drone-mesh-mapper
git clone https://github.com/YOUR_USERNAME/drone-mesh-mapper.git
cd drone-mesh-mapperSet the upstream remote so you can pull future updates from colonelpanichacks:
git remote add upstream https://github.com/colonelpanichacks/drone-mesh-mapper.git
git fetch upstreamgit checkout -b enhanced-v2.1.0From this package, copy these directories into your fork:
# From wherever you extracted this package
PACKAGE=/path/to/drone-mesh-mapper-fork
# Firmware (new directory — doesn't exist in upstream)
cp -r $PACKAGE/firmware ./
# Base station scripts (new directory)
cp -r $PACKAGE/base-station ./
# Patches for mesh-mapper.py
cp -r $PACKAGE/patches ./
# Meshtastic configuration guide (new directory)
cp -r $PACKAGE/meshtastic-config ./
# Documentation
cp -r $PACKAGE/docs ./
# Updated gitignore (merge with existing)
cat $PACKAGE/.gitignore >> .gitignore
sort -u .gitignore -o .gitignore
# Changelog
cp $PACKAGE/CHANGELOG.md ./
# Updated README (replaces upstream README)
# NOTE: You may want to keep the upstream README and add a section instead.
# Option A: Replace entirely
cp $PACKAGE/README.md ./README.md
# Option B: Keep upstream README, add fork notes at top (manual edit)The upstream mesh-mapper.py is in the repo root. Apply the patches in order:
# P0: Critical bug fixes (thread safety, duplicate defs, headless fix)
python3 patches/patch_mesh_mapper_p0.py mesh-mapper.py
# R2: v2.1.0 feature additions (detection display, node markers, CSV)
python3 patches/patch_mesh_mapper_r2.py mesh-mapper.pyEach patch creates a .bak backup and validates its work. Review the output to confirm all fixes applied.
Verify the patched file:
python3 -c "compile(open('mesh-mapper.py').read(), 'mesh-mapper.py', 'exec'); print('Syntax OK')"git add -A
git commit -m "v2.1.0: Enhanced firmware, base station bridge, mapper patches
New:
- firmware/: XIAO ESP32S3 detection firmware v2.1.0
- Dual-core WiFi+BLE ODID scanning
- OUI/SSID drone presence detection
- GPS support (GY-NEO6MV2)
- Channel hopping, FreeRTOS thread safety
- base-station/: RPi mesh bridge (Meshtastic USB -> PTY)
- meshtastic-config/: Setup guide for V3 and Tracker V1.1
Patched mesh-mapper.py:
- Thread safety locks on tracked_pairs and CSV writes
- Removed 9 duplicate function definitions
- Fixed --headless to keep web server running
- Reduced polling overhead (restorePaths 200ms -> 10s)
- v2.1.0 field support (detect, oui_hint, node_id, node_lat/long/alt)
- Detection method display in popups
- OUI manufacturer badge in drone list
- Node position markers on map
- /api/node_positions endpoint
- --observer-lat/--observer-long CLI args
- Enhanced CSV with 6 new columns"
git push origin enhanced-v2.1.0If you want to merge into your main branch:
- Go to your fork on GitHub
- Click Compare & pull request for
enhanced-v2.1.0 - Review the changes
- Merge into
main
ssh analyst@<RPi-IP>
cd /opt
sudo git clone https://github.com/YOUR_USERNAME/drone-mesh-mapper.git mesh-mapper
sudo chown -R analyst:analyst /opt/mesh-mapper
# Install dependencies
sudo pip3 install meshtastic flask flask-socketio pyserial requests urllib3 --break-system-packages# Copy base station scripts
scp base-station/mesh_bridge.py analyst@<RPi-IP>:/opt/mesh-mapper/
scp base-station/start_base_station.py analyst@<RPi-IP>:/opt/mesh-mapper/
# Apply patches remotely
scp patches/*.py analyst@<RPi-IP>:/opt/mesh-mapper/
ssh analyst@<RPi-IP> "cd /opt/mesh-mapper && python3 patch_mesh_mapper_p0.py mesh-mapper.py && python3 patch_mesh_mapper_r2.py mesh-mapper.py"ssh analyst@<RPi-IP>
# Bridge service
sudo tee /etc/systemd/system/mesh-bridge.service << 'EOF'
[Unit]
Description=Meshtastic USB Bridge
After=network.target
[Service]
Type=simple
User=analyst
WorkingDirectory=/opt/mesh-mapper
ExecStart=/usr/bin/python3 /opt/mesh-mapper/mesh_bridge.py --port /dev/ttyUSB0
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
# Mapper service
sudo tee /etc/systemd/system/mesh-mapper.service << 'EOF'
[Unit]
Description=Drone Mesh Mapper
After=mesh-bridge.service
Requires=mesh-bridge.service
[Service]
Type=simple
User=analyst
WorkingDirectory=/opt/mesh-mapper
Environment=DISPLAY=
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/python3 /opt/mesh-mapper/mesh-mapper.py --debug
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable mesh-bridge mesh-mapper
sudo systemctl start mesh-bridge mesh-mapperOn your development machine (Mac/Linux with PlatformIO):
cd firmware
# Put XIAO in boot mode: hold BOOT, tap RESET, release BOOT
pio run -e remote_node -t uploadConfigure each Heltec — see meshtastic-config/README.md.
# Check services
sudo systemctl status mesh-bridge mesh-mapper
# Check web UI
curl -s http://localhost:5000/api/diagnostics | python3 -m json.tool
# Check node positions (after detection nodes are deployed)
curl -s http://localhost:5000/api/node_positions | python3 -m json.tool
# Open web UI in browser
# http://<RPi-IP>:5000To pull future updates from colonelpanichacks without losing your enhancements:
git fetch upstream
git checkout main
git merge upstream/main
# Re-apply patches if mesh-mapper.py was updated
git checkout enhanced-v2.1.0
git rebase main
# Re-run patches if needed (they're idempotent)
python3 patches/patch_mesh_mapper_p0.py mesh-mapper.py
python3 patches/patch_mesh_mapper_r2.py mesh-mapper.pyPatch script says "SKIPPED" for a fix: The upstream file may have changed. Check the specific pattern the patch is looking for (documented in the script output) and apply manually if needed.
Merge conflicts after upstream update: The patches modify specific patterns in mesh-mapper.py. If upstream changes the same lines, you'll need to resolve conflicts manually. The patch scripts are designed to be re-runnable — after resolving conflicts, just re-run both patches.
Firmware won't compile: Make sure you have PlatformIO installed and the XIAO ESP32S3 board support. The firmware requires Arduino framework for ESP32.
pio pkg install -e remote_node
pio run -e remote_node