Mosquitto--webServer应用测试结果

一、测试环境介绍


二、测试流程&结果

1、应用服务器运行webServer订阅

启动本地的Tomcat,加载OxygenCloud后,就会使用Id为webServerMosquitto订阅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日志:


命令行接收数据:


 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值