按照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)
...
Run Code Online (Sandbox Code Playgroud)
我修改配置文件只启用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
Run Code Online (Sandbox Code Playgroud)
我甚至测试使用示例password_file和acl_file,但同样的错误.在谷歌搜索,也没有结果,任何人都可以帮忙吗?谢谢.
1429857949:发送CONNACK到127.0.0.1(0,5)
CONNACK返回码为5表示未授权连接.如果它与allow_anonymous = true一起使用,那么听起来您的客户端没有发送用户名/或者没有发送正确的用户名和密码.
看起来您正在运行Paho Python客户端.
| 归档时间: |
|
| 查看次数: |
13906 次 |
| 最近记录: |