From 489b6a3c10ccaff0fd0de55b5030e2992d122a7b Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 18 Nov 2025 15:41:51 +0800
Subject: [PATCH] update mqttd program to compatble with android app
---
project/4.mqttd/etc/iotd.conf | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/project/4.mqttd/etc/mqttd.conf b/project/4.mqttd/etc/iotd.conf
similarity index 63%
rename from project/4.mqttd/etc/mqttd.conf
rename to project/4.mqttd/etc/iotd.conf
index 8417746..a32c09f 100644
--- a/project/4.mqttd/etc/mqttd.conf
+++ b/project/4.mqttd/etc/iotd.conf
@@ -1,14 +1,17 @@
[common]
-devid="RPi3B#01"
+devid="rpi001"
-# 树莓派连接的外设信息,0:禁用或未连接 其他: 使能或相关硬件连接的Pin管脚(wPI模式)
+# 树莓派连接的外设信息,0:禁用或未连接
[hardware]
# 是否使能 RGB 三色灯模块,0:禁用 1:使能
rgbled=1
+# 是否使能继电器模块,0:禁用 1:使能
+relay=0
+
# 是否使能 DS18b20 温度传感器模块,0:禁用 1:使能
-ds18b20=1
+ds18b20=0
# 是否使能 SHT2X 温湿度传感器模块,0:禁用 1:使能
sht2x=1
@@ -16,7 +19,7 @@
[logger]
# 日志记录文件
-file=/tmp/mqttd.log
+file=/var/log/iotd.log
# 日志级别: 0:ERROR 1:WARN 2:INFO 3:DEBUG 4:TRACE
level=2
@@ -44,7 +47,7 @@
[publisher]
-# mosquitto_sub -h main.iot-yun.club -p 10883 -u lingyun -P lingyun -t \$Sys/Studio/Uplink
+# mosquitto_sub -h weike-iot.com -p 8013 -u lingyun -P lingyun -t \$Sys/Studio/Uplink/rpi001
pubTopic="$Sys/Studio/Uplink"
pubQos=0
@@ -53,7 +56,10 @@
[subsciber]
-# mosquitto_pub -h main.iot-yun.club -p 10883 -u lingyun -P lingyun -t \$Sys/Studio/Downlink -m '{"id":"RPi3B#01", "leds":[{"red":"on","green":"off","blue":"on"}]}'
+# mosquitto_pub -h weike-iot.com -p 8013 -u lingyun -P lingyun -t \$Sys/Studio/Downlink/rpi001 -m '{ "RedLed":"on" }'
+# mosquitto_pub -h weike-iot.com -p 8013 -u lingyun -P lingyun -t \$Sys/Studio/Downlink/rpi001 -m '{ "GreenLed":"on" }'
+# mosquitto_pub -h weike-iot.com -p 8013 -u lingyun -P lingyun -t \$Sys/Studio/Downlink/rpi001 -m '{ "BlueLed":"on" }'
+# mosquitto_pub -h weike-iot.com -p 8013 -u lingyun -P lingyun -t \$Sys/Studio/Downlink/rpi001 -m '{ "Relay":"on" }'
subTopic="$Sys/Studio/Downlink"
subQos=0
--
Gitblit v1.9.1