将本地MOSQUITO MQTT代理连接到谷歌云物联网

将本地MOSQUITO MQTT代理连接到谷歌云物联网,mqtt,mosquitto,google-cloud-iot,Mqtt,Mosquitto,Google Cloud Iot,在我当前的设置中,我使用ebusd从工作正常的加热系统读取数据。在下一步中,我想将这些数据发送到谷歌物联网核心设备。不幸的是,ebusd不支持从外部设置clientid 为了避免这种情况,我安装了一个本地的Mosquetto代理,它在我的Raspberry Pi中接受不安全的消息,并将它们连接到Google IoT核心代理。以下是我如何配置本地MOSQUITO代理的: # Place your local configuration in /etc/mosquitto/conf.d/ # # A

在我当前的设置中,我使用
ebusd
从工作正常的加热系统读取数据。在下一步中,我想将这些数据发送到谷歌物联网核心设备。不幸的是,
ebusd
不支持从外部设置
clientid

为了避免这种情况,我安装了一个本地的Mosquetto代理,它在我的Raspberry Pi中接受不安全的消息,并将它们连接到Google IoT核心代理。以下是我如何配置本地MOSQUITO代理的:

# 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_type all
log_dest file /var/log/mosquitto/mosquitto.log

# Goolge IoT Core Configuration

connection bridge-to-gcp

address mqtt.googleapis.com:8883

bridge_attempt_unsubscribe false
bridge_certfile /home/pi/certificates/rsa_cert.pem
bridge_keyfile /home/pi/certificates/rsa_private.pem
bridge_cafile /home/pi/certificates/roots.pem
bridge_protocol_version mqttv311
bridge_insecure false

tls_version tlsv1.2
try_private true

start_type automatic
cleansession true
notifications false

local_clientid local-to-remote-gcp-bridge

remote_username unused
remote_password <JWT Token generated using jwt.io>
remote_clientid projects/project-251313/locations/europe-west1/registries/prot/devices/ebusd12345

topic # both

include_dir /etc/mosquitto/conf.d
在谷歌搜索了一段时间后,我发现了这个博客(见),上面说Google Cloud IoT Core不支持“次级经纪人”的连接,但我没有发现第二个声明声称这一点


有人能确认我正在尝试做一些不可能的事情,或者请帮助正确配置代理吗?

我联系了该博客的作者和其他从事云物联网核心工作的人,不幸的是,MQTT桥接目前确实不受支持。与此同时,您似乎正在与Github上的
ebusd
所有者联系,以添加可配置的
clientid
功能,这将是一个很好的临时修复

话虽如此,我们有一个功能将很快进入测试版,它将帮助您解决这类问题,所以请继续关注

1542622526: Connecting bridge bridge-to-gcp (mqtt.googleapis.com:8883)
1542622526: Bridge projects/project-251313/locations/europe-west1/registries/prot/devices/ebusd12345 sending CONNECT
1542622526: Socket error on client local.projects/project-251313/locations/europe-west1/registries/prot/devices/ebusd12345, disconnecting.