Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

Commit fed581b

Browse files
committed
Merge branch 'feature/update_v3.0.1' into 'master'
update iotkit embedded to v3.0.1 See merge request esp-components/esp-aliyun!184
2 parents f6797e3 + bced2a6 commit fed581b

File tree

455 files changed

+107008
-7318
lines changed

Some content is hidden

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

455 files changed

+107008
-7318
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ examples/*/*/build/*
1010
# config
1111
sdkconfig
1212
sdkconfig.old
13+
14+
# VS Code Settings
15+
.vscode/

.gitlab-ci.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,10 @@ build_esp8266_demo:
2525
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
2626
- git --version
2727
- git submodule update --init --recursive
28-
- git clone --branch release/v3.1 --depth 1 $GITLAB_SSH_SERVER/sdk/ESP8266_RTOS_SDK.git
28+
- git clone --branch release/v3.2 --depth 1 $GITLAB_SSH_SERVER/sdk/ESP8266_RTOS_SDK.git
2929
- export IDF_PATH=$CI_PROJECT_DIR/ESP8266_RTOS_SDK
30-
- cp -r patch/* iotkit-embedded/
31-
- cd iotkit-embedded
32-
- make distclean
33-
- echo 2 | make reconfig
34-
- make -j1
35-
- cd ..
3630
- cd examples/solutions/smart_light
37-
- make defconfig
31+
- make chip=esp8266 defconfig
3832
- make
3933

4034
build_esp32_demo:
@@ -56,14 +50,8 @@ build_esp32_demo:
5650
- cd esp-idf
5751
- ./tools/ci/mirror-submodule-update.sh
5852
- cd ..
59-
- cp -r patch/* iotkit-embedded
60-
- cd iotkit-embedded
61-
- make distclean
62-
- echo 1 | make reconfig
63-
- make -j1
64-
- cd ..
6553
- cd examples/solutions/smart_light
66-
- make defconfig
54+
- make chip=esp32 defconfig
6755
- make
6856

6957
push_to_github:

.gitmodules

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

Kconfig

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
menu "iotkit embedded"
2+
3+
menu "Aliyun linkkit device key"
4+
5+
config LINKKIT_FIRMWARE_VERSION
6+
string "Device version"
7+
default "0.0.1"
8+
help
9+
aliyun linkkit device version
10+
11+
config LINKKIT_PRODUCT_KEY
12+
string "Product key"
13+
default "xxxx"
14+
help
15+
aliyun linkkit product key.
16+
17+
config LINKKIT_PRODUCT_SECRET
18+
string "Product secret"
19+
default "xxxx"
20+
help
21+
aliyun linkkit product secret.
22+
23+
config LINKKIT_DEVICE_NAME
24+
string "Device name"
25+
default "xxxx"
26+
help
27+
aliyun linkkit device name.
28+
29+
config LINKKIT_DEVICE_SECRET
30+
string "Device secret"
31+
default "xxxx"
32+
help
33+
aliyun linkkit device secret.
34+
endmenu
35+
36+
menu "Aliyun linkkit awss config"
37+
config AWSS_ENCRYPT_TYPE
38+
int "Get the security level of the `smartconfig` service"
39+
range 1 5
40+
default 3
41+
help
42+
Get the security level of the `smartconfig` service
43+
44+
config AWSS_CONN_ENCRYPT_TYPE
45+
int "Get Security level for wifi configuration with connection.Used for AP solution of router and App"
46+
range 3 5
47+
default 4
48+
help
49+
Get Security level for wifi configuration with connection.Used for AP solution of router and App
50+
51+
config AWSS_TIMEOUT_INTERVAL_MS
52+
int "Get the timeout period of the distribution service (`AWSS`), in milliseconds"
53+
range 0 1800000
54+
default 180000
55+
help
56+
Get the timeout period of the distribution service (`AWSS`), in milliseconds
57+
58+
config AWSS_CHANNELSCAN_INTERVAL_MS
59+
int "Get the length of time scanned on each channel (`channel`), in milliseconds"
60+
range 0 1000
61+
default 200
62+
help
63+
Get the length of time scanned on each channel (`channel`), in milliseconds
64+
endmenu
65+
66+
menu "Aliyun linkkit netwoek config"
67+
config TCP_ESTABLISH_TIMEOUT_MS
68+
int "Device tcp connection timeout wait time milliseconds"
69+
range 0 100000
70+
default 10000
71+
help
72+
Device tcp connection timeout wait time milliseconds
73+
74+
config TLS_ESTABLISH_TIMEOUT_MS
75+
int "Device tls connection timeout wait time milliseconds"
76+
range 0 100000
77+
default 10000
78+
help
79+
Device tls connection timeout wait time milliseconds
80+
endmenu
81+
82+
config HAL_SEM_MAX_COUNT
83+
int "The maximum count value that can be reached of the semaphore"
84+
default 255
85+
range 0 255
86+
help
87+
The recommended value of maximum count of the semaphore is 255
88+
89+
config HAL_SEM_INIT_COUNT
90+
int "The count value assigned to the semaphore when it is created"
91+
default 0
92+
range 0 10
93+
help
94+
The recommended value of count of the semaphore is 0
95+
config HAL_TLS_HANDSHAKE_TIMEOUT
96+
int "TLS Handsake Timeout"
97+
default 180
98+
range 0 65535
99+
help
100+
Default TLS handshake timeout to host in seconds
101+
102+
endmenu

README.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ESP 设备包括 [ESP芯片](https://www.espressif.com/zh-hans/products/hardware
3030

3131
# <span id = "aliyunprepare">3.阿里云平台准备</span>
3232
根据[阿里官方文档](https://github.com/aliyun/iotkit-embedded?spm=5176.doc42648.2.4.e9Zu05),在阿里云平台创建产品,创建设备,同时自动产生 `product key`, `product secert`, `device name`, `device secret`
33-
`product key`, `product secert`, `device name`, `device secret` 将在 6.1.2 节用到。
33+
`product key`, `product secert`, `device name`, `device secret` 将在 6.2.3 节用到。
3434

3535
# <span id = "compileprepare">4.环境搭建</span>
3636
**如果您熟悉 ESP 开发环境,可以很顺利理解下面步骤; 如果您不熟悉某个部分,比如编译,烧录,需要您结合官方的相关文档来理解。如您需阅读 [ESP-IDF 编程指南](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/index.html)文档等。**
@@ -58,42 +58,27 @@ $ ./components/esptool_py/esptool/esptool.py --help
5858

5959
> Espressif SDK 下载好后:
6060
> ESP-IDF: 请切换到 release/v3.2 分支: `git checkout release/v3.2`
61-
> ESP8266_RTOS_SDK: 请切换到 release/v3.1 分支: `git checkout release/v3.1`
61+
> ESP8266_RTOS_SDK: 请切换到 release/v3.2 分支: `git checkout release/v3.2`
6262
6363
# <span id = "makeflash">6.编译 & 烧写 & 运行</span>
6464
## 6.1 编译
6565

6666
### 6.1.1 导出编译器
6767
参考 [工具链的设置](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/get-started/linux-setup.html)
6868

69-
### 6.1.2 编译 iotkit-embedded SDK
70-
1. 拷贝针对 iotkit-embedded 的 patch
69+
### 6.1.2 编译 demo 示例
70+
**由于 esp32 和 esp8266 将会采用不同的 sdkconfig.defaults 和对应的 partitions.csv,在对应的 make 命令中加入了对应的芯片选项,如 chip=esp32 或 chip=esp8266。**
7171

72-
为了解决在 MacOS 下的编译问题,修改了部分 iotkit-embedded 中的文件
73-
在 esp-aliyun 目录下执行:
72+
当 chip=esp32 时将默认使用 sdkconfig_esp32.defaults 以及 partitions_esp32.csv
73+
当 chip=esp8266 时将默认使用 sdkconfig_esp8266.defaults 以及 partitions_esp8266.csv。
7474

75-
```
76-
cp -r patch/* iotkit-embedded/
77-
```
78-
79-
2. 编译生成 `libiot_sdk.a`
80-
81-
```
82-
cd iotkit-embedded
83-
make reconfig
84-
# 选择 esp8266 或 esp32 平台
85-
make
86-
cd ..
87-
```
88-
89-
### 6.1.3 编译 demo 示例
90-
- 进入需要编译的 example, 配置三元组信息等
75+
以上需要特别注意。
9176

9277
在 esp-aliyun 目录下执行:
9378

9479
```
9580
cd examples/solutions/smart_light
96-
make defconfig
81+
make chip=esp32 defconfig
9782
make menuconfig
9883
```
9984

@@ -105,7 +90,7 @@ make menuconfig
10590
2.生成最终 bin
10691

10792
```
108-
make
93+
make -j8
10994
```
11095

11196
## 6.2 擦除 & 编译烧写 & 下载固件 & 查看 log
@@ -115,13 +100,17 @@ make
115100
```
116101
make erase_flash
117102
```
103+
> 注:无需每次擦除,擦除后需要重做 6.2.3。
118104
119105
### 6.2.2 烧录程序
120106
```
121107
make flash
122108
```
123109

124-
## 6.2.3 运行
110+
### 6.2.3 烧录三元组信息
111+
参考 [量产说明](./config/mass_mfg/README.md) 文档烧录三元组 NVS 分区。
112+
113+
## 6.2.4 运行
125114

126115
```
127116
make monitor

component.mk

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,65 @@
11
# Makefile
22

3-
# CFLAGS +=
3+
COMPONENT_PRIV_INCLUDEDIRS := \
4+
iotkit-embedded/coap_server/CoAPPacket \
5+
iotkit-embedded/coap_server/server \
6+
iotkit-embedded/dev_bind/impl \
7+
iotkit-embedded/dev_bind/impl/os \
8+
iotkit-embedded/dev_bind/impl/awss_reset \
9+
iotkit-embedded/wifi_provision/dev_ap \
10+
iotkit-embedded/wifi_provision/frameworks \
11+
iotkit-embedded/wifi_provision/frameworks/aplist \
12+
iotkit-embedded/wifi_provision/frameworks/ieee80211 \
13+
iotkit-embedded/wifi_provision/frameworks/statics \
14+
iotkit-embedded/wifi_provision/frameworks/utils \
15+
iotkit-embedded/wifi_provision/p2p \
16+
iotkit-embedded/wifi_provision/phone_ap \
17+
iotkit-embedded/wifi_provision/router_ap \
18+
iotkit-embedded/wifi_provision/smartconfig \
19+
iotkit-embedded/wifi_provision/zero_config
420

5-
# version of iotkit-embedded: https://github.com/aliyun/iotkit-embedded
6-
IE_VER := $(shell cd ${IE_PATH} && git describe --always --tags --dirty)
21+
COMPONENT_ADD_INCLUDEDIRS := \
22+
conn_mgr \
23+
iotkit-embedded/atm \
24+
iotkit-embedded/coap_server \
25+
iotkit-embedded/dev_bind \
26+
iotkit-embedded/dev_model \
27+
iotkit-embedded/dev_sign \
28+
iotkit-embedded/dynamic_register \
29+
iotkit-embedded/mqtt \
30+
iotkit-embedded/ota \
31+
iotkit-embedded/infra \
32+
iotkit-embedded/wifi_provision \
33+
iotkit-embedded \
34+
wrappers
735

8-
# version of esp-aliyun: https://github.com/espressif/esp-aliyun
9-
EA_VER := $(shell cd ${ESP_ALIYUN_PATH} && git describe --always --tags --dirty)
36+
COMPONENT_SRCDIRS := \
37+
conn_mgr \
38+
iotkit-embedded/atm \
39+
iotkit-embedded/certs \
40+
iotkit-embedded/dev_bind/impl \
41+
iotkit-embedded/dev_bind/impl/os \
42+
iotkit-embedded/dev_bind/impl/awss_reset \
43+
iotkit-embedded/dev_model \
44+
iotkit-embedded/dev_reset \
45+
iotkit-embedded/dev_sign \
46+
iotkit-embedded/dynamic_register \
47+
iotkit-embedded/infra \
48+
iotkit-embedded/mqtt \
49+
iotkit-embedded/ota \
50+
iotkit-embedded/wifi_provision/dev_ap \
51+
iotkit-embedded/wifi_provision/frameworks \
52+
iotkit-embedded/wifi_provision/frameworks/aplist \
53+
iotkit-embedded/wifi_provision/frameworks/ieee80211 \
54+
iotkit-embedded/wifi_provision/frameworks/statics \
55+
iotkit-embedded/wifi_provision/frameworks/utils \
56+
iotkit-embedded/wifi_provision/p2p \
57+
iotkit-embedded/wifi_provision/phone_ap \
58+
iotkit-embedded/wifi_provision/router_ap \
59+
iotkit-embedded/wifi_provision/smartconfig \
60+
iotkit-embedded/wifi_provision/zero_config \
61+
iotkit-embedded/coap_server/CoAPPacket \
62+
iotkit-embedded/coap_server/server \
63+
wrappers
1064

11-
CFLAGS += -DIE_VER=\"$(IE_VER)\"
12-
CFLAGS += -DEA_VER=\"$(EA_VER)\"
13-
14-
COMPONENT_IOTKIT_RELEASE_PATH = iotkit-embedded/output/release
15-
16-
COMPONENT_ADD_INCLUDEDIRS := \
17-
$(COMPONENT_IOTKIT_RELEASE_PATH)/include \
18-
$(COMPONENT_IOTKIT_RELEASE_PATH)/include/imports \
19-
$(COMPONENT_IOTKIT_RELEASE_PATH)/include/exports \
20-
iotkit-embedded/src/services/awss \
21-
platform/crypto/include \
22-
platform/hal \
23-
platform/include
24-
25-
COMPONENT_SRCDIRS := \
26-
platform/hal/os/espressif
27-
28-
ifdef CONFIG_TARGET_PLATFORM_ESP8266
29-
# ESP8266 platform
30-
COMPONENT_SRCDIRS += platform/crypto/src \
31-
platform/hal/ssl/openssl
32-
33-
else
34-
# ESP32 platform
35-
COMPONENT_SRCDIRS += platform/hal/ssl/mbedtls
36-
endif
37-
38-
# link libiot_sdk.a
39-
LIBS += iot_sdk
40-
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH)/$(COMPONENT_IOTKIT_RELEASE_PATH)/lib $(addprefix -l,$(LIBS))
65+
CFLAGS += -Wno-char-subscripts

0 commit comments

Comments
 (0)