Skip to content

Commit 8b86dac

Browse files
KampiDaniel Kampert
authored andcommitted
- Update CHANGELOG
- Update README - Add release or debug info to Zigbee FW version - Fixes from CodeRabbit - Simplify the cluster definitions and rename them Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
1 parent b75fc61 commit 8b86dac

36 files changed

+421
-404
lines changed

.github/workflows/firmware.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ env:
99
jobs:
1010
build:
1111
runs-on: ubuntu-24.04
12-
container: ghcr.io/zephyrproject-rtos/ci:latest
12+
container: ghcr.io/zephyrproject-rtos/ci:v0.27.4
1313
strategy:
1414
matrix:
1515
built_type: [debug, release]
1616
board: [beelight@1/nrf54l15/cpuapp]
17+
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v4
@@ -23,8 +24,6 @@ jobs:
2324

2425
- name: Dependencies
2526
run: |
26-
apt-get update && apt-get install -y lbzip2 build-essential cmake pkg-config libsdl2-dev || true
27-
apt-get install -f -y
2827
wget https://sourceforge.net/projects/astyle/files/astyle/astyle%203.4/astyle-3.4.10.tar.bz2/download -O astyle.tar.bz2
2928
tar -xf astyle.tar.bz2
3029
cd astyle-3.4.10
@@ -56,9 +55,11 @@ jobs:
5655
# It's output to GITHUB_ENV so it can be used in the next steps
5756
# and only needs to be calculated once.
5857
BUILD_DIR=${{ matrix.board }}_${{ matrix.built_type }}
59-
echo "BUILD_DIR=${BUILD_DIR}" | sed 's/\//_/g' >> "$GITHUB_ENV"
58+
echo "BUILD_DIR=${BUILD_DIR}" | sed 's/\//_/g' >> ""${GITHUB_ENV}""
6059
6160
- name: Build firmware
61+
env:
62+
BUILD_DIR: ${{ env.BUILD_DIR }}
6263
working-directory: BeeLight/firmware/app
6364
run: |
6465
set -e
@@ -68,7 +69,9 @@ jobs:
6869
if [ -z "$src_hex" ] && [ -f "${{ env.BUILD_DIR }}/zephyr/merged.hex" ]; then src_hex="${{ env.BUILD_DIR }}/zephyr/merged.hex"; fi
6970
if [ -n "$src_hex" ]; then cp "$src_hex" "fw_images/${{ matrix.built_type }}.hex"; else echo "merged.hex not found, skipping"; fi
7071
71-
- name : Upload Firmware
72+
- name: Upload Firmware
73+
env:
74+
BUILD_DIR: ${{ env.BUILD_DIR }}
7275
uses: actions/upload-artifact@v4.3.3
7376
with:
7477
name: ${{ env.BUILD_DIR }}

