当前位置:网站首页>梅科尔工作室-华为14天鸿蒙设备开发实战笔记八
梅科尔工作室-华为14天鸿蒙设备开发实战笔记八
2022-07-26 11:08:00 【51CTO】
一.OpenHarmony网络应用开发——连接华为loT平台
1.华为loT平台介绍
华为云物联网平台即华为设备接入服务(IoT Device Access),提供海量设备连接上云、设备和云端双向消息通信、批量设备管理、远程控制和监控、OTA升级、设备联动规则等能力,并可将设备数据灵,活流转到华为云其他服务,帮助物联网行业用户快速完成设备联网及行业应用集成。

华为IoT平台地址: https://www.huaweicloud.com/product/iothub.html
2.华为loT平台产品创建
产品模型用于描述设备具备的能力和特性。开发者通过定义产品模型,在物联网平台构建一款设备的抽象模型,使平台理解该款设备支持的服务、属性、命令等信息,如颜色、开关等。

3.华为IoT平台产品创建
服务信息:
服务ID | 服务类型 |
Agriculture | Senser |
属性信息:
属性名称 | 数据类型 |
Temperature | int |
Humidity | int |
Luminance | int |
LightStatus | string |
MotorStatus | string |
命令信息:
命令名称 | 参数名称 | 数据类型 | 长度 | 枚举 |
Agriculture_Control_light | light | string | 3 | ON,OFF |
Agriculture_Control_Motor | Motor | string | 3 | ON,OFF |
4.设备对接华为loT平台
打开"D6_iot_cloud_oc"工程的iot_cloud_OC_sample.c文件,查看实现MQTT协议对接华为IoT平台的代码。


生成设备对接信息网址: https://iot-tool.obs-website.cn-north-4.myhuaweicloud.com/
5.设备对接华为loT平台
案例将演示如何在BearPi-HM_Nano开发板上使用MQTT协议连接华为IoT平台,需要将E53_IA1智慧农业扩展板与BearPi-HM_Nano开发板安装在一起。

E53_IA1智慧农业扩展板购买地址: https://item.taobao.com/item.htm?id=607878490044
边栏推荐
- Dichotomous template summary
- Pyqt5 rapid development and practice 3.1 QT designer quick start
- Admit it, investing in new energy is for security
- 并发三大性质
- Smart contract DAPP system development process technology
- 由浅入深搭建神经网络
- 加载ORB词典
- Pyqt5 rapid development and practice Chapter 1 understanding pyqt5
- 【万字长文】使用 LSM-Tree 思想基于.Net 6.0 C# 实现 KV 数据库(案例版)
- 贝尔曼期望方程状严谨证明
猜你喜欢
随机推荐
Why give up NPM and turn to yarn
Pre post pytest method
贝尔曼期望方程状严谨证明
MySQL数据库的简单使用
MySQL锁机制
344. Reverse string
Reproduce PHP one sentence Trojan horse
复现php一句话木马
The combination of pytest confitest.py and fixture
[development tool] ieda red
Harbor2.2 用户角色权限速查
Novice source code hashtable
Dichotomous template summary
MySQL死锁分析
Logging advanced use
How the ThreadPoolExecutor performs tasks
Generation and transformation of pulse waveform
349. Intersection of two arrays
Data visualization - White Snake 2: black snake robbery (2)
Le audio specification overview









