add docs images
This commit is contained in:
parent
de9ef0ce11
commit
14fb66c272
73
README.md
73
README.md
|
@ -54,16 +54,16 @@ RT-Thread online packages --->
|
|||
```
|
||||
--- ucloud-iot-sdk: ucloud iot sdk for uiot-core platform.
|
||||
[*] Enable mqtt
|
||||
Auth Mode (Enable Static Register) --->
|
||||
Ucloud Device Config --->
|
||||
[ ] Enable Shadow
|
||||
[ ] Enable Dev Model
|
||||
[ ] Enable Ota
|
||||
Auth Mode (Enable Static Register) --->
|
||||
Ucloud Device Config --->
|
||||
[ ] Enable Tls
|
||||
[ ] Enable Ucloud Mqtt Sample
|
||||
[ ] Enable Ucloud Shadow Sample
|
||||
[ ] Enable Ucloud Dev Model Sample
|
||||
[ ] Enable Ucloud Ota Sample
|
||||
[ ] Enable Ucloud Mqtt Sample
|
||||
[ ] Enable Shadow
|
||||
[ ] Enable Ucloud Shadow Sample
|
||||
[ ] Enable Dev Model
|
||||
[ ] Enable Ucloud Dev Model Sample
|
||||
[ ] Enable Ota
|
||||
[ ] Enable Ucloud Ota Sample
|
||||
Version (latest) --->
|
||||
```
|
||||
|
||||
|
@ -77,38 +77,67 @@ RT-Thread online packages --->
|
|||
|
||||
`Enable Dynamic Register`:动态注册模式使用产品号,设备号,产品密钥认证
|
||||
|
||||
`Ucloud Device Config `:根据认证模式填写当前设备认证要素,动态认证时,设备密钥可以不填写
|
||||
|
||||
`Enable Shadow`:使能设备影子功能
|
||||
|
||||
`Enable Dev Model`:使能物模型功能
|
||||
|
||||
`Enable Ota`:使能远程升级版本的功能,若使能,则会关联选中ota_downloader软件包。
|
||||
`Ucloud Device Config `:根据认证模式填写当前设备认证要素,当认证模式为动态认证时,设备密钥可以不填写
|
||||
|
||||
`Enable TLS`: 是否使能TLS,若使能,则会关联选中mbedTLS软件包。
|
||||
|
||||
`Enable Ucloud Mqtt Sample`:使能mqtt收发消息的案例
|
||||
|
||||
`Enable Shadow`:使能设备影子功能
|
||||
|
||||
`Enable Ucloud Shadow Sample`:使能物模型的案例
|
||||
|
||||
`Enable Dev Model`:使能物模型功能
|
||||
|
||||
`Enable Ucloud Dev Model Sample`:使能物模型的案例
|
||||
|
||||
`Enable Ota`:使能远程升级版本的功能,若使能,则会关联选中ota_downloader软件包。
|
||||
|
||||
`Enable Ucloud Ota Sample`:使能远程升级版本的案例
|
||||
|
||||
`Version (latest) --->`:
|
||||
|
||||
- 使用 `pkgs --update` 命令下载软件包
|
||||
|
||||
#### 2.2 创建可订阅可发布的Topic
|
||||
|
||||
案例中使用的topic为订阅/接收权限的topic需要在云平台上将/${ProductSN}/${DeviceSN}/set增加权限
|
||||
|
||||
### 2.3 编译及运行
|
||||
### 2.2 编译及运行
|
||||
1. 使用命令 scons --target=xxx 输出对应的工程,编译
|
||||
|
||||
2. 打开生成的工程,编译下载到设备中
|
||||
|
||||
### 2.4 运行demo程序
|
||||
系统启动后,在 MSH 中使用命令执行:
|
||||
系统启动后,在 MSH 中使用命令执行,以mqtt_sample为例:
|
||||
启动案例:mqtt_test_example start
|
||||
终止案例:mqtt_test_example stop
|
||||
|
||||
执行输出:
|
||||
msh />mqtt_test_example start
|
||||
establish tcp connection with server(host='mqtt-cn-sh2.iot.ucloud.cn', port=[1883])
|
||||
msh />success to establish tcp, fd=4
|
||||
Cloud Device Construct Successsubscribe success, packet-id=2
|
||||
publish success, packet-id=3
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "0"}
|
||||
publish success, packet-id=4
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "1"}
|
||||
publish success, packet-id=5
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "2"}
|
||||
publish success, packet-id=6
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "3"}
|
||||
publish success, packet-id=7
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "4"}
|
||||
publish success, packet-id=8
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "5"}
|
||||
publish success, packet-id=9
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "6"}
|
||||
publish success, packet-id=10
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "7"}
|
||||
publish success, packet-id=11
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "8"}
|
||||
publish success, packet-id=12
|
||||
Receive Message With topicName:/fahnimwwvph259ag/3um7h4fdiigf2yyh/upload/event, payload:{"test": "9"}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 572 KiB |
Binary file not shown.
After Width: | Height: | Size: 728 KiB |
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
After Width: | Height: | Size: 81 KiB |
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
|
@ -18,6 +18,8 @@
|
|||
| ├─HAL_TLS_config.h | mbedtls库相关的声明 |
|
||||
| ├─HAL_TLS_mbedtls.c | mbedtls库相关的接口 |
|
||||
|
||||
2.移植到新的开发板上时只需要修改fal下的相关的文件,针对使用的开发板flash合理划分分区,修改分区配置表及驱动
|
||||
`fal`:移植到新的开发板上时只需要修改fal下的相关的文件,针对使用的开发板flash合理划分分区,修改分区配置表及驱动。
|
||||
|
||||
3.可以通过修改mbedtls文件夹下的HAL_TLS_config.h打开或关闭宏添加或删除对应的功能
|
||||
`rtthread`: 与rtthread操作系统相关的一些接口,在rtthread系统上使用时一般不需要修改。
|
||||
|
||||
`ssl`: 可以通过修改mbedtls文件夹下的HAL_TLS_config.h打开或关闭宏添加或删除对应的功能。
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
# 快速入门示例
|
||||
为了快速的让您了解如何将您的设备连接到物联网平台,我们通过一个智能空调向云平台上报温度和湿度作为示例讲解。
|
||||
|
||||
## 操作步骤
|
||||
|
||||
### 创建产品与设备
|
||||
将设备接入物联网平台的第一步是在平台创建产品。产品相当于某一类设备的集合,该类设备具有相同的功能,您可以根据产品批量管理对应设备。
|
||||
|
||||
1. [注册](https://passport.ucloud.cn/#register)UCloud云服务
|
||||
2. 登录进入UCloud[物联网平台](https://console.ucloud.cn/uiot)
|
||||
3. 创建产品
|
||||
|
||||
- 点击<创建产品>,创建一个产品,为其命名,点击<确定>;
|
||||
- 创建完成后,点击产品的详情,可以对产品进行相应的配置。
|
||||
|
||||
![添加产品](/images/添加产品.png)
|
||||
|
||||
4. 创建设备
|
||||
|
||||
- 根据[创建设备](/iot/uiot-core/console_guide/product_device/create_devcies)文档及页面提示,依次点击<详情>、点击<设备管理>、<添加设备>、<随机生成>、<生成设备个数1个>、<确定>;
|
||||
|
||||
![随机添加设备](/images/随机添加设备.png)
|
||||
|
||||
|
||||
5. 记录设备注册信息
|
||||
|
||||
- 点击添加的设备,打开设备详情页,准备好设备注册相关信息,设备注册信息包含:`产品序列号` `设备序列号` `设备密码`,需要妥善保管好,后续测试需要使用。
|
||||
|
||||
![设备注册信息](/images/设备注册信息.png)
|
||||
|
||||
|
||||
### 建立设备与平台的连接
|
||||
|
||||
这里使用基于rtthread操作系统的软件包,快速将设备接入到物联网平台。
|
||||
|
||||
在C-SDK的目录`sample/mqtt/`中,通过修改例程`mqtt_sample.c`来介绍如何使用C-SDK。
|
||||
|
||||
|
||||
#### 配置设备信息
|
||||
通过rtthread的env配置工具配置产品和设备信息。
|
||||
|
||||
1. 打开mqtt sample
|
||||
```
|
||||
--- ucloud-iot-sdk: ucloud iot sdk for uiot-core platform.
|
||||
[*] Enable mqtt
|
||||
Auth Mode (Enable Static Register) --->
|
||||
Ucloud Device Config --->
|
||||
[ ] Enable Tls
|
||||
[*] Enable Ucloud Mqtt Sample
|
||||
[ ] Enable Shadow
|
||||
[ ] Enable Ucloud Shadow Sample
|
||||
[ ] Enable Dev Model
|
||||
[ ] Enable Ucloud Dev Model Sample
|
||||
[ ] Enable Ota
|
||||
[ ] Enable Ucloud Ota Sample
|
||||
Version (latest) --->
|
||||
```
|
||||
|
||||
2.配置产品设备认证三要素
|
||||
```
|
||||
Ucloud Device Config --->
|
||||
[*] Device Config ----
|
||||
(5xaptnq5is1xt45c) Config Product SN
|
||||
(tycfyk7697ra5jqs) Config Device SN
|
||||
(6kh48wf6oq5xktir) Config Device Secret
|
||||
```
|
||||
|
||||
3. 保存配置
|
||||
|
||||
4. 编译生成版本,下载到开发板中,系统启动后,在 MSH 中使用命令执行,
|
||||
```
|
||||
msh />mqtt_test_example start
|
||||
```
|
||||
|
||||
5. 查看日志
|
||||
|
||||
平台提供日志管理功能可以查看设备行为以及所有经过平台流转的上行或下行的数据。
|
||||
|
||||
设备上下线
|
||||
|
||||
![设备上线](/images/设备上线.png)
|
||||
|
||||
设备上行消息
|
||||
|
||||
![设备上行消息](/images/设备上行消息.png)
|
||||
|
||||
设备下行消息
|
||||
|
||||
![设备下行消息](/images/设备下行消息.png)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue