Building consists of multiple steps:
- (one-time) installing dependencies
- (one-time) installing SDK and toolchain
- (optional) clearing OTA index files
- cleaning previous firmware build (for every board)
- building updated firmware (for every board)
- generating new index files
- updating Z2M converters (for old and new Z2M versions)
- updating ZHA quirks
- updating devices/supported.md
- (manual) updating changelog_fw.md
- running unit tests (automated on push and merge)
- (online) freezing OTA links
The process is automated with scripts that you can run locally or online.
Important
We currently generate a dedicated firmware binary for each device.
The only difference between binaries is the pre-defined config string (device name and pinout).
We are slowly moving towards a unified build (with an empty config string) where the user will have to select the appropriate config string.
Below are explicit instructions for building, installing and contributing.
Two branches are recommended to avoid conflicts between generated files.
(Skip if you don't plan to merge.)
-
Fork the repository and clone it
-
Create code_branch from main (eg. newFeature)
-
Make changes
-
Update
changelog_fw.md(manual) -
Commit changes and push
-
Create build_branch from code_branch (newFeature → newFeature_build) and push
-
Visit GitHub Actions on your fork (web) and run
build.ymlon build_branch
(this takes 5 minutes as it builds the firmware for every device) -
Add the updated converters/quirks to your Z2M/ZHA instance
(if new ones were generated) -
Prepare the update
- For wireless update, use the corresponding index in your OTA settings
(user + build_branch + device_type) - For wire update, get the binary file for your device
(telink usesbin/DEVICE_TYPE/BOARD/tlc_switch-X.Y.Z-<commit-hash>.bin, silabs usesbin/DEVICE_TYPE/BOARD/tlc_switch-X.Y.Z-<commit-hash>.s37)
- For wireless update, use the corresponding index in your OTA settings
-
Perform device update and test: readme.md # Flashing
-
Create a Pull Request (code_branch → romasku/main)
-
Check the unit tests result
This project uses:
- Make for building, with all rules defined in Makefile
- Python for helper_scripts and ZHA quirks
- Javascript for Z2M converters
- YAML for the device database
Linux is recommended.
We currently have bash scripts for Debian/Ubuntu to install dependencies with apt and automate building for multiple boards.
They can easily be adapted for other distributions. (Please share your scripts)
- Fork the repository and clone it
- Run
make_scripts/make_install.sh(one-time) - Enter virtual env to access python packages
source .venv/bin/activate - Create code_branch from main (eg. newFeature)
- Make changes
- Build with
make_scripts/make_all.shormake_scripts/make_debug_single.sh - Run unit tests with
make tests: tests.md - Perform device update and test: flashing_via_wire.md
- Update
changelog_fw.md(manual) - Commit changes (without generated files) and push
- Create a Pull Request (code_branch → romasku/main)
| Command | Description |
|---|---|
make help |
Show all available make commands |
make setup |
Install all tools and dependencies |
make tests |
Run automated tests (builds stub first) |
make stub/build |
Build simulation environment for testing |
make stub/run |
Run interactive device simulation |
make telink/tools/all |
Install Telink development tools |
make telink/build |
Build firmware for Telink hardware |
make silabs/tools/all |
Install Silicon Labs development tools |
make silabs/build |
Build firmware for Silicon Labs hardware |
make silabs/install |
Flash firmware to connected device |
make tools/update_converters |
Generate Zigbee2MQTT converters |
make tools/update_zha_quirk |
Generate ZHA quirks |
make tools/update_supported_devices |
Update devices/supported.md |
make tools/freeze_ota_links |
Replace branch refs with commit IDs in OTA indexes |
make tools/clean_z2m_index |
Clear Zigbee2MQTT OTA index files |
Tip
Run make help to see all available commands, or use make <platform>/help (e.g., make silabs/help) for platform-specific options.