| # This is a pw_console config file that defines a default window layout. |
| # For more info on what can be added to this file see: |
| # https://pigweed.dev/pw_console/py/pw_console/docs/user_guide.html#configuration |
| config_title: pw_console |
| |
| # Window layout |
| windows: |
| # Left split with tabbed views. |
| Split 1 tabbed: |
| Python Repl: |
| hidden: False |
| # Right split with stacked views. |
| Split 2 stacked: |
| Device Logs: |
| hidden: False |
| Host Logs: |
| hidden: False |
| Pubsub Events: |
| loggers: |
| device.pubsub_events: |
| level: DEBUG |
| hidden: False |
| |
| window_column_split_method: vertical |
| # window_column_split_method: horizontal |
| |
| # Default colors: |
| ui_theme: dark |
| code_theme: pigweed-code |
| swap_light_and_dark: False |
| |
| # A few other choices: |
| # ui_theme: high-contrast-dark |
| # ui_theme: nord |
| # ui_theme: synthwave84 |
| # code_theme: gruvbox-dark |
| # code_theme: pigweed-code-light |
| # code_theme: synthwave84 |
| |
| # Log display options: |
| spaces_between_columns: 2 |
| hide_date_from_log_time: True |
| recolor_log_lines_to_match_level: False |
| |
| column_order: |
| # Column name |
| - time |
| - level |
| - timestamp |
| - module |
| # Hidden: |
| # - source_name |
| |
| column_order_omit_unspecified_columns: True |
| |
| snippets: |
| Echo RPC: |
| code: | |
| device.rpcs.pw.rpc.EchoService.Echo(msg='hello world') |
| description: | |
| Send a string to the device and receive a response with the same |
| message back. |
| |
| >>> device.rpcs.pw.rpc.EchoService.Echo(msg='hello world') |
| (Status.OK, pw.rpc.EchoMessage(msg='hello world')) |
| |
| Reboot to bootloader: |
| code: | |
| device.rpcs.board.Board.Reboot(reboot_type=1) |
| description: | |
| Sent a reboot request to the device. The console must be |
| relaunched to reconnect. |
| |
| Get onboard temp sensor value: |
| code: | |
| device.rpcs.board.Board.OnboardTemp() |
| description: | |
| Get the current value of the onboard temperature sensor. |
| |
| ```pycon |
| >>> device.rpcs.board.Board.OnboardTemp() |
| (Status.OK, board.OnboardTempResponse(temp=24.797744750976562)) |
| ``` |
| |
| Log onboard temp sensor values every 1000ms: |
| code: | |
| call = device.rpcs.board.Board.OnboardTempStream.invoke( |
| request_args=dict(sample_interval_ms=1000), |
| on_next=lambda _, message: LOG.info(message) |
| ) |
| description: | |
| Start logging with: |
| |
| ```pycon |
| >>> call = device.rpcs.board.Board.OnboardTempStream.invoke(request_args=dict(sample_interval_ms=1000), on_next=lambda _, message: LOG.info(message)) |
| ``` |
| |
| Log messages will appear in the 'Host Logs' window. |
| To stop the streaming RPC run `call.cancel()`: |
| |
| ```pycon |
| >>> call.cancel() |
| True |
| ``` |