我在我的Ubuntu16.04服务器上启动并运行了摩斯基托。我在两部手机上使用猫头鹰轨道,让他们订阅对方的话题。
然后在上周的某个时候,两部手机都失去了另一部手机的话题,紧随其后的是第二部没有连接到MQTT的手机。
然后,今天我使用webhooks在端口8083上添加了一个新的侦听器。我能够连接到一个网络管理界面,并订阅电话1的主题。
我订阅了使用CLI,看看我是否可以发布从网络接口与电话2的用户,以做一些故障排除。当我断开连接并试图重新连接(与电话2和电话1用户)时,我无法重新连接到MQTT。
我重新启动了MQTT,并且能够重新建立连接,但是现在当我发布任何内容时,订阅服务器中什么都不会出现。电话1不再出现,甚至CLI也不会正确地发布。
我想我在配置中弄坏了什么东西。
mosquitto.conf
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
persistence_file mosquitto.db
log_dest file /var/log/mosquitto/mosquitto.log
log_type error
log_type warning
log_type notice
log_type information
connection_messages true
log_timestamp true
password_file /etc/mosquitto/pwfile
acl_file /etc/mosquitto/aclfile.acl
#Internal Listener
listener 1883
allow_anonymous false
#External Listener
#listener 8883
#allow_anonymous false
#certfile /etc/letsencrypt/live/home.fqdn.com/cert.pem
#cafile /etc/letsencrypt/live/home.fqdn.com/chain.pem
#keyfile /etc/letsencrypt/live/home.fqdn.com/privkey.pem
#Webhooks Listener
listener 8083
protocol websockets
certfile /etc/letsencrypt/live/home.fqdn.com/cert.pem
cafile /etc/letsencrypt/live/home.fqdn.com/chain.pem
keyfile /etc/letsencrypt/live/home.fqdn.com/privkey.pemaclfile.acl
# This affects access control for clients with no username.
topic read $SYS/#
# This only affects clients with username "phone1".
topic owntracks/phone1/phone-1
topic read owntracks/phone2/phone-2
# This only affects clients with username "phone2".
topic owntracks/phone2/phone-2
topic read owntracks/phone1/phone-1
# This affects all clients.
pattern write $SYS/broker/connection/%c/state发布于 2018-03-22 19:56:16
在每个topic/pattern块之前,应该有一个user条目来说明它们应用于哪个用户:
# This affects access control for clients with no username.
topic read $SYS/#
# This only affects clients with username "phone1".
user phone1
topic owntracks/phone1/phone-1
topic read owntracks/phone2/phone-2
# This only affects clients with username "phone2".
user phone2
topic owntracks/phone2/phone-2
topic read owntracks/phone1/phone-1
# This affects all clients.
pattern write $SYS/broker/connection/%c/statehttps://stackoverflow.com/questions/49437006
复制相似问题