Building the Firmware
This guide shows you how to build the blinqr firmware from source using PlatformIO.
Prerequisites
Section titled “Prerequisites”Install PlatformIO
Section titled “Install PlatformIO”PlatformIO can be installed in several ways:
Option 1: VS Code Extension (Recommended)
Section titled “Option 1: VS Code Extension (Recommended)”- Install Visual Studio Code
- Open Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for “PlatformIO IDE”
- Click Install
Option 2: Command Line
Section titled “Option 2: Command Line”pip install platformioClone the Repository
Section titled “Clone the Repository”git clone https://github.com/hud-code/blinqr-firmware.gitcd blinqr-firmwareBuilding
Section titled “Building”Using VS Code
Section titled “Using VS Code”- Open the
blinqr-firmwarefolder in VS Code - PlatformIO should automatically detect the project
- Click the Build button (checkmark icon) in the bottom toolbar
- Wait for compilation to complete
Using Command Line
Section titled “Using Command Line”cd blinqr-firmwarepio runExpected Output
Section titled “Expected Output”Processing esp32dev (platform: espressif32; board: esp32dev)...Linking .pio/build/esp32dev/firmware.elfBuilding .pio/build/esp32dev/firmware.bin============== [SUCCESS] Took X.XX seconds ==============Project Structure
Section titled “Project Structure”blinqr-firmware/├── platformio.ini # Build configuration├── src/│ └── main.cpp # Main entry point├── include/│ ├── hw/│ │ ├── HwPins.h # GPIO pin definitions│ │ └── HwController.h│ └── ble/│ └── ReminderBleServer.h└── lib/ ├── hw/ │ └── HwController.cpp └── ble/ └── ReminderBleServer.cppConfiguration
Section titled “Configuration”Changing Pin Assignments
Section titled “Changing Pin Assignments”Edit include/hw/HwPins.h to change GPIO pins:
// LED GPIO pins#define LED_PIN_0 2 // Change these to match your wiring#define LED_PIN_1 4#define LED_PIN_2 5#define LED_PIN_3 18#define LED_PIN_4 19
// Button GPIO pins#define BTN_PIN_0 12#define BTN_PIN_1 13#define BTN_PIN_2 14#define BTN_PIN_3 27#define BTN_PIN_4 26Changing Device Name
Section titled “Changing Device Name”Edit include/ble/ReminderBleServer.h:
#define DEVICE_NAME "blinqr Box" // Change to your preferred nameTroubleshooting
Section titled “Troubleshooting”Build fails with “No such file or directory”
Section titled “Build fails with “No such file or directory””Make sure you’re in the correct directory and have cloned the full repository:
ls platformio.ini # Should exist“Could not find the package”
Section titled ““Could not find the package””PlatformIO downloads dependencies automatically. If it fails:
pio pkg install“Upload port not found”
Section titled ““Upload port not found””This error occurs during upload, not build. See Flashing.
Next Steps
Section titled “Next Steps”Once the build succeeds, proceed to Flashing to upload the firmware to your ESP32.