./mosquitto_pub -h broker.mqttdashboard.com -u ADMIN -P ADMIN -t loog/ac88u/I -i pve -m ‘{“2.4G”:"’$(wl -i nvram get wl0_ifname
phy_tempsense | awk ‘{print KaTeX parse error: Expected 'EOF', got '}' at position 11: 1 / 2 + 20}̲')'","5G":"'(wl -i nvram get wl1_ifname
phy_tempsense | awk ‘{print KaTeX parse error: Expected 'EOF', got '}' at position 11: 1 / 2 + 20}̲')'","CPU":"'(cat /proc/dmu/temperature| sed -e ‘s/[^0-9]//g’)’",“WANIP”:"’$(nvram get wan0_realip_ip)’"}’
MQTT收到的信息
接收到主题: loog/ac88u/I 发来的消息: {“2.4G”:“43.5”,“5G”:“50”,“CPU”:“64”,“WANIP”:“8.8.8.8”}
通过MQTT客户端一键推送,想要什么信息自己修改命令即可
把上面的命令存成脚本文件upmqtt.sh 执行定时任务
echo ‘*/6 * * * * /jffs/scripts/mosquitto/upmqtt.sh’>>/var/spool/cron/crontabs/admin
crontab -l
crond
admin是的路由器用户名如果你改过要用你修改后的名字,不然系统不执行定时任务
mosquitto_pub客户端下载
https://cloud.189.cn/web/share?code=MbmyYfNfaMbe
客户端绿色版扔进路由器给予权限就可以了