总结:
(0)数据库报错问题,详细参考这篇文档,链接,ln -s 源 目标
https://blog.csdn.net/weixin_42110159/article/details/118945136
(1)数据库建立数据,要注意大小写,根据沟通,最好都为小写,或者最好都为大写。
(2)mysql 设置先设置好,否则emqx规格配置失败。
(3)mysql设置规则时候,需要设置空id,进行自动递增才行,具体原理目前还不清除,否则规则能成立,但是不成功。详细参考如下图所示.
(4)EMQX数据参数配置
资源设置
cjson配置
SQL输入
{
“deviceid”:10,
“temp”:10.100,
“humi”:10,
“rainfall”:10.1,
“waterlevel”:10,
“battery”:90
}
SELECT
payload.deviceid as deviceid,
payload.temp as temp,
payload.humi as humi,
payload.rainfall as rainfall,
payload.waterlevel as waterlevel,
payload.battery as battery
FROM
"app/#"
响应动作
INSERT INTO
use_statistics (deviceid, temp, humi, rainfall,waterlevel,battery)
VALUES
(${deviceid}, ${temp}, ${humi}, ${rainfall},${waterlevel}, ${battery});
注:
查找bug指令
find / -name emqx
cat emqx.log.1 | grep ERROR