mZee (micro ZigBee stack) is an open-source ZigBee stack for end devices designed for portability and low memory footprint, targeting resource-constrained embedded systems as well as host-based environments.
- APIs may change
- Many ZigBee features missing or incomplete
- Not ZigBee-certified
Feedback, testing, and contributions are welcome.
- Lightweight ZigBee stack with low RAM and Flash usage
- Modular MAC, NWK, APS, and ZCL layers
- Portable platform abstraction layer
- Designed for experimentation, learning, and custom products
- Running on Zephyr OS IEEE 802.15.4 stack
| OS | SoC | Boards |
|---|---|---|
| Zephyr | Nordic nRF52840 | Pro Micro nRF52840 |
First follow https://docs.zephyrproject.org/latest/develop/getting_started/index.html to setup west and Zephyr OS.
Then pull mZee project with west. The following configuration needs to be added in ~/zephyrproject/zephyr/west.yml, under the projects: section:
- name: mzee
url: https://github.com/spiriou/mzee.git
revision: main
path: modules/mzeeThen update the west modules and build the sample projects:
cd ~/zephyrproject/
west update# Build native_sim target
west build -d build_sim -b native_sim/native modules/mzee/zephyr/samples/
# Intall [Zigbee Home Automation (ZHA)](https://github.com/zigpy/zha) wrapper
# Setup and run ZHA cli to emulate a Zigbee coordinator
pip install modules/mzee/pymzee/
pymzee-cli
# Run devices
./build_sim/zephyr/zephyr.exe --flash=flash_device_1.bin -seed-random
# Run "devices" command in ZHA cli to validate devices connected properly
Devices:
01:23:45:67:89:ab:cd:ef - NWK: 0000 - Model: pymzee Coordinator
ab:cd:ef:00:74:ca:fe:50 - NWK: 4850 - Model: MARK0
EP 11: in=[0, 6, 3, 4] out=[]
ab:cd:ef:00:df:30:c6:c9 - NWK: 38c9 - Model: MARK0
EP 12: in=[0, 7, 3] out=[6, 3]
west build -d build_promicro -b promicro_nrf52840/nrf52840/uf2 modules/mzee/zephyr/samples/
cp build_promicro/zephyr/zephyr.uf2 /<path to UF2 partition>/NICENANO/
# Connect Zephyr shell via USB
screen -L /dev/ttyACM0 115200
# Initiate association to coordinator from Zephyr Shell
mzee> mzee associate
mzee> mzee dump
<inf> [shell_uart] mzee: mac: dump association valid=1
<inf> [shell_uart] mzee: -> pan_id: short=0x4590 ext=00:11:22:33:44:55:66:77 (channel=11)
<inf> [shell_uart] mzee: -> association: nwk=0x58c9 parent=0x0 parent_ieee=01:23:45:67:89:ab:cd:ef
If mZee helped you tame your Zigbee chaos, consider buying me a beer! 🍻
You can support development via Ko-fi:
Every sip fuels more Zigbee adventures! Thanks for your support!