MeshCore Source Code Development Tutorial
Prerequisites
Necessary Tool
Before you begin, prepare the following tools:
Install PlatformIO
Search for PlatformIO in the VS Code Extensions marketplace and install it.

After installation, an ant-shaped icon usually appears in the left toolbar.

Project Preparation
Open a folder you want your project in. Open the folder in terminal. Click here to git clone the project.
Open VSCode, then click platform IO icon, choose select a folder. Choose the folder you cloned the project with.

PlatformIO will automatically install the necessary dependencies. After the installation succeed, you can see Project has been successfully updated

Firmware Development
Development Torial
Find the environment for your target board. Take Solar node repeater as example:

Tnen PtformmlIO will prepare the required dependencies for the board.
Change your code. It is recommended to change the variant.h file for your board.
After copleting the coding, run the following command to copiling the code and change to uf2 file.
pio run -e SenseCap_Solar_repeater
pio run -e SenseCap_Solar_repeater -t create_uf2
Then double click the RST button to enter DFU mode. Drag the uf2 file into the pop-out disk. The uf2 file should be found in .pio\build\SenseCap_Solar_repeater
Example
User Light Control
This example shows how to write a blinking loop for the user light. Copy the following code to /examples/simple_repeater/main.cpp
#endif
#ifdef LED_WHITE
static void updateUserLightBlink() {
static unsigned long lastLedPhaseChangeAt = 0;
static bool lightIsOn = true;
const unsigned long now = millis();
if ((unsigned long)(now - lastLedPhaseChangeAt) >= 5000) {
lightIsOn = !lightIsOn;
lastLedPhaseChangeAt = now;
}
digitalWrite(LED_WHITE, lightIsOn ? LED_STATE_ON : !LED_STATE_ON);
}
and write the loop:
#ifdef LED_WHITE
updateUserLightBlink();
#endif
Copiling it and flash the uf2 file to your solar node.
(Advanced) Pr Submitting
Thanks for considering contributing to MeshCore project! How Can you Contribute? 1. Reporting Bugs
- Use the Issues tracker
- Use a clear title (e.g. "Crash when calling begin() with invalid pin")
- Describe the exact steps to reproduce
- Include your board, IDE version, library version and relevant code snippet
- Attach minimal complete example sketch if possible
2. Suggesting Enhancements / New Features
- Open an issue with the prefix [Feature request]
- Explain the use-case → what problem would this solve?
- Describe your ideal API / behavior (code examples are very helpful) 3. Submitting Code Changes (Pull Requests)
Small fixes
(typos, comments, examples, small bug fixes) → Just open a pull request — no prior issue needed
Larger changes / new features
- Open an issue first to discuss the idea
- Get a rough 👍 from maintainer(s)
- Fork the repo from 'dev' branch and create your branch (fix/xxx, feature/yyy, docs/whatever)
- Make your changes
- Update or add examples when appropriate
- Add/update comments in code
- Submit the pull request
Pull Request Guidelines
- One feature / fix = one pull request (smaller PRs are easier & faster to review)
- Use descriptive commit messages Good: Fix I2C timeout handling on ESP32 Bad: update
- Reference any related issue (Fixes #123, Closes #89, etc.)
- If you change public API, update README.md and library.properties
- New features should include an example sketch in examples/
Coding Style
PLease follow the existing C++ style (per the .clang-format)
- 2 spaces indentation (no tabs)
- camelCase for functions and variables
- UpperCamelCase / PascalCase for class names
- #define constants in ALL_CAPS
- Keep lines < ~100 characters when reasonable (But consistency with existing code is more important than strict rules)