Skip to content

Commit

Permalink
Pull request #59: V0.3.0 doc updates
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from v0.3.0_doc_updates to silabs

Squashed commit of the following:

commit d51fe5832aad2e40f6755491fff1b5275bd10d29
Author: Ezra Hale <[email protected]>
Date:   Fri Sep 2 09:33:58 2022 -0400

    did a clean pass through the doc to make command line notation consistent and some other changes

commit 202605849b82dd5982a3031d2792cf1de21a6b04
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 15:20:12 2022 -0400

    fixed all references to wifi which should be Wi-Fi for consistency and correctness

commit 1c67f5512f4fff4a6016e72ca9e8efcef1399eb4
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 14:58:58 2022 -0400

    removed duplication of pre-req documentation in favor of HARDWARE_REQUIREMENTS.md and SOFTWARE_REQUIREMENTS.md

commit e718c90368ff1f1f55c818affa4eec6bf8d1c8db
Author: Curtis Rahman <[email protected]>
Date:   Thu Sep 1 14:25:55 2022 -0400

    Added git instructions to Software Reqs

commit 563524bbab46e1f91a103e0f75920371974b7329
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 14:22:16 2022 -0400

    cleaning up references to software and hardware requriements

commit 0ccc40e8f50880b92d19c1f90bc0553b5e50d910
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 13:48:26 2022 -0400

    langugage for hardware and software requirements note

commit d3c195366cd40c0802ab4f52e34fec3070e05bc9
Author: Curtis Rahman <[email protected]>
Date:   Thu Sep 1 13:40:12 2022 -0400

    Added 'Software Requirements' main page

commit d8b5b4e0ecf6ffd7dcc93375a7cf947e67d4359b
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 13:36:20 2022 -0400

    adding a central location for hardware requirements

commit 497410247ebb83a694747de05cee0c6da144d3ef
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 09:57:31 2022 -0400

    added prereqs from the BUILDING.md page to this

commit 5404e7b70120e84954d775a3111cac791919a982
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 08:53:42 2022 -0400

    adding --recursive flag back into usage of update script

commit bb8c4823be7f88b867b323901a1aeed61785d5c8
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 08:38:12 2022 -0400

    comment from Rehan, added link to CUSTOM_MATTER_DEVICE.md

commit 6689bb9897a81222863d3f54aff4261ec044c830
Author: Ezra Hale <[email protected]>
Date:   Thu Sep 1 08:25:53 2022 -0400

    updates from Rehan's comments on the PR

commit 14831e91967252e58985238538165c5eccfd1137
Author: Ezra Hale <[email protected]>
Date:   Wed Aug 31 13:47:39 2022 -0400

    updated naming for wifi build end device so it is consistent with Thread and less confusing

commit 1e5da86864b815dc92bc0c8be4bfb22b7333c885
Author: Ezra Hale <[email protected]>
Date:   Wed Aug 31 12:02:11 2022 -0400

    adding more doc on WIRESHARK.md

commit 897c34befd894070001cd69ac2900c363b11aa93
Author: Curtis Rahman <[email protected]>
Date:   Wed Aug 31 11:45:51 2022 -0400

    Added Mac OS (silicon) steps to software reqs/VS code env setup

commit 194e85b311e7ee0f4f1f2d73bd6807a02150a5d5
Author: Ezra Hale <[email protected]>
Date:   Wed Aug 31 11:32:30 2022 -0400

    adding first pass at WIRESHARK documentation

commit b49cecf022abb4a520537e53aea52b731cd0f8b9
Author: Ezra Hale <[email protected]>
Date:   Wed Aug 31 10:14:46 2022 -0400

    added pointer to credentials example README.md from ToC

commit 91ad980b9f0789195d9a51a3fec865554295458f
Author: Ezra Hale <[email protected]>
Date:   Wed Aug 31 10:05:15 2022 -0400

    fixed typo in ATTESTATION_CRED.md

commit 9e228633dbf09ac84473086bb82e68c2c6f10066
Author: Ezra Hale <[email protected]>
Date:   Tue Aug 30 13:46:41 2022 -0400

    added doc for Energy Profiler

commit c8b9ae004791c9abf4bd3a868074b9619fee22fb
Author: Ezra Hale <[email protected]>
Date:   Tue Aug 30 13:26:45 2022 -0400

    added bottom nav

... and 14 more commits
  • Loading branch information
