Skip to content

Commit f4c80cc

Browse files
committed
Update readme with more instructions
1 parent 1eaf675 commit f4c80cc

13 files changed

+39
-184
lines changed

README.md

+38-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mkdir $HOME/.chip-storage/
3434
With the following command the server can be run directly from the source tree.
3535

3636
```
37-
python3 -m chip_ws_server.__main__
37+
python3 -m chip_ws_server
3838
```
3939

4040
To test device communication or to commission devices the provided Python CHIP
@@ -54,7 +54,7 @@ The client does not need to be run in the Python CHIP Controller environment. It
5454
can be run from the source tree using:
5555

5656
```
57-
python3 -m chip_ws_server.__main__
57+
python3 -m chip_ws_server
5858
```
5959

6060
### Build and install
@@ -68,6 +68,42 @@ to this repository and install this project as follows:
6868
pip install .
6969
```
7070

71+
### Creating a test device
72+
73+
Instruction on how to create a test device can be found [here](https://nabucasa.github.io/matter-example-apps/).
74+
75+
### Commissioning a test device
76+
77+
Currently the easiest way to set up a test device is using the Python CHIP REPL. Start it by pointing it at the same storage location as the servier will run off:
78+
79+
```
80+
sudo chip-repl --storagepath=$HOME/.chip-storage/python-kv.json
81+
```
82+
83+
Inside the Python REPL, configure your Wi-Fi credentials:
84+
85+
```python
86+
devCtrl.SetWiFiCredentials("SSID", "PW")
87+
```
88+
89+
Once done, paste the following code to commission the device:
90+
91+
```python
92+
from chip.setup_payload import SetupPayload
93+
setupPayload = SetupPayload().ParseQrCode("MT:Y.K9042C00KA0648G00")
94+
import ctypes
95+
longDiscriminator = ctypes.c_uint16(int(setupPayload.attributes['Discriminator']))
96+
pincode = ctypes.c_uint32(int(setupPayload.attributes['SetUpPINCode']))
97+
98+
devCtrl.ConnectBLE(longDiscriminator, pincode, 4335)
99+
```
100+
101+
If you have installed the lighting app, send the following command to test if it works:
102+
103+
```python
104+
await devCtrl.SendCommand(4335, 1, Clusters.OnOff.Commands.Toggle())
105+
```
106+
71107
[project-chip]: https://github.com/project-chip/connectedhomeip
72108
[chip-controller-repl-add-on]: https://github.com/home-assistant/addons-development/tree/master/chip_controller_repl
73109
[python-chip-building]: https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/python_chip_controller_building.md

chip_ws_client/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def toggle_happiness(client: Client, is_initialized: asyncio.Event):
4141
try:
4242
await is_initialized.wait()
4343

44-
nodeid = 4336
44+
nodeid = 4335
4545

4646
# This (now) throws exceptions if it fails
4747
await client.driver.device_controller.ResolveNode(nodeid)

index.html

-147
This file was deleted.
-19.3 KB
Binary file not shown.
Binary file not shown.

light-switch-app-example/esp32-c3/manifest.json

-16
This file was deleted.

light-switch-app-example/esp32-c3/ota_data_initial.bin

-1
This file was deleted.
Binary file not shown.
-19.3 KB
Binary file not shown.
Binary file not shown.

lighting-app-example/esp32-c3/manifest.json

-16
This file was deleted.

0 commit comments

Comments
 (0)