blob: 8e34e59dea5847e6dff03abbdc9dfe6878495b33 [file] [log] [blame] [view]
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +01001# Python-based lighting example (bridge) device to DALI
Markus Beckereddf2b42021-12-02 08:16:46 +01002
3## Installation
4
5Build the Python/C library:
6
7```shell
8cd ~/connectedhomeip/
9git submodule update --init
10source scripts/activate.sh
11
12./scripts/build_python_device.sh --chip_detail_logging true
13
14sudo su # dhclient is called, needs root
15source ./out/python_env/bin/activate
16```
17
18Install the python dependencies:
19
20```shell
21pip3 install python-dali
22```
23
24Plug-in a python-dali compatible USB-DALI interface.
25
26## Usage
27
28Run the Python lighting matter device:
29
30```shell
31cd examples/lighting-app/python
32python lighting.py
33```
34
35Control the Python lighting matter device:
36
37```shell
38source ./out/python_env/bin/activate
39
40chip-device-ctrl
41
42chip-device-ctrl > connect -ble 3840 20202021 12344321
Song GUO5d19a9872021-12-14 04:16:13 +080043chip-device-ctrl > zcl NetworkCommissioning AddOrUpdateWiFiNetwork 12344321 0 0 ssid=str:YOUR_SSID credentials=str:YOUR_PASSWORD breadcrumb=0
44chip-device-ctrl > zcl NetworkCommissioning ConnectNetwork 12344321 0 0 networkID=str:YOUR_SSID breadcrumb=0
Markus Beckereddf2b42021-12-02 08:16:46 +010045chip-device-ctrl > close-ble
46chip-device-ctrl > resolve 5544332211 1 (pass appropriate fabric ID and node ID, you can get this from get-fabricid)
47chip-device-ctrl > zcl OnOff Toggle 12344321 1 0
48```