Ezra Hale authored and jmartinez-silabs committed Oct 26, 2022
1 parent 651d8a8 commit 48576d4
Show file tree
Hide file tree
Showing 28 changed files with 1,183 additions and 632 deletions.
78 changes: 40 additions & 38 deletions docs/silabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,62 @@

1. [Silicon Labs Matter Overview](OVERVIEW.md) <br>

2. [Matter over Thread \(15.4\)](thread/THREAD.md)
2. Matter Pre-requisites

1. [Matter Hardware Requirements](general/HARDWARE_REQUIREMENTS.md)
2. [Matter Software Requirements](general/SOFTWARE_REQUIREMENTS.md) <br><br>

3. [Matter over Thread \(15.4\)](thread/THREAD.md)

1. [Matter Thread Demo Overview](thread/DEMO_OVERVIEW.md)
2. [Matter Thread Demo Prerequisites](thread/THREAD_PREREQS.md)
3. [Loading the Raspberry Pi image onto the Matter Hub](thread/RASPI_IMG.md)
4. [Setting up the RCP](thread/RCP.md)
5. [Creating your first Matter Device](thread/BUILD_FLASH_MAD.md)
6. [Using the Chip-Tool](thread/CHIP_TOOL.md)<BR> <BR>

3. [Matter over Wifi](wifi/WIFI.md)

1. [Matter Wifi Demo Overview](wifi/DEMO_OVERVIEW.md)
2. [Matter Wifi Demo Prerequisites](wifi/WIFI_PREREQS.md)
3. [Building Linux Environment](wifi/BUILD_CHIP_ENV.md)
4. [Building Raspberry Pi Environment](wifi/BUILD_PI_ENV.md)
5. [Software Setup](wifi/SW_SETUP.md)
6. [Running Matter Demo over Wifi using Linux](wifi/RUN_DEMO.md)
7. [optional]
[Running Matter Demo over Wifi using Android](wifi/WIFI_ANDROID.md)
2. [Loading the Raspberry Pi image onto the Matter Hub](thread/RASPI_IMG.md)
3. [Setting up the RCP](thread/RCP.md)
4. [Creating a Thread Matter End Device](thread/BUILD_FLASH_MAD.md)
5. [Using the Chip-Tool](thread/CHIP_TOOL.md)<BR> <BR>

4. [Matter over Wi-Fi](wifi/WIFI.md)

1. [Matter Wi-Fi Demo Overview](wifi/DEMO_OVERVIEW.md)
2. [Building A Matter Wi-Fi End Device](wifi/BUILD_CHIP_ENV.md)
3. [Running Matter Demo over Wi-Fi](wifi/RUN_DEMO.md)
4. [optional]
[Running Matter Demo over Wi-Fi using Android](wifi/WIFI_ANDROID.md)
<br><br>

4. Development using VS Code
5. Development using VS Code

1. [Setting up environment](dev/vscode/SETUP.md)
2. [Running tasks](dev/vscode/TASKS.md)
1. [Build](dev/vscode/BUILD.md)
2. [Flash](dev/vscode/FLASH.md)
3. [Debug](dev/vscode/DEBUG.md)
<!-- TODO: [Logs](dev/vscode/LOGS.md) --> <br><br>

5. Reference Guides

1. [How to Flash a Silicon Labs Device](general/FLASH_SILABS_DEVICE.md)
2. [How to Find Your Raspberry Pi](general/FIND_RASPI.md)
3. [Silicon Labs Matter Commit Hashes](general/COMMIT_HASHES.md)
4. [OTA Software Update](general/OTA_SOFTWARE_UPDATE.md) <br><br>

6. Frequently Asked Questions (FAQ) / Troubleshooting
3. [Debug](dev/vscode/DEBUG.md) <br><br>

6. Reference Guides