.github/workflows/pcb.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ jobs:
6262
last_tag="$(git describe --tags --abbrev=0 || echo "")"
6363
if [[ "${{ github.ref_type }}" == "tag" ]]; then
6464
echo "Overriding kibot_variant to 'RELEASED' for tag"
65-
echo "kibot_variant=RELEASED" >> $GITHUB_ENV
65+
echo "kibot_variant=RELEASED" >> "${GITHUB_ENV}"
6666
else
67-
echo "kibot_variant=${{ env.kibot_variant }}" >> $GITHUB_ENV
67+
echo "kibot_variant=${{ env.kibot_variant }}" >> "${GITHUB_ENV}"
6868
fi
6969
7070
- name: Download updated CHANGELOG
@@ -109,7 +109,7 @@ jobs:
109109
- name: Initialize
110110
run: |
111111
mkdir -p log
112-
echo "DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
112+
echo "DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> "${GITHUB_ENV}"
113113
114114
# Run these changelog update steps only on tag pushes
115115
- name: Pull latest changes for changelog update
@@ -125,7 +125,7 @@ jobs:
125125
shell: bash
126126
run: |
127127
git clone https://github.com/Kampi/KiCad.git kicad-library
128-
echo "KICAD_LIBRARY=$(pwd)/kicad-library" >> "$GITHUB_ENV"
128+
echo "KICAD_LIBRARY=$(pwd)/kicad-library" >> "${GITHUB_ENV}"
129129
pip install defusedxml --break-system-packages
130130
131131
- name: Extract release notes
@@ -163,10 +163,10 @@ jobs:
163163
if [[ "${{ github.ref_type }}" == "tag" ]]; then
164164
version_arg="-E REVISION='${last_tag}'"
165165
echo "Overriding kibot_variant to 'RELEASED' for tag"
166-
echo "kibot_variant=RELEASED" >> $GITHUB_ENV
166+
echo "kibot_variant=RELEASED" >> "${GITHUB_ENV}"
167167
else
168168
version_arg="-E REVISION='${last_tag} + (Unreleased)'"
169-
echo "kibot_variant=${{ env.kibot_variant }}" >> $GITHUB_ENV
169+
echo "kibot_variant=${{ env.kibot_variant }}" >> "${GITHUB_ENV}"
170170
fi
171171
172172
# Determine additional_args based on the variant
@@ -186,8 +186,8 @@ jobs:
186186
;;
187187
esac
188188
189-
echo "version_arg=${version_arg}" >> "$GITHUB_ENV"
190-
echo "additional_args=${additional_args}" >> "$GITHUB_ENV"
189+
echo "version_arg=${version_arg}" >> "${GITHUB_ENV}"
190+
echo "additional_args=${additional_args}" >> "${GITHUB_ENV}"
191191
192192
# Generate notes (skipped for DRAFT variant)
193193
- name: Generate notes
@@ -227,6 +227,16 @@ jobs:
227227
name: Log-${{ env.kibot_variant }}
228228
path: log
229229

230+
- name: Clean up
231+
shell: bash
232+
run: |
233+
rm -rf "${KICAD_LIBRARY}"
234+
find . -type f -iname \*.log -delete
235+
find . -type f -iname \*.ogv -delete
236+
find . -type f -iname \*.kicad_pro-bak -delete
237+
rm ${{ env.kibot_input_dir }}/kibot_*.kicad_pro
238+
rm ${{ env.kibot_input_dir }}/kibot_*.kicad_pcb
239+
230240
- name: Upload artifacts (results)
231241
uses: actions/upload-artifact@v4
232242
with:
@@ -241,16 +251,6 @@ jobs:
241251
name: CHANGELOG
242252
path: ${{ env.kibot_input_dir }}/CHANGELOG.md
243253

244-
- name: Clean up
245-
shell: bash
246-
run: |
247-
rm -rf "${KICAD_LIBRARY}"
248-
find . -type f -iname \*.log -delete
249-
find . -type f -iname \*.ogv -delete
250-
find . -type f -iname \*.kicad_pro-bak -delete
251-
rm ${{ env.kibot_input_dir }}/kibot_*.kicad_pro
252-
rm ${{ env.kibot_input_dir }}/kibot_*.kicad_pcb
253-
254254
- name: Pull latest changes
255255
shell: bash
256256
run: |
@@ -285,4 +285,4 @@ jobs:
285285
uses: stefanzweifel/git-auto-commit-action@v5
286286
with:
287287
branch: ${{ github.ref_name }}
288-
commit_message: Push outputs from CI/CD (${{ env.DATE }})
288+
commit_message: Push outputs from CI/CD (${{ github.event.head_commit.timestamp }})

.github/workflows/zigbee.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,31 @@ name: Zigbee-Config
33
on:
44
workflow_dispatch:
55

6+
env:
7+
root_dir: BeeLight
8+
69
jobs:
710
build:
811
runs-on: ubuntu-24.04
9-
container: debian:latest
12+
container: debian:12
1013

