10 分钟完成对接
-
1
PreparationReady
Below are some preparatory work that needs to be done before development.
Login ThingBoot, You are not logged in. PleaseLogin
You can register and log in with one click using your mobile phone number.You will manage, connect and debug devices in the IoT Console of the Workbench.
准备设备If you have purchased and received the device, please power on the device and configure its network. Please find the product manual of the device's corresponding product in the Support & Navigation section, and follow the guidance to configure the device's network.
If you don't have a physical device, you can also connect to the online demo device. You can find "Demo Devices" in the left-side navigation of the Workbench.
-
2
开发设置Setting
准备工作完成后,先进行开发设置
进入工作台,在物联网控制台左侧导航中,点击“开发设置”
请设置开发者密码 (AppSecret),记录好,并同时记录开发者ID(AppID)
如果仅为测试对接,可以打开 “调试模式” 在调试模式下不检查sign和ts的值,也不会检查IP白名单
如果要按生产环境标准对接,则不打开 此时需要在对接编码时,计算签名开发设置里的其他设置项,可以先不理会,对接完第一款产品后再探索
-
3
开始对接Coding
现在,可以开始对接设备了!
对接前,请首先打开设备详情页在控制台左侧导航“设备”卡片下
在设备详情页 “概览” 卡片,在页面右侧,可以找到设备对应产品的《产品手册》手册中有设备的详细参数、支持的命令、安装方式等
在设备详情页 “控制” 卡片,可以控制体验一下设备在每次操作时,都可以在“控制”卡片页面上方看到发送给设备的命令
开始对接测试如果打开了“调试模式” 测试环境
您可以使用Postman等接口调试工具进行设备对接测试。 具体的请求地址和POST的命令参数,请查看设备的《产品手册》如果未打开“调试模式” 生产环境
只需要构造一个简单的HTTP请求,就可以控制设备
接口采用HTTP协议,使用任何可进行HTTP请求的编程语言均可;
接口调用的方法也完全一致,对于不同的设备,调用方式可复用,仅命令不同。因此:如仅控制设备:
可以只封装一个函数,将设备ID(整形)和命令(数组)作为参数传入如需其他管理操作:
可以封装一个类,将设备控制、分组、定时任务等做为类的方法具体的请求地址和POST的命令参数,请查看设备的《产品手册》