本地MQTT代理在桥接到云MQTT代理时未读取.conf文件

本地MQTT代理在桥接到云MQTT代理时未读取.conf文件,mqtt,mosquitto,Mqtt,Mosquitto,我正在尝试将我的本地mqtt代理连接到DIoTY云代理。我已根据需要引用并更改了所有配置文件。我的/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.ex

我正在尝试将我的本地mqtt代理连接到DIoTY云代理。我已根据需要引用并更改了所有配置文件。我的/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

我在conf.d中创建了单独的cloud.conf文件

# Config file for mosquitto

# See mosquitto.conf(5) for more information.

user mosquitto
max_queued_messages 200
message_size_limit 0
allow_zero_length_clientid true
allow_duplicate_messages false

listener 1883
autosave_interval 900
autosave_on_changes false
persistence true
persistence_file mosquitto.db
allow_anonymous true

connection dioty
address mqtt.dioty.co:1883
bridge_attempt_unsubscribe false
remote_username *******
remote_password *******
start_type automatic
bridge_protocol_version mqttv311
notifications false
try_private true
bridge_insecure false
cleansession false
topic # in 0
启动代理后的MOSQUITO日志如下

1608537228: mosquitto version 1.6.12 starting
1608537228: Config loaded from /etc/mosquitto/mosquitto.conf.
1608537228: Opening ipv4 listen socket on port 1883.
1608537228: Opening ipv6 listen socket on port 1883.
1608537228: mosquitto version 1.6.12 running
1608539039: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.

我认为我的本地mqtt没有读取.conf文件。如何修复此问题?

您正在使用Losant配置来配置DIOTY broket,但由于两者都是不同的代理,因此无法正常工作

要在
mosquitto
config中保存凭据,首先必须使用
mosquitto\u passwd

mosquitto_passwd -c /etc/mosquitto/passwd USER PASSWORD
然后将密码文件位置添加到
mosquitto
config也设置
allow_anonymouse=false

allow_anonymous false
password_file /etc/mosquitto/passwd
现在您只需使用发布或订阅即可

mosquitto_pub -h localhost -t "test" -m "hello world

mosquitto_sub -h localhost -t test

解释如何启动代理的问题,即
/etc/mosquitcho/mosquitcho.conf
,并包括启动时输出的mosquitcho日志,以便我们可以看到它使用了哪些文件,它启动了哪些侦听器和版本号
cloud.conf
文件上的文件权限是什么?另外,我看你缺少
remote\u clientid
bridge\u证书
,并且使用了错误的端口(1883,而不是8883)在问题开头的链接中提到,也
cloud.conf
文件具有所有读写权限我没有使用安全代理端口1883而不是8883,并且不需要证书或
远程客户端ID