微信小步调-MQTT模拟器
微信小步调码
1. 筹备工做
1.1 注册阿里云账号
开明阿里云账号,并通过付出宝真名认证 https://www.aliyun.com
1.2 免费开明IoT物联网套件
产品官网 https://www.aliyun.com/product/iot
2. 控制台收配轨范
2.1 创立高级版产品
高级版,JSON格局
完好物模型TSL,可以正在控制台导入,须要交换productKey
2.2 产品罪能界说
添加产品属性
温度 temperature,湿度 humidity
2.3 注册方法
正在产品下注册方法,与得身份三元组
3. 微信小步调收配
3.1 方法上线
3.2 上报数据
3.3 订阅主题和数据下止
先点击 订阅主题,再去控制台推送音讯。
人脸识别彩蛋
IoT物联网技术
附录:物模型TSL
{
"schema": "https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json",
"profile": {
"productKey": "交换为你的productKey"
},
"services": [
{
"outputData": [],
"identifier": "set",
"inputData": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度"
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度"
}
],
"method": "thing.service.property.set",
"name": "set",
"required": true,
"callType": "async",
"desc": "属性设置"
},
{
"outputData": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度"
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度"
}
],
"identifier": "get",
"inputData": [
"temperature",
"humidity"
],
"method": "thing.service.property.get",
"name": "get",
"required": true,
"callType": "async",
"desc": "属性获与"
}
],
"properties": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度",
"accessMode": "rw",
"required": false
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度",
"accessMode": "rw",
"required": false
}
],
"events": [
{
"outputData": [
{
"identifier": "temperature",
"dataType": {
"specs": {
"unit": "°C",
"min": "0",
"max": "1000",
"step": "0.1"
},
"type": "float"
},
"name": "温度"
},
{
"identifier": "humidity",
"dataType": {
"specs": {
"unit": "%RH",
"min": "0",
"max": "100",
"step": "0.1"
},
"type": "float"
},
"name": "湿度"
}
],
"identifier": "post",
"method": "thing.event.property.post",
"name": "post",
"type": "info",
"required": true,
"desc": "属性上报"
}
]
}