meshcore-repeater/docs/building.md
Ryan Malloy dbed318124 Initial commit: Heltec V3 MeshCore repeater
Standalone PlatformIO project using MeshCore as a library.

Features:
- Heltec LoRa32 V3 support (ESP32-S3 + SX1262)
- OLED display integration
- OTA firmware updates via WiFi
- Serial CLI for configuration

Uses symlinked MeshCore library from ../MeshCore
2026-01-25 12:15:15 -07:00

81 lines
1.4 KiB
Markdown

# Building the Firmware
## Prerequisites
- [PlatformIO](https://platformio.org/) (CLI or IDE)
- MeshCore library at `../MeshCore`
## Build Commands
```bash
# Full build
pio run
# Clean build (removes all artifacts)
pio run -t clean && pio run
# Verbose build (shows compiler commands)
pio run -v
```
## Build Output
After a successful build:
```
RAM: 17.6% (57KB / 320KB)
Flash: 32.0% (1.0MB / 3.3MB)
```
**Output files in `.pio/build/heltec_v3_repeater/`:**
| File | Size | Purpose |
|------|------|---------|
| `firmware.bin` | ~1.1 MB | OTA updates |
| `firmware.elf` | ~2.5 MB | Debugging |
| `firmware.factory.bin` | ~1.2 MB | Initial flash (includes bootloader) |
## Build Configuration
Key settings in `platformio.ini`:
### LoRa Parameters
```ini
-D LORA_FREQ=910.525 # Frequency in MHz
-D LORA_BW=62.5 # Bandwidth in kHz
-D LORA_SF=7 # Spreading factor (7-12)
-D LORA_CR=5 # Coding rate (5-8)
-D LORA_TX_POWER=22 # TX power in dBm
```
### Debug Options
Uncomment to enable:
```ini
; -D MESH_PACKET_LOGGING=1 # Log all mesh packets
; -D MESH_DEBUG=1 # Verbose debug output
```
## Troubleshooting
### Missing MeshCore
```
Error: symlink://../MeshCore not found
```
Ensure MeshCore exists at the expected path:
```bash
ls ../MeshCore/library.json
```
### Library Dependency Errors
Clear the library cache:
```bash
rm -rf .pio/libdeps
pio run
```