Skip to content

Commit 87d9bfd

Browse files
committed
feat : Release SDK v2.1.1
Signed-off-by: Junyoun <[email protected]>
1 parent bf0d20f commit 87d9bfd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+10605
-537
lines changed

CHANGELOG

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# HISTORY
22

3+
## 2.1.1 : Changes for version 2.1.1
4+
5+
Bug fixed:
6+
7+
- Fix build error during esp32 example build
8+
9+
## 2.1.0 : Changes for version 2.1.0
10+
11+
New Improvements or features:
12+
13+
- Update D2D onboarding protocol to use hased SN to improve security.
14+
- Add Quick PoC example for linux distribution
15+
16+
Enhancements or amendments:
17+
18+
- Add raspberry pi example and porting.
19+
- Improve esp32 flash operation to make sure commit change.
20+
- Add esp32 nv encrypted image generator.
21+
- Improve DIP update logic to make fast to update DIP after FOTA.
22+
- Support BL602 board porting.
23+
24+
Bug fixed:
25+
26+
- Fix BLE MTU issue with specific AOS version.
27+
328
## 2.0.3 : Changes for version 2.0.3
429

530
Enhancements or amendments:

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ We are managing two git branch categories. One is `develop` branch. The other is
5353
- `develop` branch : Latest devleoping features. Recommand for new feature test or POC.
5454
- `release/v{version}` branchs : Tested and stable branchs. Recommand for Commercial product.
5555

