blob: 4b4ceed7bc1f00715d723612e9a90cca87deb0bd [file] [log] [blame] [view]
Gaute Svanes Lundee7347ea2023-01-09 19:43:07 +01001---
2orphan: true
3---
4
rgoliver7f860ce2021-07-21 00:33:36 -04005# CHIP RPC CONSOLE
6
7This python application provides a console for interacting with rpc-enabled chip
8devices.
9
10The console uses the [pigweed pw_console](https://pigweed.dev/pw_console/), but
11with customizations to work better with CHIP, including containing all rpc proto
12files required for CHIP.
13
14- [CHIP RPC CONSOLE](#chip-rpc-console)
15 - [Building](#building)
16 - [Running](#running)
17
18---
19
20## Building
21
cpagravelba1b65d2022-06-10 06:47:40 -070022If this is the first time using the checkout the environment must first be
23bootstrapped to install all dependencies.
rgoliver7f860ce2021-07-21 00:33:36 -040024
cpagravelba1b65d2022-06-10 06:47:40 -070025```
26$ source <project_root>/scripts/bootstrap.sh
27```
rgoliver7f860ce2021-07-21 00:33:36 -040028
cpagravelba1b65d2022-06-10 06:47:40 -070029If bootstrap has previously been run, then simply activate.
rgoliver7f860ce2021-07-21 00:33:36 -040030
cpagravelba1b65d2022-06-10 06:47:40 -070031```
32$ source <project_root>/scripts/activate.sh
33```
rgoliver7f860ce2021-07-21 00:33:36 -040034
cpagravelba1b65d2022-06-10 06:47:40 -070035The python console is built and installed in the venv using gn:
rgoliver7f860ce2021-07-21 00:33:36 -040036
cpagravelba1b65d2022-06-10 06:47:40 -070037```
38$ cd <project_root>/examples/common/pigweed/rpc_console
39$ gn gen out/debug
40$ ninja -C out/debug
41```
rgoliver7f860ce2021-07-21 00:33:36 -040042
cpagravelba1b65d2022-06-10 06:47:40 -070043After building the output directory also contains a folder
44(chip_rpc_console_wheels), with all the wheels required for the tool. These can
45be used to install the console without needing the sdk. Simply install all the
46wheels in the folder:
Andrei Litvina76f75e2022-04-13 08:34:42 -100047
cpagravelba1b65d2022-06-10 06:47:40 -070048```
49$ cd <project_root>/examples/common/pigweed/rpc_console/out/debug
50$ pip install chip_rpc_console_wheels/*.whl
51```
rgoliver7f860ce2021-07-21 00:33:36 -040052
53## Running
54
55To start the console provide the path to the device, for example:
56
cpagravelba1b65d2022-06-10 06:47:40 -070057```
58$ chip-console --device /dev/ttyUSB0
59```
rgoliver7f860ce2021-07-21 00:33:36 -040060
cpagravel913aca02022-04-04 17:53:15 -070061Note that `chip-console` is an entry point for chip_rpc.console and could also
62be run with `python -m chip_rpc.console`.
63
rgoliver7f860ce2021-07-21 00:33:36 -040064An example RPC command:
65
cpagravelba1b65d2022-06-10 06:47:40 -070066```python
67rpcs.chip.rpc.Device.GetDeviceInfo()
68```