本文为您详细介绍第三方定制 App 部署相关操作。
前提条件
登录腾讯云 物联网开发平台控制台,并注册 移动应用。
App 参数写入配置文件
iOS 平台的配置文件为 app-config.json
Android 平台的配置文件为 app-config.json
请根据实际情况调整配置信息,配置文件内容如下:
{"TencentIotLinkAppkey": "请输入从物联网开发平台申请的 App key,正式发布前务必填写","TencentIotLinkAppSecret": "请输入从物联网开发平台申请的 App Secret,App Secret 请保存在服务端,此处仅为演示,如有泄露概不负责","WXAccessAppId": ""}
1. TencentIotLinkAppkey 和 TencentIotLinkAppSecret 请使用物联网平台申请的 App Key 和 App Secret,TencentIotLinkAppSecret 存放在用户自建后台服务器中,详情可见应用端 API 简介。
App 绑定真实设备
通过 softAP 配网 方式(自助配网)绑定真实设备,操作步骤如下:
1.1 点击首页添加设备按钮,跳转到添加设备页面后,点击需要添加的硬件设备。
1.2 App 自动识别设备配网为 softAP 配网方式,如图:
![Picture8_softAp1.PNG](https://qcloudimg.tencent-cloud.cn/image/document/2f1ebbaa9fd57a6499c0c86c5ae430de.png)
![Picture8_softAp1.PNG](https://qcloudimg.tencent-cloud.cn/image/document/2f1ebbaa9fd57a6499c0c86c5ae430de.png)
1.3 点击底部按钮后,连接 Wi-Fi,输入 Wi-Fi 名称和密码,如图:
![Picture9_softAp2.PNG](https://qcloudimg.tencent-cloud.cn/image/document/d75c22cdc952bec49452d8bd6c6a3cdc.png)
![Picture9_softAp2.PNG](https://qcloudimg.tencent-cloud.cn/image/document/d75c22cdc952bec49452d8bd6c6a3cdc.png)
1.4 输入完后点击确认,连接设备热点,如图:
![Picture10_softAp3.PNG](https://qcloudimg.tencent-cloud.cn/image/document/6bea832266dc31c43363c82cd0da67f8.png)
![Picture10_softAp3.PNG](https://qcloudimg.tencent-cloud.cn/image/document/6bea832266dc31c43363c82cd0da67f8.png)
1.5 在【设置】中选择设备提供的热点,进行连接。
1.6 连接成功后,返回 App,如图:
![Picture11_softAp4.PNG](https://qcloudimg.tencent-cloud.cn/image/document/c2dbd90e1368e77e03fee344c1dd9a2e.png)
![Picture11_softAp4.PNG](https://qcloudimg.tencent-cloud.cn/image/document/c2dbd90e1368e77e03fee344c1dd9a2e.png)
1.7 点击下一步开始连接,连接成功后,如图:
![Picture12_softAp5.PNG](https://qcloudimg.tencent-cloud.cn/image/document/78cc9d57b296a34316ddb3e1f4708e8c.jpeg)
![Picture12_softAp5.PNG](https://qcloudimg.tencent-cloud.cn/image/document/78cc9d57b296a34316ddb3e1f4708e8c.jpeg)
通过 SmartConfig 配网 方式(智能配网)绑定真实设备,操作步骤如下:
说明:
在此配网方式下,目前只支持 Wi-Fi 2.4GHZ。
1.1 点击首页添加设备按钮,跳转到添加设备页面后,点击需要添加的硬件设备。
1.2 App 自动识别设备配网为 SmartConfig 配网方式,如图:
![Picture13_SmartCon1.PNG](https://qcloudimg.tencent-cloud.cn/image/document/58e3d2b49310323422db23f67bae17d1.png)
![Picture13_SmartCon1.PNG](https://qcloudimg.tencent-cloud.cn/image/document/58e3d2b49310323422db23f67bae17d1.png)
1.3 点击底部按钮后,连接 Wi-Fi,输入 Wi-Fi 名称和密码,如图:
![Picture14_SmartCon2.PNG](https://qcloudimg.tencent-cloud.cn/image/document/d670aa72ce4f2e1f2d6abe2cb912327f.png)
![Picture14_SmartCon2.PNG](https://qcloudimg.tencent-cloud.cn/image/document/d670aa72ce4f2e1f2d6abe2cb912327f.png)
1.4 连接成功后,如图:
![Picture15_SmartCon3.PNG](https://qcloudimg.tencent-cloud.cn/image/document/d6d1c122f50d8eb2f7755a33b01db29a.png)
![Picture15_SmartCon3.PNG](https://qcloudimg.tencent-cloud.cn/image/document/d6d1c122f50d8eb2f7755a33b01db29a.png)
App 通过上述方式绑定真实设备后,设备状态会自动上报至物联网平台;手机端通过与物联网平台维持的长连接,可以实现实时显示设备状态。