acl - mosquitto 1.4 - 一旦启用 ACL 运行,就会获取 "Socket error on client <unknown>, disconnecting"

标签 acl mosquitto

按照 Jeremy Gooch 的说明,请参阅 http://goochgooch.co.uk/2014/08/01/building-mosquitto-1-4/ ,我通过 RPi 上的 websockets 安装了 mosquitto。我可以将消息子/发布到测试站点 http://test.mosquitto.org/ws.html

从那时起,我在 mosquitto.conf 中启用了用户和主题访问控制以进行更多测试,但奇怪的是,当我再次启动 mosquitto 时,我每秒看到套接字错误...

sudo /usr/local/sbin/mosquitto -v -c /etc/mosquitto/mosquitto.conf

 1429857948: mosquitto version 1.4 (build date 2015-04-20 22:04:51+0800) starting
1429857948: Config loaded from /etc/mosquitto/mosquitto.conf.
1429857948: Opening ipv4 listen socket on port 1883.
1429857948: Opening ipv6 listen socket on port 1883.
1429857948: Warning: Address family not supported by protocol
1429857949: New connection from 127.0.0.1 on port 1883.
1429857949: Sending CONNACK to 127.0.0.1 (0, 5)
1429857949: Socket error on client <unknown>, disconnecting.
1429857950: New connection from 127.0.0.1 on port 1883.
1429857950: Sending CONNACK to 127.0.0.1 (0, 5)
...

我修改配置文件以仅启用 ACL,注释掉所有其他内容,套接字错误仍然存​​在。配置文件现在看起来:

sudo nano /etc/mosquitto/mosquitto.conf

autosave_interval 1800
persistence true
persistence_file m2.db
persistence_location /var/tmp/
connection_messages true
log_timestamp true
log_dest stderr
log_type error
log_type warning
log_type debug

allow_anonymous false
password_file /etc/mosquitto/mqtt.pw
acl_file /etc/mosquitto/mqtt.acl

port 1883
protocol mqtt

我什至测试使用示例password_file和acl_file,但同样的错误。 谷歌搜索也没有结果,有人可以帮忙吗?谢谢。

最佳答案

1429857949: Sending CONNACK to 127.0.0.1 (0, 5)

CONNACK 返回代码 5 表示连接未经授权。如果它 与allow_anonymous=true一起使用,那么听起来你的客户端不是 发送用户名/或未发送正确的用户名和密码。

您似乎正在运行 Paho Python 客户端。

关于acl - mosquitto 1.4 - 一旦启用 ACL 运行,就会获取 "Socket error on client <unknown>, disconnecting",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29840984/

相关文章:

php - 需要在单个资源 Controller 中使用 Entrust 角色的建议 - Laravel5

c# - 无法在 Ubuntu 上匿名连接到 Mosquitto 2.0.5

linux - 无法将 mosquitto-clients 从 1.4.15 更新到 1.6.9

c - C 中的 mosquitto 和 SSL/TLS

java - 在思科交换机/路由器中执行脚本

Symfony2 ACL 结合另一个标准

magento - 具有自定义角色的用户无法访问 Magento 管理界面中的自定义菜单项

php - Cakephp 2 ACL ERR_TOO_MANY_REDIRECTS

node.js - 无法使用 Node.js mqtt 库连接到 Eclipse Mosquitto 代理

mqtt - 泛美卫生组织客户端如何知道网桥连接的状态?