1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@v4
1417
with:
15-
path: BeeLight
18+
path: ${{ env.root_dir }}
1619

1720
- name: Dependencies
18-
working-directory: BeeLight/firmware/app
21+
working-directory: ${{ env.root_dir }}/firmware/app
1922
run: |
2023
apt-get update && apt-get install -y curl
2124
curl https://files.nordicsemi.com/artifactory/swtools/external/nrfutil/executables/x86_64-unknown-linux-gnu/nrfutil -o nrfutil
22-
23-
- name: Setup
24-
working-directory: BeeLight/firmware/app
25-
run: |
2625
mkdir -p zigbee
2726
chmod +x nrfutil
28-
./nrfutil self-upgrade
2927
./nrfutil install nrf5sdk-tools
3028
3129
- name: Generate
32-
working-directory: BeeLight/firmware/app
30+
working-directory: ${{ env.root_dir }}/firmware/app
3331
run: |
3432
./nrfutil nrf5sdk-tools zigbee production_config zigbee_config.yml zigbee/zigbee_config.hex --offset 0x17a000
3533
@@ -38,5 +36,5 @@ jobs:
3836
with:
3937
name: zigbee-config
4038
path: |
41-
BeeLight/firmware/app/zigbee
39+
${{ env.root_dir }}/firmware/app/zigbee
4240
if-no-files-found: ignore