1. [Matter Hardware Requirements](general/HARDWARE_REQUIREMENTS.md)
2. [Matter Software Requirements](general/SOFTWARE_REQUIREMENTS.md)
3. [Matter Artifacts Page](general/ARTIFACTS.md)
4. [Matter Commit Hashes](general/COMMIT_HASHES.md)
5. [How to Flash a Silicon Labs Device](general/FLASH_SILABS_DEVICE.md)
6. [How to Find Your Raspberry Pi](general/FIND_RASPI.md)
7. [Silicon Labs Matter Commit Hashes](general/COMMIT_HASHES.md)
8. [Building a Custom Matter Device](general/CUSTOM_MATTER_DEVICE.md)
9. [Matter OTA Software Update](general/OTA_SOFTWARE_UPDATE.md)
10. [Matter Attestation Credentials for EFR32](../../silabs_examples/credentials/README.md)
11. [Using Simplicity Studio's Pin Tool and Project Configurator with Matter](./general/PINTOOL.m)
12. [Using Simplicity Studio's BLE GATT Configurator with Matter](./general/GATT.md)
13. [Using Simplicity Studio's Energy Profiler with Matter](./general/EP.md)
14. [Using Wireshark to Capture Network Traffic in Matter](./general/WIRESHARK.md)<br><br>

7. Frequently Asked Questions (FAQ) / Troubleshooting

- [Thread FAQ](thread/FAQ.md)
- [Wifi FAQ](wifi/FAQ.md)
- [Wi-Fi FAQ](wifi/FAQ.md)

<!--
(WIP)
Configure
ZAP (Standalone) (1 task)
Pin Tool (Studio) (1 task)
BLE Configurator (Studio) (1 task)
Build Arguments (Sleepy End Device) (1 task)
Monitor Network (Wireshark, Studio) (1 task)
Bootloader (Studio) (1 task)
Energy Profiler (Studio) (1 task)
Studio Integration
Metadata for Matter SDK
Misc
Non Raspi based controllers
-->
63 changes: 56 additions & 7 deletions docs/silabs/dev/vscode/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,79 @@
1. Install Visual Studio Code for your operating system of choice here:
https://code.visualstudio.com/Download
2. Install [Git](https://git-scm.com/) if you haven't already
3. *Windows Only* Enable git to use LF instead of CLRF by default: `git config
--global core.autocrlf false`
3. _Windows Only_ Enable git to use LF instead of CLRF by default:
`git config --global core.autocrlf false`
4. Git clone the Silicon Labs Matter repository here:
https://github.com/SiliconLabs/matter
5. Launch Visual Studio Code, and open the cloned folder
6. When prompted to "install recommended extensions" please select "Install"
* Recommended Extensions can be found [here](../../../../.vscode/extensions.json)
- Recommended Extensions can be found
[here](../../../../.vscode/extensions.json)
7. Ensure the following extensions are installed:
1. C/C++ Extension Pack - language support for C/C++
2. Python - language support for Python
3. Cortex-Debug - GDB debugger support
1. C/C++ Extension Pack - language support for C/C++
2. Python - language support for Python
3. Cortex-Debug - GDB debugger support
8. ARM GCC Toolchain
(https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads) -
required arm-none-eabi tools
9. J-Link Software Tools - required J-Link GDB Server for J-Link based debuggers
(https://www.segger.com/downloads/jlink)
10. Python - (https://www.python.org/downloads/)

### Installing prerequisites on macOS

On macOS, first install Xcode from the Mac App Store. The remaining dependencies
can be installed and satisfied using [Brew](https://brew.sh/):

> `$ brew install openssl pkg-config`
However, that does not expose the package to `pkg-config`. To fix that, one
needs to run something like the following:

Intel:

> `$ cd /usr/local/lib/pkgconfig ln -s ../../Cellar/[email protected]/1.1.1g/lib/pkgconfig/* .`
where `[email protected]/1.1.1g` may need to be replaced with the actual version of
OpenSSL installed by Brew.

Apple Silicon:

> `$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"/opt/homebrew/opt/openssl@3/lib/pkgconfig"`
Note: If using MacPorts, `port install openssl` is sufficient to satisfy this
dependency.

### Mac OS (Apple Silicon) Users

These requirements are are needed for Mac OS (Apple Silicon) in addition to
those mentioned above. <br>

1. Add ARM GCC toolchain to the search path within `bootstrap.sh` by adding this
line of code:

> `$ export PATH="/Applications/ARM/bin:$PATH"`
2. Users may also have to specify which `pkg-config`/`openssl` to use by adding
these lines of code as well:

> `$ export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"`
> `$ export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"`
### Installing prerequisites on Linux

On Debian-based Linux distributions such as Ubuntu, these dependencies can be
satisfied with the following:

> ` $ sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev`
## Bootstrapping your source tree (one time)

1. Under the "Terminal" menu (or using shortcut Ctrl+shift+p), select "Run
Task..."
2. Select the "Bootstrap" task

-----
---

[Table of Contents](../../README.md)
19 changes: 10 additions & 9 deletions docs/silabs/general/ARTIFACTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ used with a Raspberry Pi to allow the Raspberry Pi's Open Thread Border Router
to access the Thread network. Radio Co-Processor (RCP) images are available in
the Assets section of this page:

https://github.com/SiliconLabs/matter/releases/tag/v0.2.0
https://github.com/SiliconLabs/matter/releases/tag/v0.3.0

<br>

Expand All @@ -34,25 +34,26 @@ The Matter Accessory Device Images are used to turn an EFR into a Matter device.
These are pre-built binary images for the Matter Demo. Matter Accessory Device
Images are located in the Assets section of this page:

https://github.com/SiliconLabs/matter/releases/tag/v0.2.0
https://github.com/SiliconLabs/matter/releases/tag/v0.3.0

<br>

## Matter Bootloader Binaries

If you are using the OTA functionality and especially if you are using an EFR32MG2x device you will need to flash a bootloader binary on your device along with the application image. Bootloader binaries for all of the Matter supported devices are available here:
If you are using the OTA functionality and especially if you are using an
EFR32MG2x device you will need to flash a bootloader binary on your device along
with the application image. Bootloader binaries for all of the Matter supported
devices are available here:

https://github.com/SiliconLabs/matter/releases/tag/v0.2.0
https://github.com/SiliconLabs/matter/releases/tag/v0.3.0

<br>

## RS9116 Firmware

The RS9116 firmware is used to update the RS9116 - it can be found in the
repository you have cloned, at the following relative path from the
`/matter` directory:

> $ /third_party/silabs/wiseconnect-wifi-bt-sdk/firmware
repository you have cloned, at the following relative path from the `/matter`
directory, `./third_party/silabs/wiseconnect-wifi-bt-sdk/firmware`

<br>

Expand Down
130 changes: 130 additions & 0 deletions docs/silabs/general/CUSTOM_MATTER_DEVICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Custom Matter Device Development

Build a customizable lighting app using the Matter protocol

## Overview

This guide will cover the basics of building a customizable lighting application
using Matter.

## Using Matter with Clusters

In Matter, commands can be issued by using a cluster. A cluster is a set of
attributes and commands which are grouped together under a relevant theme.

Attributes store values (think of them as variables). Commands are used to
modify the value of attributes.

For example, the "On/Off" cluster has an attribute named "OnOff" of type
boolean. The value of this attribute can be set to "1" by sending an "On"
command or it can be set to "0" by sending an "Off" command.

The C++ implementation of these clusters is located in the clusters directory.
Note that you can also create your own custom cluster.

## ZAP configuration

From the matter repository, run the following command in a terminal to launch
the ZAP UI. This will open up the ZAP configuration for the EFR32 lighting
application example.

> `$ ./scripts/tools/zap/run_zaptool.sh examples/lighting-app/lighting-common/lighting-app.zap`
On the left hand side of the application, there is a tab for Endpoint 0 and
Endpoint 1. Endpoint 0 is known as the root node. This endpoint is akin to a
"read me first" endpoint that describes itself and the other endpoints that make
up the node. Endpoint 1 represents a lighting application device type. There are
a number of required ZCL clusters enabled in Endpoint 1. Some clusters are
common across most device types, such as identify and group clusters. Others,
such as the On/Off, Level Control and Color Control clusters are required for a
lighting application device type.

Clicking on the blue settings icon on the right hand side of the application
will bring you to the zap configuration settings for that cluster. Each cluster
has some required attributes that may cause compile-time errors if they are not
selected in the zap configuration. Other attributes are optional and are allowed
to be disabled. Clusters also have a list of client-side commands, again some
are mandatory and others are optional depending on the cluster. ZCL offers an
extensive list of optional attributes and commands that allow you to customize
your application to the full power of the Matter SDK.

For example, if one was building a lighting application which only includes
single color LEDs instead of RGB LEDs, it might make sense to disable the Color
Control cluster in the ZAP configuration. Similarly, if one were to build a
lighting application that doesn't take advantage of the Level Control cluster,
which allows you to customize current flow to an LED, it might make sense to
disable the Level Control cluster.

Each time a modification is made to the ZAP UI, one must save (Electron→Save on
a Mac toolbar) the current ZAP configuration and run the following command to
generate ZAP code.

> `$ ./scripts/tools/zap/generate.py examples/lighting-app/lighting-common/lighting-app.zap -o zzz_generated/lighting-app/zap-generated/`
## Receiving Matter commands

All Matter commands reach the application through the intermediate function
MatterPostAttributeChangeCallback(). When a request is made by a Matter client,
the information contained in the request is forwarded to a Matter application
through this function. The command can then be dissected using conditional logic
to call the proper application functions based on the most recent command
received.

## Adding a cluster to a ZAP configuration

In the ZAP UI, navigate to the Level Control cluster. Make sure this cluster is
enabled as a server in the drop down menu in the "Enable" column. Then click on
the blue settings wheel in the "Configure" column. This cluster can be used to
gather power source configuration settings from a Matter device. It contains a
few required attributes, and a number of optional attributes.

## Adding a new attribute

In the Level Control cluster configurations, ensure the CurrentLevel attribute
is set to enabled. Set the default value of this attribute as 1.

## Adding a new command

Navigate to the commands tab in zap and enable the MoveToLevel command. Now save
the current zap configuration, and run the aforementioned generate.py script.

## React to Level Control cluster commands in ZclCallbacks

In the MatterPostAttributeCallback function in ZclCallbacks, add the following
line of code or similar. This will give the application the ability to react to
MoveToLevel commands. The developer can define platform specific behavior for a
MoveToLevel action.

else if (clusterId == LevelControl::Id)
{
ChipLogProgress(Zcl, "Level Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u",
ChipLogValueMEI(attributeId), type, *value, size);

if (attributeId == LevelControl::Attributes::CurrentLevel::Id)
{
action_type = LightingManager::MOVE_TO_LEVEL;
}

LightMgr().InitiateActionLight(AppEvent::kEventType_Light, action_type, endpoint, *value);
}

## Send a MoveToLevel command and read the CurrentLevel attribute

Rebuild the application and load the new executable on your EFR32 device. Send
the following mattertool commands and verify that the current-level default
attribute was updated as was configured. Replace {desired_level} with 10, and
node_ID with the node ID assigned to the device upon commissioning

> `$ mattertool levelcontrol read current-level 1 1 // Returns 1`
> `$ mattertool levelcontrol move-to-level {desired_level} 0 1 1 {node_ID} 1`
> `$ mattertool levelcontrol read current-level 1 1 // Returns 10`
More Information Silicon Labs lighting example on a Thunderboard Sense 2 -
[sl-newlight/efr32](../../../silabs_examples/sl-newLight/efr32/README.md)

---

[Table of Contents](../README.md) | [Thread Demo](../thread/DEMO_OVERVIEW.md) |
[Wi-Fi Demo](../wifi/DEMO_OVERVIEW.md)
19 changes: 19 additions & 0 deletions docs/silabs/general/EP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Using Simplicity Studio's Energy Profiler with Matter

Simplicity Studio's Energy Profiler allows the developer to see a graphical view
of their devices energy usage over time. This can be very useful when developing
an energy friendly device.

Using Energy Profiler with Matter is the same as any other protocol except that
you need to start the usage from within Energy Profiler rather than using an
existing Simplicity Studio project since your Matter project will not have been
created inside Simplicity Studio.

Complete documentation on using the Simplicity Studio Energy Profiler is
provided in the
[Simplicity Studio 5 Energy Profiler User's Guide](https://docs.silabs.com/simplicity-studio-5-users-guide/1.0/using-the-tools/energy-profiler/)

---

[Table of Contents](../README.md) | [Thread Demo](../thread/DEMO_OVERVIEW.md) |
[Wi-Fi Demo](../wifi/DEMO_OVERVIEW.md)
4 changes: 4 additions & 0 deletions docs/silabs/general/FLASH_SILABS_DEVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ Simplicity Studio is a complete development environment and tool suite. It has t
- [Download Simplicity Studio](https://www.silabs.com/developers/simplicity-studio)
- [Simplicity Studio Reference Guide](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-building-and-flashing/flashing)

## (Optional) Ozone J-Link Debugger:
Multi-platform debugger and performance analyzer for J-Link and J-Trace
- Download for: [Windows](https://www.segger.com/downloads/jlink/Ozone_Setup_Windows_x64.exe) | [Mac](https://www.segger.com/downloads/jlink/Ozone_macOS_Universal.pkg) | [Linux](https://www.segger.com/downloads/jlink/Ozone_Linux_x86_64.deb)

----
[Table of Contents](../README.md) | [Thread Demo](../thread/DEMO_OVERVIEW.md) | [Wi-Fi Demo](../wifi/DEMO_OVERVIEW.md)
Loading

0 comments on commit 48576d4

Please sign in to comment.