入门视频笔记
注意:!!!不需要看这篇,浪费时间,这个是官网的19分钟的入门教程笔记,没有看过原视频是看不懂的。
1 注册
直接去官网注册一个免费的账号即可。
https://demo.thingsboard.io/
2. 创建资产与添加设备
2.2 创建资产
2.2 创建一些设备
这里创建的是两个温度计设备。
2.3 让资产与设备建立关系
3. 将数据推送到设备到平台
这里使用的是HTTP协议,其中此平台还支持多种协议,请从以下链接寻找
Tutorial Resources - https://thingsboard.io/docs/getting-s… Generator function - https://gist.github.com/Terny22/89cca… ThingsBoard documentation - https://thingsboard.io/docs Live Demo server - https://demo.thingsboard.io Github page - https://github.com/thingsboard/things…
3.1 测试命令
命令在下面:
# Please replace $HOST_NAME and $ACCESS_TOKEN with corresponding values.
curl -v -X POST -d "{\"temperature\": 25}" $HOST_NAME/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
# For example, $HOST_NAME in case of live demo server:
curl -v -X POST -d "{\"temperature\": 25}" https://demo.thingsboard.io/api/v1/$eGNbdXzu7Sj2QuKS7mpz/telemetry --header "Content-Type:application/json"
curl -v -X POST -d "{\"temperature\": 25}" https://demo.thingsboard.io/api/v1/jZeVwOGqFI7Ii80dxseq/telemetry --header "Content-Type:application/json"
curl -v -X POST -d "{\"temperature\": 25}" https://demo.thingsboard.io/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
# For example, $HOST_NAME in case of local installation:
curl -v -X POST -d "{\"temperature\": 25}" http://localhost:8080/api/v1/$ACCESS_TOKEN/telemetry --header "Content-Type:application/json"
3.2 数据生成器的使用
1. 添加生成器
var msg = { temperature: +(Math.random()*5 + 25).toFixed(1) };
var metadata = { data: 40 };
var msgType = "POST_TELEMETRY_REQUEST";
return { msg: msg, metadata: metadata, msgType: msgType };
2 添加规则链
3. 添加标签
4. 成功验证
如果你的配置成功,那么每10秒那个位置会产生变化
4. 可视化数据
4.2 仪表盘状态管理
4.3 添加警报控件
4.3.1 创建规则链
这边意味着警报会传至整个资产。
4.3.2 在根节点添加新规则
4.3 推送数据到节点试试警报
# For example, $HOST_NAME in case of live demo server:
curl -v -X POST -d "{\"temperature\": 55}" https://demo.thingsboard.io/api/v1/eGNbdXzu7Sj2QuKS7mpz/telemetry --header "Content-Type:application/json"
注意:
警报一般会被自动清除,如果温度回归到正常的话。有时候没被清除需要手工查看。
5. 将警报信息推送至邮箱
添加控件:
创建意味着新事件才会被触发,如果需要不断接收某个事件使用升级
5.1 需要注册使用一个推送服务器
由于演示项目的地方存在安全协议,所以需要使用自己的。 由于需要自己搭建或者使用别人的,就不演示了。