@@ -17,15 +17,40 @@ open source [Matter/Project CHIP repository][project-chip].
17
17
The project offers a IPython based REPL for testing/exploring. The REPL is also
18
18
available as [ Python CHIP Controller REPL Add-on] [ chip-controller-repl-add-on ] .
19
19
20
- ### Run from the source tree
20
+ ### Prepare venv for the Matter Server
21
+
22
+ This Python Matter Server needs the CHIP Controller Python libraries. The CHIP
23
+ Controller Python libraries come with the complete Matter SDK (CHIP stack)
24
+ as a native C++ library. The CHIP Controller Python is not available on pip,
25
+ and, because it comes with a native C++ library, is a platform dependent
26
+ library. The Matter SDK allows to build a Python wheel for your platform.
27
+
28
+ To build the Python CHIP Controller follow the building instructions available
29
+ at [ docs/guides/python_chip_controller_building.md] [ python-chip-building ] .
30
+
31
+ Note the essential command is ` scripts/build_python.sh -m platform -i separate ` .
32
+ It builds the library in ` out/python_lib/ ` , and creates a venv for you in
33
+ ` out/python_env/ ` . If you update the Matter SDK git repository, make sure to
34
+ run this command again to rebuild the library.
35
+
36
+ If you already compiled the CHIP Controller Python libraries previously, you
37
+ can activate the Python virtual environment using:
21
38
22
- The Server needs to be run in a Python environment where the Python CHIP
23
- Controller is installed. E.g.
24
39
25
40
```
26
41
source ../connectedhomeip/out/python_env/bin/activate
27
42
```
28
43
44
+ Note: There is a bug with Apple M1 based systems: Pigweed currently uses Python
45
+ x86-64 via Rosetta. That causes problems when trying to build the Python
46
+ CHIP Controller. There are work arounds documented in [ GitHub issue #19134 ] ( https://github.com/project-chip/connectedhomeip/issues/19134 ) .
47
+ Make sure to not use ` -i separate ` and setup the venv separately as well.
48
+
49
+ ### Run from the source tree
50
+
51
+ The Server needs to be run in a Python environment where the Python CHIP
52
+ Controller is installed. E.g.
53
+
29
54
Also make sure that the default storage location is present:
30
55
```
31
56
mkdir $HOME/.chip-storage/
@@ -37,7 +62,9 @@ With the following command the server can be run directly from the source tree.
37
62
python3 -m matter_server.server
38
63
```
39
64
40
- _ On MacOs you will have to run above command with 'sudo' as it requires to interact with BLE._
65
+ _ On macOS you will have to run above command with 'sudo' as it requires to interact with BLE._
66
+
67
+ _ On Linux, make sure Bluetooth (bluez) is active and enabled before starting onboarding._
41
68
42
69
The client does not need to be run in the Python CHIP Controller environment. It
43
70
can be run from the source tree using:
@@ -48,9 +75,7 @@ python3 -m matter_server.client
48
75
49
76
### Build and install
50
77
51
- To build the Python CHIP Controller follow the building instructions available
52
- at [ docs/guides/python_chip_controller_building.md] [ python-chip-building ] .
53
- Once you have a working Python CHIP Controller Python environment, switch
78
+ nce you have a working Python CHIP Controller Python environment, switch
54
79
to this repository and install this project as follows:
55
80
56
81
``` shell
0 commit comments