README.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
- [Using the command line](#using-the-command-line)
1717
- [Housing](#housing)
1818
- [Zigbee](#zigbee)
19-
- [Standard cluster](#standard-cluster)
19+
- [Standard clusters](#standard-clusters)
2020
- [Custom cluster](#custom-cluster)
2121
- [Zigbee Dongle](#zigbee-dongle)
2222
- [Install the device to Zigbee2MQTT](#install-the-device-to-zigbee2mqtt)
2323
- [Directory structure](#directory-structure)
24-
- [Ressources](#ressources)
24+
- [Resources](#resources)
2525
- [Maintainer](#maintainer)
2626

2727
## About
2828

29-
Open-Source Zigbee-based light and environmental sensor with [Zigbee2MQTT](https://www.zigbee2mqtt.io/) support for your Home Automation with I. e. Home Assistant.
29+
Open-Source Zigbee-based light and environmental sensor with [Zigbee2MQTT](https://www.zigbee2mqtt.io/) support for your Home Automation (e.g., Home Assistant).
3030

31-
![Rendering](/docs/images/Rendering.png)
31+
![Rendering](docs/images/Rendering.png)
3232

3333
### Technical features
3434

@@ -43,11 +43,11 @@ Open-Source Zigbee-based light and environmental sensor with [Zigbee2MQTT](https
4343
- VOC equivalent
4444
- Light intensity
4545
- Battery voltage
46-
- Small housing (40x42 mm)
46+
- Small housing (40x42x20 mm)
4747
- Very basic electronic → Can be assembled by hand very easily
4848
- Zigbee2MQTT compatibility
4949

50-
![Block diagram](/docs/images/Block%20diagram.png)
50+
![Block diagram](docs/images/Block%20diagram.png)
5151

5252
## Before you start
5353

@@ -62,12 +62,6 @@ west init -l .
6262
west update
6363
```
6464

65-
Run the following commands to install the BSEC2 library:
66-
67-
```sh
68-
west update
69-
```
70-
7165
You also need [nrfutil](https://www.nordicsemi.com/Products/Development-tools/nRF-Util) and the `nrf5sdk-tools` to flash the production configuration to the sensor. First install `nrfutil` and then run the following command to install the SDK tools:
7266

7367
```sh
@@ -105,7 +99,7 @@ west build --build-dir build . --pristine --board beelight@1/nrf54l15/cpuapp --
10599
You also need a Zigbee network to test and integrate the device. I use [Zigbee2MQTT](https://www.zigbee2mqtt.io/) running on a Raspberry Pi which allows me to connect my Zigbee network with my Home Automation.
106100

107101
> **NOTE**
108-
> I do not support other Zigbee networks (like [ZHA](https://www.home-assistant.io/integrations/zha/)). The Zigbee standard allows you to connect the device with all other networks but I can´t deliver a functional integration for these networks. You have to do it on your own!
102+
> I do not support other Zigbee networks (like [ZHA](https://www.home-assistant.io/integrations/zha/)). The Zigbee standard allows you to connect the device with all other networks but I can't deliver a functional integration for these networks. You have to do it on your own!
109103
110104
#### Flash the firmware
111105

@@ -147,7 +141,7 @@ The housing is optimized for 3D printing and needs ~12 g of filament (PLA). You
147141

148142
The device uses different standard and custom cluster to report the data to the network.
149143

150-
#### Standard cluster
144+
#### Standard clusters
151145

152146
| Cluster | ID |
153147
| ------- | -- |
@@ -158,7 +152,7 @@ The device uses different standard and custom cluster to report the data to the
158152

159153
#### Custom cluster
160154

161-
The device uses two custom cluster to report `IAQ`, `VOC` and `CO2` to the network. Both clusters have three attributes for `value`, `min_value`, `max_value` and `tolerance`.
155+
The device uses three custom cluster to report `IAQ`, `VOC` and `CO2` to the network. Both clusters have three attributes for `value`, `min_value`, `max_value` and `tolerance`.
162156

163157
| Cluster | ID |
164158
| ------- | -- |
@@ -180,7 +174,7 @@ Make sure to use a Zigbee 3 compatible dongle like [SONOFF ZBDongle-E](https://s
180174
#### Install the device to Zigbee2MQTT
181175

182176
> **NOTE**
183-
> Because it's not possible to use custom cluster with Zigbee2MQTT easily, you must adjust the application directly to use the sensor. Please take a look into the directory `z2m/data/external_converters/example` if you want to check how the modified files look like.
177+
> Because it's not possible to use custom clusters with Zigbee2MQTT easily, you must adjust the application directly to use the sensor. Please take a look into the directory `z2m/data/external_converters/example` if you want to check how the modified files look like.
184178
185179
1. Download and install [Zigbee2MQTT](https://github.com/zigbee2mqtt/hassio-zigbee2mqtt)
186180
2. Copy the external converter from `z2m/data_external_converters` to the `data` directory of your `Zigbee2MQTT` installation
@@ -276,18 +270,18 @@ The device can now be connected to your Zigbee network and with this to your Hom
276270

277271
## Directory structure
278272

279-
- `3d-print`: All 3D print related files
273+
- `3d-print`: All 3D print.related files
280274
- `cad`: All relevant 3D models
281275
- `docs`: All kinds of project documentation like schematics, BOM, etc.
282276
- `drawings`: 2D drawings for subcomponents, etc.
283-
- `images`: All documentation related images
277+
- `images`: All documentation-relateBd images
284278
- `hardware`: KiCad project for the PCB
285279
- `firmware`: Zephyr project for the device firmware
286280
- `prebuilt`: Prebuilt binaries
287281
- `production`: Production files from the latest CI/CD run
288-
- `z2m`: Zigbee2MQTT related files
282+
- `z2m`: Zigbee2MQTT-related files
289283

290-
## Ressources
284+
## Resources
291285

292286
- [Adding new Zigbee2MQTT devices](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html)
293287
- [Zigbee Cluster Library Specification](https://zigbeealliance.org/wp-content/uploads/2019/12/07-5123-06-zigbee-cluster-library-specification.pdf)
@@ -298,4 +292,3 @@ The device can now be connected to your Zigbee network and with this to your Hom
298292
## Maintainer
299293

300294
- [Daniel Kampert](mailto:DanielKampert@kampis-elektroecke.de)
301-

docs/BeeLight.drawio

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<mxPoint y="-22" as="offset" />
3939
</mxGeometry>
4040
</mxCell>
41-
<mxCell id="nr2zP_MkdF4-R_Vxk9Jf-3" value="BME686" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
41+
<mxCell id="nr2zP_MkdF4-R_Vxk9Jf-3" value="BME688" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
4242
<mxGeometry x="133" y="320" width="107" height="30" as="geometry" />
4343
</mxCell>
4444
<mxCell id="nr2zP_MkdF4-R_Vxk9Jf-31" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.449;exitY=1.004;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitPerimeter=0;" parent="1" source="nr2zP_MkdF4-R_Vxk9Jf-6" target="nr2zP_MkdF4-R_Vxk9Jf-29" edge="1">
@@ -51,7 +51,7 @@
5151
<mxPoint x="-20" y="10" as="offset" />
5252
</mxGeometry>
5353
</mxCell>
54-
<mxCell id="nr2zP_MkdF4-R_Vxk9Jf-6" value="nRF54L" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
54+
<mxCell id="nr2zP_MkdF4-R_Vxk9Jf-6" value="nRF54L15" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
5555
<mxGeometry x="370" y="180" width="210" height="180" as="geometry" />
5656
</mxCell>
5757
<mxCell id="nr2zP_MkdF4-R_Vxk9Jf-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=-0.005;entryY=0.861;entryDx=0;entryDy=0;entryPerimeter=0;startArrow=classic;startFill=1;" parent="1" source="nr2zP_MkdF4-R_Vxk9Jf-3" target="nr2zP_MkdF4-R_Vxk9Jf-6" edge="1">

docs/images/Rendering.png

-20.4 KB
Loading

firmware/.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

firmware/app/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**Changed:**
66

7-
- Switch to nRF SDK v3 and NCS v3
7+
- Switch to nRF SDK Connect SDK (NCS) v3
88
- Switch to ZBOSS R23
99

1010
**Added:**
@@ -14,7 +14,7 @@
1414
- Add blocklist to west manifest
1515
- Add groupfilters to west manifest
1616
- Add west command to build and flash the device configuration
17-
- Add custom cluster for VOC, IAQ and CO2 for Zigbee2Mqtt
17+
- Add custom cluster for VOC, IAQ and CO2 for Zigbee2MQTT
1818
- Add patches for custom cluster for ncs-zigbee
1919

2020
## [1.0] - 12.01.2024

firmware/app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ add_subdirectory(src/events)
2424
add_subdirectory(src/sensors)
2525

2626
include_directories(src)
27+
include_directories(src/events)
2728

2829
target_sources(app PRIVATE
2930
src/main.c

firmware/app/boards/kampi/beelight/beelight_nrf54l15_cpuapp_1.overlay

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,23 @@
3434
full-ohms = <(8200 + 2200)>;
3535
power-gpios = <&gpio2 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
3636
};
37+
38+
gpio_i2c0: gpio_i2c {
39+
status = "okay";
40+
compatible = "gpio-i2c";
41+
clock-frequency = <I2C_BITRATE_FAST>;
42+
sda-gpios = <&gpio2 6 GPIO_OPEN_DRAIN>;
43+
scl-gpios = <&gpio0 3 GPIO_OPEN_DRAIN>;
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
};
3747
};
3848

3949
&i2c20 {
40-
status = "okay";
41-
compatible = "nordic,nrf-twim";
42-
clock-frequency = <I2C_BITRATE_FAST>;
43-
pinctrl-0 = <&i2c_default>;
44-
pinctrl-1 = <&i2c_sleep>;
45-
pinctrl-names = "default", "sleep";
50+
status = "disabled";
51+
};
4652

53+
&gpio_i2c0 {
4754
apds9306: apds9306@52 {
4855
status = "okay";
4956
compatible = "avago,apds9306";
@@ -58,4 +65,4 @@
5865
compatible = "bosch,bme680";
5966
reg = <0x76>;
6067
};
61-
};
68+
};

0 commit comments

Comments
 (0)