https://blog.csdn.net/u012377333/article/details/71123671
Mosquitto--webServer应用测试结果
一、测试环境介绍
二、测试流程&结果
1、应用服务器运行webServer订阅
启动本地的Tomcat,加载OxygenCloud后,就会使用Id为webServer向Mosquitto订阅webServer主题。
Mosquitto日志:
2、命令行订阅设备SN码为10013主题
#mosquitto_sub -h 60.205.148.67-t 10013 -u admin -P password
Mosquitto日志:
3、设备SN码为10013发送上传数据到webServer
数据格式:
{"msgType":"InviteUpload","pressure":"6.3","sn":"10013","flowTotal":"1677","concentrer":"96.4","flow":"58","deviceStatus":"2"}
命令行:
# mosquitto_pub -h 60.205.148.67-t webServer -u admin -P password -m"{"msgType":"InviteUpload","pressure":"5.3","sn":"10013","flowTotal":"1677","concentrer":"96.4","flow":"58","deviceStatus":"2"}"
Mosquitto日志:
Tomcat日志:
Web界面:
MySQL数据库:
4、设备SN码为10013上传开关机授权&开关机到webServer
设备关机数据格式:
{"msgType":"InviteOpen","sn":"10013","open":"0"}
命令行:
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{"msgType":"InviteOpen","sn":"10013","open":"0"}"
Mosquitto日志:
Tomcat日志:
Web界面:
MySQL数据库:
设备开关机授权数据格式:
{"openValid":"0","msgType":"InviteOpenValid","sn":"10013"}
命令行:
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{"msgType":"InviteOpenValid","sn":"10013","openValid":"0"}
Mosquitto日志:
Tomcat日志:
Web界面:
MySQL数据库:
数据格式:
{"openValid":"1","msgType":"InviteOpenAll","sn":"10013","open":"1"}
命令行:
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{"msgType":"InviteOpenAll","sn":"10013","openValid":"1","open":"1"}"
Mosquitto日志:
Tomcat日志:
Web界面:
MySQL数据库:
5、设备SN码为10013上传警报消息
数据格式:
{"msgType":"InviteAlert","sn":"10013","alertMsg":"浓度低"}
命令行:
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{"msgType":"InviteAlert","sn":"10013","alertMsg":"浓度低"}"
Mosquitto日志:
Tomcat日志:
Web界面:
MySQL数据库:
6、webClient下发数据上传频率到设备
数据格式:
{"hz":"5","msgType":"InviteHz"}
Web界面操作:
用户登录或者用户注销时,或者session失效时。
Mosquitto日志:
Tomcat日志:
命令行接收数据:
7、webClient下发警报参数到设备
数据格式:
{"cctUpTime":"300","msgType":"InviteAlertParam","psrDwonTime":"300","cctDownTime":"300","psrUp":"95","psrUpTime":"300","cctDown":"4.0","cctUp":"5.0","psrDwon":"87"}
Web界面操作:
Mosquitto日志:
Tomcat日志:
命令行接收数据:
8、webClient下发开关机授权&开关机到设备
开关机授权数据格式:
{"openValid":"0","msgType":"InviteOpenValid","sn":"webServer"}
Web操作界面:
Mosquitto日志:
Tomcat日志:
命令行接收数据:
---------------------
作者:一枪尽骚丶魂
来源:CSDN
原文:https://blog.csdn.net/u012377333/article/details/71123671
版权声明:本文为博主原创文章,转载请附上博文链接!