Skip to content

Commit 1b7b3a4

Browse files
OpenThread Applications v1.0.0
1 parent 4026bd4 commit 1b7b3a4

File tree

15 files changed

+2800
-2
lines changed

15 files changed

+2800
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313

1414
# Silicon Labs OpenThread Applications #
1515

16+
[![Version Badge](https://img.shields.io/badge/-v1.0.0-green)](https://github.com/SiliconLabs/openthread_applications/releases)
17+
[![SDK Badge](https://img.shields.io/badge/SiSDK-v2024.12.0-green)](https://github.com/SiliconLabs/simplicity_sdk/releases)
18+
![License badge](https://img.shields.io/badge/License-Zlib-green)
19+
1620
The Silicon Labs OpenThread stack allows for a wide variety applications to be built on its foundation. This repo showcases some example applications built using the Silicon Labs OpenThread stack.
1721

1822
## Examples ##
1923

20-
- Example 1
24+
| No | Example name | Link to example |
25+
|:--:|:-------------|:---------------:|
26+
| 1 | OpenThread - DALI+ Communication | [Click Here](./openthread_dali_plus) |
2127

2228
## Documentation ##
2329

@@ -31,4 +37,4 @@ Questions and comments related to these examples should be made by creating a ne
3137

3238
## Disclaimer ##
3339

34-
The Gecko SDK suite supports development with Silicon Labs IoT SoC and module devices. Unless otherwise specified in the specific directory, all examples are considered to be EXPERIMENTAL QUALITY which implies that the code provided in the repos has not been formally tested and is provided as-is. It is not suitable for production environments. In addition, this code will not be maintained and there may be no bug maintenance planned for these resources. Silicon Labs may update projects from time to time.
40+
The Simplicity SDK suite supports development with Silicon Labs IoT SoC and module devices. Unless otherwise specified in the specific directory, all examples are considered to be EXPERIMENTAL QUALITY which implies that the code provided in the repos has not been formally tested and is provided as-is. It is not suitable for production environments. In addition, this code will not be maintained and there may be no bug maintenance planned for these resources. Silicon Labs may update projects from time to time.

openthread_dali_plus/README.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# OpenThread - DALI+ Communication #
2+
3+
![Type badge](https://img.shields.io/badge/Type-Virtual%20Application-green)
4+
![Technology badge](https://img.shields.io/badge/Technology-Platform-green)
5+
![License badge](https://img.shields.io/badge/License-Zlib-green)
6+
![SDK badge](https://img.shields.io/badge/SDK-v2024.12.0-green)
7+
![Build badge](https://img.shields.io/badge/Build-passing-green)
8+
![Flash badge](https://img.shields.io/badge/Flash-357.58%20KB-blue)
9+
![RAM badge](https://img.shields.io/badge/RAM-31.15%20KB-blue)
10+
11+
## Summary ##
12+
13+
These projects are updated to support DALI+ over OpenThread. DALI+ is an extension of the DALI (Digital Addressable Lighting Interface) protocol that operates over wireless IP-based networks. Instead of traditional DALI communication using Manchester encoding, DALI+ transmits its messages over OpenThread, an IPv6-based mesh networking protocol. This project demonstrates how to configure Silicon Labs MCUs to send DALI+ frames between a Main device and a Secondary device over Thread network.
14+
15+
## SDK Version ##
16+
17+
- [SiSDK v2024.12.0](https://github.com/SiliconLabs/simplicity_sdk/releases/tag/v2024.12.0)
18+
19+
## Hardware Required ##
20+
21+
Two Thread capable devices from Silicon Labs. Tested boards for working with this example:
22+
23+
| Board ID | Description |
24+
| ---------------------- | ------ |
25+
| BRD2703A | [EFR32xG24 Explorer Kit-BRD2703A](https://www.silabs.com/development-tools/wireless/efr32xg24-explorer-kit?tab=overview) |
26+
| BRD2601B | [xG24 Dev Kit- BRD2601B](https://www.silabs.com/development-tools/wireless/efr32xg24-dev-kit?tab=overview) |
27+
28+
## Connections Required ##
29+
30+
The DALI+ system runs over an OpenThread mesh network, where:
31+
32+
- The Main device is the Leader that sends forward frames over the OpenThread network, while waiting for the backward frames from the secondary device.
33+
- The Secondary devices shall receive the forward frames and send backward frames as responses.
34+
![alt text](image/structure.png)
35+
36+
## Setup ##
37+
38+
### Create a project based on an example project ###
39+
40+
1. From the Launcher Home, add your hardware to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project with the filter "dali".
41+
42+
2. Choose corresponding project for Main Device and Secondary Device -> click Create and Finish and Project should be generated.
43+
44+
3. Build and flash this example to the board.
45+
46+
![alt text](image/instruction.png)
47+
48+
### Start with an "Empty C" project ###
49+
50+
1. Create a Empty C project for your hardware using Simplicity Studio v5.
51+
52+
2. Copy the **inc**, **src** folders, and the **app.c** into the project root folder (overwriting existing file):
53+
- With **Main Device**: [main_device](src/main_device)
54+
- With **Secondary Device**: [secondary_device](src/secondary_device)
55+
56+
3. Install the software components:
57+
- Open the .slcp file in the project.
58+
- Select the SOFTWARE COMPONENTS tab.
59+
- Install the following components for Main Device:
60+
- [Application][Utility][Log]
61+
- [OpenThread][Stack(FTD)]
62+
- Open Stack (FTD) configuration and enable CoAP API and Commissioner
63+
- [Platform][Driver][Button][Simple Button]
64+
- Instance: btn0 and press the Add New Instances for another instance: btn1
65+
- Navigate [Platform][Security][Configuration]
66+
- Open the configuration and enable PSK based ciphersuite modes in SSL / TLS and ECDHE-ECDSA based ciphersuite modes in SSL / TLS
67+
- Install the following components for Secondary Device:
68+
- [Application][Utility][Log]
69+
- [OpenThread][Stack(FTD)]
70+
- Open Stack (FTD) configuration and enable CoAP API and Joiner
71+
- Navigate [Platform][Security][Configuration]
72+
- Open the configuration and enable PSK based ciphersuite modes in SSL / TLS and ECDHE-ECDSA based ciphersuite modes in SSL / TLS
73+
- [Platform][Driver][Button][Simple Button]
74+
- Instance: btn0
75+
- [Platform][Utilities][Circular Queue][Configuration]
76+
- Increase Max Queue Length to 16
77+
78+
4. Build and flash the project to your device.
79+
80+
**NOTE:** For those who want to debug with No Optimization option, navigate to **config/sl_memory_manager_region_config.h** and increase the SL_STACK_SIZE to 8192.
81+
82+
## How It Works ##
83+
84+
1. The Main Device initiates a new Thread network with a custom operational dataset, becoming the Leader and Commissioner. It then adds the Secondary Device as a Joiner using a pre-shared key, with a 120-second window for joining. The Secondary Device starts by discovering the Thread network created by the Main Device. If successful, it proceeds with the Joiner process; otherwise, it retries the discovery.
85+
86+
2. Once the Commissioner/Joiner process is complete and the **Secondary Device** is reassigned from the detached state, it will multicast a UDP discovery packet to the **Main Device**. The **Main Device** will respond with a UDP network configuration packet to set the **Secondary Device's** non-volatile parameters. The **Secondary Device** will then send a CoAP ACK to confirm the configuration.
87+
- In DALI+, there are 3 main CoAP responses:
88+
- Not executed, CoAP ACK: CoAP code “valid”, this shall response with a CoAP ACK
89+
- Executed, no reply values: CoAP code “changed”, this shall response with a UDP simple ACK packet with error indicator
90+
- Executed, has reply values: CoAP code “content”, this shall response with a backward UDP packet with data
91+
- Executed shall mean minimum one command frame in the original forward frame transaction has been executed or forwarded to another network. Depending on the transaction type, an executed forward frame transaction not leading to any reply values may still require a simple acknowledgment frame to be send.
92+
93+
3. The **Main Device** transmits forward packets to the **Secondary Device**, which responds with one of the three responses mentioned above. All packets adhere to the DALI+ frame specifications. For detailed information, refer to "Part 104 Changes and Additions" and the "IEC 62386 Standards".
94+
95+
## Testing ##
96+
97+
To conduct testing, you will require two Silicon Labs boards: one designated as the Main Device and the other as the Secondary Device.
98+
99+
1. Power on the **Main Device** first to initiate the commissioner before the joiner from the Secondary Device. Note that the commissioning phase lasts only 120 seconds, and the joiner must be active within this period. If not, the entire process must be restarted.
100+
101+
2. Open a terminal program (such as the built-in console in Simplicity Studio) for each board.
102+
103+
3. On the **Secondary Device**, press **Button 0** to cycle through the response scenarios as previously described. On the Main Device, press **Button 1** to send the forward packet (limited to 40 packets per 10 seconds, in compliance with DALI+ requirements). Press **Button 0** to toggle packet encryption. Note that the response will be randomly delayed (between 0 to 2000 ms) to simulate jitter delay in DALI+, preventing overload during multicasting.
104+
105+
4. The result shall be as followed:
106+
107+
![alt text](image/result.png)
108+
109+
## Documentation ##
110+
111+
Official documentation can be found at our [Developer Documentation](https://docs.silabs.com/#section-mcu-wireless) page.
112+
113+
## Reporting Bugs/Issues, Posting Questions and Comments ##
114+
115+
To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of this repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.
116+
117+
Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of this repo.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
project_name: openthread_dali_plus_main_device
2+
label: OpenThread - DALI+ Communication (Main Device)
3+
package: openthread
4+
description: |
5+
This example demonstrates a DALI+ protocol Main Device implementation. Instead of traditional DALI communication using Manchester encoding, DALI+ transmits its messages over OpenThread, an IPv6-based mesh networking protocol.
6+
7+
category: Example|Thread
8+
9+
filter:
10+
- name: Device Type
11+
value: [SoC]
12+
- name: MCU
13+
value: [32-bit MCU]
14+
- name: Project Difficulty
15+
value: [Beginner]
16+
- name: Wireless Technology
17+
value: [Thread]
18+
19+
quality: experimental
20+
21+
readme:
22+
- path: ../README.md
23+
24+
source:
25+
- path: ../src/daliplus.c
26+
directory: "src"
27+
- path: ../src/main.c
28+
- path: ../src/main_device/app.c
29+
30+
include:
31+
- path: ''
32+
file_list:
33+
- path: ../inc/app.h
34+
- path: ../inc
35+
file_list:
36+
- path: daliplus_config.h
37+
- path: daliplus.h
38+
directory: "inc"
39+
40+
component:
41+
- id: app_log
42+
- id: clock_manager
43+
- id: device_init
44+
- id: ot_stack_ftd
45+
- id: simple_button
46+
instance: [btn0, btn1]
47+
- id: sl_system
48+
49+
configuration:
50+
- name: SL_STACK_SIZE
51+
value: "8196"
52+
- name: CIRCULAR_QUEUE_LEN_MAX
53+
value: "16"
54+
- name: OPENTHREAD_CONFIG_COAP_API_ENABLE
55+
value: "1"
56+
- name: OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
57+
value: "1"
58+
- name: SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
59+
value: "1"
60+
- name: SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
61+
value: "1"
62+
63+
other_file:
64+
- path: ../image/structure.png
65+
directory: "image"
66+
- path: ../image/result.png
67+
directory: "image"
68+
- path: ../image/instruction.png
69+
directory: "image"
70+
71+
define:
72+
- name: DEBUG_EFM
73+
74+
ui_hints:
75+
highlight:
76+
- path: README.md
77+
focus: true
78+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
project_name: openthread_dali_plus_secondary_device
2+
label: OpenThread - DALI+ Communication (Secondary Device)
3+
package: openthread
4+
description: |
5+
This example demonstrates a DALI+ protocol Secondary Device implementation. Instead of traditional DALI communication using Manchester encoding, DALI+ transmits its messages over OpenThread, an IPv6-based mesh networking protocol.
6+
7+
category: Example|Thread
8+
9+
filter:
10+
- name: Device Type
11+
value: [SoC]
12+
- name: MCU
13+
value: [32-bit MCU]
14+
- name: Project Difficulty
15+
value: [Beginner]
16+
- name: Wireless Technology
17+
value: [Thread]
18+
19+
quality: experimental
20+
21+
readme:
22+
- path: ../README.md
23+
24+
source:
25+
- path: ../src/daliplus.c
26+
directory: "src"
27+
- path: ../src/main.c
28+
- path: ../src/secondary_device/app.c
29+
30+
include:
31+
- path: ''
32+
file_list:
33+
- path: ../inc/app.h
34+
- path: ../inc
35+
file_list:
36+
- path: daliplus_config.h
37+
- path: daliplus.h
38+
directory: "inc"
39+
40+
component:
41+
- id: app_log
42+
- id: clock_manager
43+
- id: device_init
44+
- id: ot_stack_ftd
45+
- id: simple_button
46+
instance: [btn0]
47+
- id: sl_system
48+
49+
configuration:
50+
- name: SL_STACK_SIZE
51+
value: "8196"
52+
- name: CIRCULAR_QUEUE_LEN_MAX
53+
value: "16"
54+
- name: OPENTHREAD_CONFIG_COAP_API_ENABLE
55+
value: "1"
56+
- name: OPENTHREAD_CONFIG_JOINER_ENABLE
57+
value: "1"
58+
- name: SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
59+
value: "1"
60+
- name: SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
61+
value: "1"
62+
63+
other_file:
64+
- path: ../image/structure.png
65+
directory: "image"
66+
- path: ../image/result.png
67+
directory: "image"
68+
- path: ../image/instruction.png
69+
directory: "image"
70+
71+
define:
72+
- name: DEBUG_EFM
73+
74+
ui_hints:
75+
highlight:
76+
- path: README.md
77+
focus: true
78+
131 KB
Loading
135 KB
Loading
169 KB
Loading

openthread_dali_plus/inc/app.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*******************************************************************************
2+
* @file app.h
3+
* @brief Header file for application logic.
4+
*******************************************************************************
5+
* # License
6+
* <b>Copyright 2025 Silicon Laboratories Inc. www.silabs.com</b>
7+
*******************************************************************************
8+
*
9+
* SPDX-License-Identifier: Zlib
10+
*
11+
* The licensor of this software is Silicon Laboratories Inc.
12+
*
13+
* This software is provided 'as-is', without any express or implied
14+
* warranty. In no event will the authors be held liable for any damages
15+
* arising from the use of this software.
16+
*
17+
* Permission is granted to anyone to use this software for any purpose,
18+
* including commercial applications, and to alter it and redistribute it
19+
* freely, subject to the following restrictions:
20+
*
21+
* 1. The origin of this software must not be misrepresented; you must not
22+
* claim that you wrote the original software. If you use this software
23+
* in a product, an acknowledgment in the product documentation would be
24+
* appreciated but is not required.
25+
* 2. Altered source versions must be plainly marked as such, and must not be
26+
* misrepresented as being the original software.
27+
* 3. This notice may not be removed or altered from any source distribution.
28+
*
29+
*******************************************************************************
30+
* # Experimental Quality
31+
* This code has not been formally tested and is provided as-is. It is not
32+
* suitable for production environments. In addition, this code will not be
33+
* maintained and there may be no bug maintenance planned for these resources.
34+
* Silicon Labs may update projects from time to time.
35+
******************************************************************************/
36+
#ifndef APP_H
37+
#define APP_H
38+
39+
/***************************************************************************//**
40+
* Initialize application.
41+
******************************************************************************/
42+
void app_init(void);
43+
44+
/***************************************************************************//**
45+
* App ticking function.
46+
******************************************************************************/
47+
void app_process_action(void);
48+
49+
#endif // APP_H

0 commit comments

Comments
 (0)