MQTT Broker 收不到任何消息
MQTT Broker does not receive any messages
我正在尝试通过 mqtt 连接我的 Tasmota 交换机。我在虚拟机上安装了 mosquitto,配置如下:
/etc/mosquitto/mosquitto.conf
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
/etc/mosquitto/acl
# weewx readwrite to the loop
user tasmota
#topic weather/#
/etc/mosquitto/conf.d/myconfig.conf
allow_anonymous true
password_file /etc/mosquitto/passwd
persistence false
protocol mqtt
acl_file /etc/mosquitto/acl
服务运行,端口开启
这是我的交换机配置
我正在尝试查看
的消息
mosquitto_sub -h 10.11.0.106 -t '#'
也尝试添加用户和密码,但我没有得到任何输出
我可以在日志中看到,连接已建立
1579896351: Config loaded from /etc/mosquitto/mosquitto.conf.
1579896351: Opening ipv4 listen socket on port 1883.
1579896351: Opening ipv6 listen socket on port 1883.
1579896351: New connection from 10.10.0.137 on port 1883.
1579896351: New client connected from 10.10.0.137 as mosqsub|19705-warmachin (c1, k60).
1579896358: Socket error on client mosqsub|19705-warmachin, disconnecting.
1579896358: New connection from 10.10.0.137 on port 1883.
1579896358: New client connected from 10.10.0.137 as mosqsub|19775-warmachin (c1, k60).
1579896361: New connection from 10.11.1.51 on port 1883.
1579896361: New client connected from 10.11.1.51 as DVES_6CA231 (c1, k30, u'tasmota').
1579896361: New connection from 10.11.1.52 on port 1883.
1579896361: New client connected from 10.11.1.52 as DVES_301DDC (c1, k30, u'tasmota').
1579896362: New connection from 10.11.1.54 on port 1883.
1579896362: New client connected from 10.11.1.54 as DVES_350992 (c1, k30, u'tasmota').
我是漏掉了什么还是我误解了一些完全错误的东西?
请帮忙
正如评论中所讨论的那样,您的 ACL 文件缺少任何为 anonymous
用户或 tasmota
用户启用的主题。
如果您启用 ACL,则需要定义您希望用户能够访问的所有主题。
我正在尝试通过 mqtt 连接我的 Tasmota 交换机。我在虚拟机上安装了 mosquitto,配置如下:
/etc/mosquitto/mosquitto.conf
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
/etc/mosquitto/acl
# weewx readwrite to the loop
user tasmota
#topic weather/#
/etc/mosquitto/conf.d/myconfig.conf
allow_anonymous true
password_file /etc/mosquitto/passwd
persistence false
protocol mqtt
acl_file /etc/mosquitto/acl
服务运行,端口开启
这是我的交换机配置
我正在尝试查看
的消息mosquitto_sub -h 10.11.0.106 -t '#'
也尝试添加用户和密码,但我没有得到任何输出
我可以在日志中看到,连接已建立
1579896351: Config loaded from /etc/mosquitto/mosquitto.conf.
1579896351: Opening ipv4 listen socket on port 1883.
1579896351: Opening ipv6 listen socket on port 1883.
1579896351: New connection from 10.10.0.137 on port 1883.
1579896351: New client connected from 10.10.0.137 as mosqsub|19705-warmachin (c1, k60).
1579896358: Socket error on client mosqsub|19705-warmachin, disconnecting.
1579896358: New connection from 10.10.0.137 on port 1883.
1579896358: New client connected from 10.10.0.137 as mosqsub|19775-warmachin (c1, k60).
1579896361: New connection from 10.11.1.51 on port 1883.
1579896361: New client connected from 10.11.1.51 as DVES_6CA231 (c1, k30, u'tasmota').
1579896361: New connection from 10.11.1.52 on port 1883.
1579896361: New client connected from 10.11.1.52 as DVES_301DDC (c1, k30, u'tasmota').
1579896362: New connection from 10.11.1.54 on port 1883.
1579896362: New client connected from 10.11.1.54 as DVES_350992 (c1, k30, u'tasmota').
我是漏掉了什么还是我误解了一些完全错误的东西?
请帮忙
正如评论中所讨论的那样,您的 ACL 文件缺少任何为 anonymous
用户或 tasmota
用户启用的主题。
如果您启用 ACL,则需要定义您希望用户能够访问的所有主题。