56+
## Quick PoC development on Linux distribution
57+
58+
You can build and test the SDK on your Linux distribution environment without real target board. In this way, you can easily make PoC demo for your product and check your IoT device feasibility on SmartThings platform. Also in real product developing, building and testing on Linux environment can accelerate product development speed.
59+
60+
We provide `example/posix` example to demonstrate how to build and test the SDK on Linux distribution. But before running the example, you should acquire [Getting Started](./doc/getting_started.md) to be familiar with the SDK development process and register your test device profile on [Developer Workspace](https://developer.smartthings.com/workspace/). And this example skips onboarding(registering) process, so before test, you should register your device on the cloud manually with [manual onboarding tool](./tools/manual_onboarding/README.md) provided in `tools/manual_onboarding` folder.
61+
5662
## Learn more
5763

5864
For more information, please review the following documents:
@@ -63,9 +69,13 @@ For more information, please review the following documents:
6369
- [Capabilities Reference](https://developer.smartthings.com/docs/devices/capabilities/capabilities-reference) : This page serves as a reference for the supported capabilities.
6470
- [Developer Workspace](https://developer.smartthings.com/workspace/) : It provides functions related to device information registration and device integration in the SmartThings cloud.
6571

66-
## Contact
72+
## Commercialization
73+
74+
For commercialization, refer to the following [link](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/Commercialization_Guide).
6775

68-
If you have any issue, or want to commercialize your IoT devices using this SDK, please contact [email protected] or open new issue.
76+
If you have any issue, or want to commercialize your IoT devices using this SDK, please use the following contact point.
77+
- Commercializatioin : [email protected]
78+
- Technical inquiry : open new issue on Github
6979

7080
## License
7181

doc/Commercialization_Guide

Lines changed: 0 additions & 5 deletions
This file was deleted.

doc/Commercialization_Guide.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Commercialization Guide for IoT device with SmartThings SDK
2+
3+
Please contact [email protected] for commercialization inquiries.
4+
5+
### Check List for the commercialization
6+
1. Products shall have unique serial number and public key.<br/>
7+
We recommend to modify and apply the opensource example tools in the link below to suit each company's production.
8+
9+
- [STDK key generation tool](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/STDK_Key_Generation.md)
10+
- [STDK QR generation tool](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/STDK_QR_Generation.md)
11+
12+
2. Created serial number, public key and private key shall be saved in the secure module.<br/>
13+
Private key shall not be exposed to the outside and shall be injected and stored in the secure region of the device.
14+
15+
3. Serial Number and Device Public key shall be registered with Samsung SmartThings before sale.
16+
17+
4. QR should be attached to the device for the commercialization.
18+
- The QR size requested for the product should meet the specifications below.
19+
- Recommended : Above 10mm * 10mm
20+
- Minimum : 7mm * 7mm
21+
22+
5. Products certified by WWST shall have a WWST logo attached to the product package.<br/> You can get the WWST(Work With Samsung SmartThings) Logo image with [the following link](https://partners.smartthings.com/brand-guidelines).
23+
24+
6. Products shall provide the firmware update function for security patch, feature upgrade, bug fix and etc.<br/>
25+
If the partner has their own firmware update system, they can use it.<br/> But if not, they can implement it by referring to [the OTA guide](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/blob/main/doc/ota_demo.md) we provide.

doc/STDK_Key_Generation.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# How to create secure key for SmartThings Device SDK
2+
3+
### Introduction
4+
SmartThings Device SDK allows users to pair their devices with the SmartThings App through a process called device onboarding.
5+
During device onboarding, the device and user information shall be protected. To support, a key for encryption is required.
6+
SmartThings Device SDK provides Key generation tool at `st-device-sdk-c/tools/keygen/` to help the developer.
7+
But, if the developer has own key generation tool, they can use thiers
8+
9+
### How to use SmartThings Device SDK key generation tool
10+
This example shows how to create ED25519 key pair with SDK tools. You can get device_info.json file as a result from tools/keygen/output_{ serialNumber}
11+
Prefix 'STDK' means serial number for the developer.
12+
13+
```sh
14+
$ cd {SDK_ROOT}/tools/keygen/
15+
$ python3 stdk-keygen.py --firmware switch_example_001
16+
Use following serial number and public key
17+
for the identity of your device in Developer Workspace.
18+
19+
Serial Number:
20+
STDK**E90W***uCX
21+
22+
Public Key:
23+
nFN5x***uQusQ****ZHoBSFaAoP9***kNdLnjDJRew=
24+
```
25+
26+
Products shall have unique serial number.
27+
28+
Manufacturer shall use the serial number in the result depending on their policy for the commercialization.
29+
30+
The created serial number shall use safe characters in URLs.
31+
| | Characters |
32+
| :------------------- | :---------------------------------------------------------------------------------------------------|
33+
| Safe characters | Alphanumeric [0-9a-zA-Z], special characters $-_.+!*'(), |
34+
35+
SmartThings Device SDK also provides the bulk generation.
36+
This tool can be installed by following the [guide](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/tools/keygen/README.md)
37+
Key Generation tool offers several options
38+
| Option | Description |
39+
| :------------------- | :---------------------------------------------------------------------------------------------------|
40+
| -h, --help |show this help message and exit |
41+
| --mnid MNID |[I] can set your MNID as prefix of Serial Number |
42+
| --firmware version |[I] firmware version for device_info.json |
43+
| --input csv |[C] input csv file that has a list of serial numbers |
44+
| --output csv |[C] output batch csv file |
45+
| --nv {esp, esp-encrypt} |generate nv image for choiced chipset |
46+
| --qr |generate QR code image. --path is required |
47+
| --path PATH |input the path located onboarding_config.json (Or copy onboarding_config.json to the current folder) |
48+
49+
ex) If the manufacturer uses two options, --input <CSV file> abd --qr, they can get the sercure key and QR, together.

doc/STDK_QR.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

doc/STDK_QR_Generation.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# How to create QR code for SmartThings Device SDK
2+
3+
### Introduction
4+
SmartThings Device SDK allows users to pair their devices with the SmartThings App through a process called device onboarding.
5+
This "device onboarding" process involves confirming whether this device is owned by the user through the user's operation.
6+
STDK provides four methods for this. These four methods are Just Works, Button Confirm, Pin Code Confirm, and QR Code Confirm.
7+
When registering an onboarding profile in Developer Workspace, the developer can select methods may be used to check whether the device to be paired with the SmartThings App is owned by the user during onboarding.
8+
Using QR code is not only used for user verification, but also helps user to onboarding user's device quickly and accurately.
9+
In the "Add device" menu of the SmartThings App, the onboarding process starts by only scanning QR provided through the "Scan QR code".
10+
11+
### Information included in QR code
12+
The QR code includes the following three pieces of information, and the manufacturer can generate the QR code with the information of each device and provide it to the user.
13+
1. mnId - ID granted to the company. The developer can check this value in Develpoer Workspace or onboarding_profile.json.
14+
2. setupId - A unique identification number in MNID (a.k.a Onboarding ID). The developer can check this value in Developer Workspace or onboarding_profile.json.
15+
(A unique three-digit number that helps identifing this device onboarding)
16+
3. SerialNumber - A UTF-8 URL encoded unique string assigned to each device. Developer shall use the serial number registered in Developer Workspace. Used serial number shall use safe characters in URLs.
17+
18+
| | Characters |
19+
| :------------------- | :---------------------------------------------------------------------------------------------------|
20+
| Safe characters | Alphanumeric [0-9a-zA-Z], special characters $-_.+!*'(), |
21+
22+
### How to create QR code
23+
The final QR code format is as follows. m is for mnid, s is for setupId and r is for serial number.
24+
```
25+
https://qr.samsungiots.com/?m=<mnId>&s=<setupId>&r=<SerialNumber>
26+
```
27+
To create QR code, SmartThings Device SDK provides QR generation tool at `st-device-sdk-c/tools/qrgen/`.
28+
29+
This tool can be installed by following the [guide](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/tools/qrgen/README.md)
30+
31+
QR Generation tool offers options
32+
33+
| Option | Description |
34+
| :------------------- | :---------------------------------------------------------------------------------------------------|
35+
| -h, --help | show this help message and exit |
36+
| --folder FOLDER | Folder containing onboarding_config.json and device_info.json (if not supplied uses current folder) |

doc/getting_started.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Because maximum number of test device is limited per user, Once you reaches maxi
9999

100100
This example shows how to create ED25519 key pair with SDK tools. You can get device_info.json file as a result from tools/keygen/output_{ serialNumber}
101101

102-
Key generator utility (keygen.py) is located at `st-device-sdk-c/tools/keygen/`.
102+
Key generator utility (stdk-keygen.py) is located at `st-device-sdk-c/tools/keygen/`.
103103
Serial number for testing device would be randomly generated by this tool which has STDK + 12-digit alphanumberic format.
104104

105105
```sh
@@ -120,45 +120,44 @@ Copy public key string from keygen output (`nFN5x***uQusQ****ZHoBSFaAoP9***kNdLn
120120
121121
![adding test device](./res/adding_test_device2.png)
122122
123+
If you want to get more information for keygen tool, refer [STDK Key Generation](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/STDK_Key_Generation.md)
123124
&nbsp;
124125
125-
### (Optional)Generate Device QR code
126-
Using device QR code could be helpful while device onboarding. QR code should have format like below. (Please refer here for more details)
127-
128-
This link is [QR code design template] (https://developer.smartthings.com/docs/devices/direct-connected/publish#qr-code-design-template).
126+
### Generate Device QR code
127+
Using device QR code could be helpful while device onboarding. QR code should have format like below.
128+
This link is [QR code design template](https://developer.smartthings.com/docs/devices/direct-connected/publish#qr-code-design-template).
129129
130130
**{Your mnId}**: 4-digit alphanumeric mnId of your account
131-
**{Device onboardingId}**: 3-digit number Onboarding ID, you can find it from your developer workspace project “Device Onboarding” > “Other Info” page
131+
**{Device setupId}**: 3-digit number setupId, you can find it from your developer workspace project “Device Onboarding” > “Other Info” page
132132
**{Device serialNumber}**: device serial number which is registered at your developer workspace project
133133
134134
```
135-
https://qr.samsungiots.com/?m={Your mnId}&s={Device onboardingId}&r={Device serialNumber}
135+
https://qr.samsungiots.com/?m={Your mnId}&s={Device setupId}&r={Device serialNumber}
136136
```
137137
138-
You can simply generate QR code with using below python3 script
139-
```python
140-
import qrcode
141-
142-
mnid = 'FFFF' # "FFFF" is an example. you should replace it with yours
143-
onboardingId = '111' # "111" is an example. you should replace it with yours
144-
serialNumber = 'STDKtest0001' # "STDKtest0001" is an example. you should replace it with yours
145-
qrUrl = 'https://qr.samsungiots.com/?m=' + mnid + '&s=' + onboardingId + '&r=' + serialNumber
146-
qrcode.QRCode(box_size=10, border=4)
147-
img = qrcode.make(qrUrl)
148-
img.save(serialNumber + '.png')
138+
QR generator utility (stdk-qrgen.py) is located at `st-device-sdk-c/tools/qrgen/`.
139+
To generate QR, `onboarding_config.json` and `device_info.json` should be located at `st-device-sdk-c/tools/qrgen/`.
140+
onboarding_config.json can download on [Developer Workspace](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/getting_started.md#download-onboarding_configjson)
141+
device_info.json can get on 'st-device-sdk-c/tools/keygen/output_{serialNumber}'.
142+
```sh
143+
$ cd {SDK_ROOT}/tools/qrgen/
144+
$ python3 stdk-qrgen.py
145+
File: {Device serialNumber}.png
146+
QR url: https://qr.samsungiots.com/?m={Your mnId}&s={Device onboardingId}&r={Device serialNumber}
149147
```
148+
149+
If you want to get more information for QR tool, refer [STDK QR Generation](https://github.com/SmartThingsCommunity/st-device-sdk-c/blob/main/doc/STDK_QR_Generation.md)
150150
&nbsp;
151151
152152
### Download onboarding_config.json
153153
154-
This is the information that the IoT device must have in order to connect to the SmartThings Platform.
154+
This is the information that the IoT device shall have in order to connect to the SmartThings Platform.
155155
156156
If you use a sample device application in example directory from this git repository, please download it and then, just overwrite the existing `onboarding_config.json` file with the new one you downloaded. In fact, overwriting is just one of several possible ways to inject it to the device. If the json information is guaranteed to be a parameter in the `st_conn_init()` function, you can refer to it differently according to your own development way.
157157
158158
<img src="res/downloading_onboarding_config_file_switch.png" style="zoom:70%;"/>
159159
160-
&nbsp;
161-
&nbsp;
160+
&nbsp;
162161
163162
## Develop a device application
164163
@@ -185,7 +184,7 @@ Your IoT device needs two pieces of information when connecting to the SmartThin
185184
186185
We have two type of the format of `device_info.json`.
187186
188-
- **All inclusive**
187+
- **All inclusive (For development)**
189188
190189
`device_info.json` file could include all the information as json format. Our SmartThings Device SDK sample application uses this method.
191190
This is the easiest and simplest way to contain security information for devices. But having per device specific information as json format may not be suitable for manufacturing. So this is recommended for the test devices for individual developer.
@@ -204,7 +203,7 @@ Your IoT device needs two pieces of information when connecting to the SmartThin
204203
python3 stdk-keygen.py --firmware switch_example_ver001 --mnid fJXX
205204
```
206205
207-
- **Firmware version only**
206+
- **Firmware version only (For commercial)**
208207
209208
We can leave only the firmware version at `device_info.json` like below.
210209
```json
@@ -214,7 +213,7 @@ Your IoT device needs two pieces of information when connecting to the SmartThin
214213
}
215214
}
216215
```
217-
In this case other sercurity information like device private key, device public key and device serial number should be moved to dedicated secure partition - called as SmartThings Non-Volatile (STNV) Partition - with `CONFIG_STDK_IOT_CORE_SUPPORT_STNV_PARTITION` option enabled.
216+
For commercial, other sercurity information like device private key, device public key and device serial number should be moved to dedicated secure partition - called as SmartThings Non-Volatile (STNV) Partition - with `CONFIG_STDK_IOT_CORE_SUPPORT_STNV_PARTITION` option enabled.
218217
This is subitable for manufacturing because it could have dedicated secure partition for immutable information. SmartThings Device SDK expect security information from STNV parition with below path name.
219218
The mapping between `iot_nvd_t` and real storage path name can be found at `iot_bsp_nv_data_XXX.c` for [each bsp's porting layer](https://github.com/SmartThingsCommunity/st-device-sdk-c/tree/master/src/port/bsp).
220219
[stdk-keygen.py](https://github.com/SmartThingsCommunity/st-device-sdk-c/tree/master/tools/keygen#commercial) also supports batch creation by reading csv formatted series of device serial number.

0 commit comments

Comments
 (0)