Skip to content

Commit 322a98e

Browse files
committed
Improve developer documentation in README.md
1 parent 09b2b00 commit 322a98e

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

README.md

+32-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,40 @@ open source [Matter/Project CHIP repository][project-chip].
1717
The project offers a IPython based REPL for testing/exploring. The REPL is also
1818
available as [Python CHIP Controller REPL Add-on][chip-controller-repl-add-on].
1919

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:
2138

22-
The Server needs to be run in a Python environment where the Python CHIP
23-
Controller is installed. E.g.
2439

2540
```
2641
source ../connectedhomeip/out/python_env/bin/activate
2742
```
2843

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+
2954
Also make sure that the default storage location is present:
3055
```
3156
mkdir $HOME/.chip-storage/
@@ -37,7 +62,9 @@ With the following command the server can be run directly from the source tree.
3762
python3 -m matter_server.server
3863
```
3964

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._
4168

4269
The client does not need to be run in the Python CHIP Controller environment. It
4370
can be run from the source tree using:
@@ -48,9 +75,7 @@ python3 -m matter_server.client
4875

4976
### Build and install
5077

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
5479
to this repository and install this project as follows:
5580

5681
```shell

0 commit comments

Comments
 (0)