@@ -103,6 +103,8 @@ To build and run the Python CHIP controller:
103103 chip-repl
104104 ```
105105
106+ NOTE: To get more verbose logs, pass the debug flag: `chip-repl --debug`
107+
106108<hr>
107109
108110## Using Python CHIP Controller REPL for Matter accessory testing
@@ -133,8 +135,8 @@ An uncommissioned accessory device advertises over Bluetooth LE or via mDNS if
133135already on the network. Run the following command to scan all advertised Matter
134136devices:
135137
136- ```
137- devCtrl.DiscoverCommissionableNodes()
138+ ```python
139+ await devCtrl.DiscoverCommissionableNodes()
138140```
139141
140142### Step 4: Set network pairing credentials
@@ -173,7 +175,7 @@ network interface, such as Thread or Wi-Fi.
1731752. Set the previously obtained Active Operational Dataset as a byte array using
174176 the following command:
175177
176- ```
178+ ```python
177179 thread_dataset = bytes.fromhex("0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8")
178180 devCtrl.SetThreadOperationalDataset(thread_dataset)
179181 ```
@@ -183,7 +185,7 @@ network interface, such as Thread or Wi-Fi.
183185Assuming your Wi-Fi SSID is _TESTSSID_, and your Wi-Fi password is _P455W4RD_,
184186set the credentials to the controller by executing the following command:
185187
186- ```
188+ ```python
187189devCtrl.SetWiFiCredentials(<ssid>, <password>)
188190```
189191
@@ -213,8 +215,8 @@ with the following assumptions for the Matter accessory device:
213215- The setup pin code of the device is _ 20202021_
214216- The temporary Node ID is _ 1234_
215217
216- ```
217- devCtrl.ConnectBLE(3840, 20202021, 1234)
218+ ``` python
219+ await devCtrl.ConnectBLE(3840 , 20202021 , 1234 )
218220```
219221
220222You can skip the last parameter, the Node ID, in the command. If you skip it,
@@ -230,8 +232,8 @@ CHIP:SVR: SetupQRCode: [MT:-24J0AFN00KA0648G00]
230232
231233Use the following command to commission the device with the QR code:
232234
233- ```
234- devCtrl.CommissionWithCode("MT:-24J0AFN00KA0648G00", 1234)
235+ ``` python
236+ await devCtrl.CommissionWithCode(" MT:-24J0AFN00KA0648G00" , 1234 )
235237```
236238
237239After connecting the device over Bluetooth LE, the controller will go through
@@ -262,14 +264,14 @@ the following stages:
262264For the light bulb example, execute the following command to toggle the LED
263265state:
264266
265- ```
267+ ``` python
266268await devCtrl.SendCommand(1234 , 1 , Clusters.OnOff.Commands.Toggle())
267269```
268270
269271To change the brightness of the LED, use the following command, with the level
270272value somewhere between 0 and 255.
271273
272- ```
274+ ``` python
273275commandToSend = LevelControl.Commands.MoveToLevel(level = 50 , transitionTime = Null, optionsMask = 0 , optionsOverride = 0 )
274276await devCtrl.SendCommand(1234 , 1 , commandToSend)
275277```
@@ -281,7 +283,7 @@ maintains collection of attributes that a controller can obtain from a device,
281283such as the vendor name, the product name, or software version. Use
282284` ReadAttribute() ` command to read those values from the device:
283285
284- ```
286+ ``` python
285287attributes = [
286288 (0 , Clusters.BasicInformation.Attributes.VendorName),
287289 (0 , Clusters.BasicInformation.Attributes.ProductName),
@@ -309,7 +311,7 @@ the full list of available commands.
309311Provides the controller with Thread network credentials that will be used in the
310312device commissioning procedure to configure the device with a Thread interface.
311313
312- ```
314+ ``` python
313315thread_dataset = bytes .fromhex(" 0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8" )
314316devCtrl.SetThreadOperationalDataset(thread_dataset)
315317```
@@ -319,7 +321,7 @@ devCtrl.SetThreadOperationalDataset(thread_dataset)
319321Provides the controller with Wi-Fi network credentials that will be used in the
320322device commissioning procedure to configure the device with a Wi-Fi interface.
321323
322- ```
324+ ``` python
323325devCtrl.SetWiFiCredentials(' TESTSSID' , ' P455W4RD' )
324326```
325327
@@ -328,8 +330,8 @@ devCtrl.SetWiFiCredentials('TESTSSID', 'P455W4RD')
328330Commission with the given nodeid from the setupPayload. setupPayload may be a QR
329331or the manual setup code.
330332
331- ```
332- devCtrl.CommissionWithCode("MT:-24J0AFN00KA0648G00", 1234)
333+ ``` python
334+ await devCtrl.CommissionWithCode(" MT:-24J0AFN00KA0648G00" , 1234 )
333335```
334336
335337### ` SendCommand(<nodeid>: int, <endpoint>: int, Clusters.<cluster>.Commands.<command>(<arguments>)) `
0 commit comments