在我目前的设置中,我使用ebusd
我的加热系统读取数据,它工作得非常好。在下一步中,我想将此数据发送到 Google IoT Core 设备。不幸ebusd
的是不支持在clientid
外部设置。
为了规避这个问题,我安装了一个本地 Mosquitto Broker,它在我的 Raspberry Pi 中接受不安全的消息,并将它们桥接到 Google IoT Core Broker。以下是我配置本地 Mosquitto Broker 的方式:
# 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 的 AWS IoT,但我得到了
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.
在谷歌搜索了一段时间后,我发现了这个博客(参见http://community.onion.io/topic/2858/omega-onion-connecting-to-cloud-cloud-iot/2),其中指出 Google Cloud IoT Core 不支持“子经纪人”的联系,但我没有找到第二个声明相同的声明。
任何人都可以确认我正在尝试做一些不可能的事情,或者请帮助正确配置代理?