This project provides a Docker-based build system for compiling MeshCore firmware with Wi-Fi capabilities for the Heltec V3 device.
This build system was "vibe coded 🤮" with GitHub Copilot based on the excellent work and documentation at Ottawa Mesh - MeshCore/Heltekv3Wifi. All credit for the underlying firmware and Wi-Fi implementation goes to the MeshCore development team and the Ottawa Mesh community.
IMPORTANT: Your Wi-Fi credentials are embedded in the compiled firmware at build time. Do not share the compiled binary files publicly if they contain your real Wi-Fi credentials.
Configured to build MeshCore 1.12.0 from commit e738a74.
- Docker-based: Clean, reproducible build environment using Ubuntu 24.04
- Automated Wi-Fi Configuration: Simple sed-based replacement of Wi-Fi credentials in git repository
- Pinned Builds: Defaults to MeshCore commit
e738a74(version label1.12.0) - Override Support: You can choose a different MeshCore commit with
--commit - Safe Output: Generates firmware files with clear naming and build information
- Build Caching: Caches PlatformIO tools and dependencies for subsequent builds
-
Build and run with your Wi-Fi credentials:
./run-build.sh --ssid "YourWiFiName" --password "YourWiFiPassword"
-
Flash the generated firmware to your Heltec V3 device using your preferred flashing tool.
./run-build.sh --ssid "MyWiFi" --password "MyPassword"# Enable debug logging
./run-build.sh --ssid "MyWiFi" --password "MyPassword" --enable-debug
# Build a specific MeshCore commit
./run-build.sh --ssid "MyWiFi" --password "MyPassword" --commit e738a74 --version 1.12.0
# Custom output directory
./run-build.sh --ssid "MyWiFi" --password "MyPassword" --output "/path/to/output"
# Build Docker image only (for testing)
./run-build.sh --build-only
# Run without rebuilding Docker image
./run-build.sh --ssid "MyWiFi" --password "MyPassword" --no-build-s, --ssid SSID: Wi-Fi SSID (required)-p, --password PASSWORD: Wi-Fi password (required)-v, --version VERSION: Firmware version label for build metadata (default:1.12.0)--commit SHA: MeshCore commit to build (default:e738a74)-o, --output DIR: Output directory (default: ./firmware-output)-c, --cache DIR: Cache directory (default: ./build-cache)--max-contacts NUM: Maximum contacts (default: 300)--max-channels NUM: Maximum group channels (default: 8)--enable-debug: Enable mesh debug logging--enable-packet-log: Enable mesh packet logging--build-only: Only build the Docker image, don't run--no-build: Skip building Docker image, just run--clear-cache: Clear the build cache before running-h, --help: Show help message
The build process generates the following files in the output directory:
Heltec_v3_companion_radio_wifi.bin: Main firmware fileHeltec_v3_companion_radio_wifi-merged.bin: Merged firmware (bootloader + firmware)build-info.txt: Build information and flashing instructions
Use the included Mac flashing script:
# Safe mode (preserves data partition)
./flash-mac.sh
# Full erase mode (destroys all data)
./flash-mac.sh --erase
# Show help
./flash-mac.sh --helpThe script will:
- Auto-install esptool if needed
- Auto-detect your Heltec V3 device
- Flash the firmware with error handling
- Offer serial monitoring to verify Wi-Fi connection
The build system includes caching for subsequent builds:
- First build: Downloads PlatformIO tools and ESP32 toolchain
- Subsequent builds: Reuses cached tools, only compiles firmware
- Cache location:
./build-cache/directory (automatically created)
# Check cache status (automatically shown during build)
ls -la build-cache/
# Clear cache if needed
./run-build.sh --ssid "MyWiFi" --password "MyPass" --clear-cache
# Use custom cache location
./run-build.sh --ssid "MyWiFi" --password "MyPass" --cache "/path/to/cache"- Docker
- macOS, Linux, or Windows with WSL2
- Internet connection (to clone/fetch the MeshCore repository)
- Base: Ubuntu 24.04 (opensource alternative to Red Hat)
- Build Tools: PlatformIO, Python 3, Git, GCC
- Process: Clones/fetches MeshCore, checks out pinned commit, replaces Wi-Fi placeholders, builds firmware
- Clone/update MeshCore repository from GitHub
- Check out the requested MeshCore commit
- Replace Wi-Fi placeholders (
myssid/mypwd) in platformio.ini using sed - Build firmware using PlatformIO
- Generate firmware files with clear naming
- Create build information file
- Check Docker is running and accessible
- Ensure you have internet connectivity
- Verify Wi-Fi credentials don't contain special characters that might break the build
- The build script will show available variants if the expected platformio.ini is not found
- Check the build output for specific error messages
- Use
docker system pruneto clean up old images if space is an issue - Rebuild the Docker image with
./run-build.sh --build-only
If you prefer to run Docker commands manually:
# Build the image
docker build -t meshcore-builder .
# Run the build
docker run --rm \
-e WIFI_SSID="YourSSID" \
-e WIFI_PWD="YourPassword" \
-v "$(pwd)/firmware-output:/output" \
-v "$(pwd)/build-cache:/build-cache" \
meshcore-builderThis build system is released under the Creative Commons CC0 1.0 Universal License.
This work is dedicated to the public domain. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. See the LICENSE file for full legal text.
The MeshCore firmware itself is subject to its own license terms. This build system just automates the compilation process documented by the Ottawa Mesh community.
This build automation was created based on the excellent documentation at:
All credit for the underlying MeshCore firmware and Wi-Fi implementation goes to:
- The MeshCore development team
- The Ottawa Mesh community
- All contributors to the MeshCore project
This repository just provides Docker-based build automation for convenience. 🤖
