【问题标题】:Publish data from MQTT.fx to Cloud IoT Core将数据从 MQTT.fx 发布到 Cloud IoT Core
【发布时间】:2017-12-21 12:43:06
【问题描述】:

使用 CloudIotCore 文档,我可以在我的 Google 云平台项目中运行 Quickstart 示例和 EndtoEnd 示例。

使用 MQTT.fx 工具我无法连接到同一个 Google 云项目

Username      : unused
Password      : Generated from cretae_jwt function using code in cloudiot_pubsub_example_mqtt_device.py
Broker Address: mqtt.googleapis.com
Broker Port:    8883 
Client ID:      projects/myprojectid/locations/us-central1/registries/myregistryid/devices/mydeviceid

{ 在上述行中,我更改了我的项目和设备详细信息 }

错误: MQTTException 错误

2017-12-21 17:42:51,785  INFO --- Start App                      : Style: LIGHT /styles/mqttfx_theme_light.css
2017-12-21 17:42:52,137  INFO --- Start App                      : An update is availabe.
2017-12-21 17:42:55,668  INFO --- ScriptingManager               : Found action with name: Switch Fountain Test
2017-12-21 17:43:30,034  INFO --- BrokerConnectorController      : onConnect
2017-12-21 17:43:30,086  INFO --- MqttFX ClientModel             : MqttClient with ID projects/myprojectid/locations/us-central1/registries/myregistryid/devices/mydeviceid assigned.
2017-12-21 17:43:30,500 ERROR --- MqttFX ClientModel             : Error when connecting
org.eclipse.paho.client.mqttv3.MqttException: MqttException
    at 2017-12-21 17:43:30,505 ERROR --- MqttFX ClientModel             : Please verify your Settings (e.g. Broker Address, Broker Port & Client ID) and the user credentials!

【问题讨论】:

    标签: google-cloud-platform mqtt google-cloud-iot


    【解决方案1】:

    几点说明:

    • 您的密码将在 3600 秒后过期
    • 在使用 MQTT.fx 连接之前,我必须从对话框中启用 TLS 1.3

    连接后,您将只能发布到特定于设备的主题,并且只能订阅特定于设备的配置更改。

    如果您需要使用 Java,那里有 Java 示例,当您需要每小时重新生成密码时,使用客户端似乎不太理想。

    【讨论】:

      猜你喜欢
      • 2020-05-16
      • 1970-01-01
      • 2022-06-12
      • 2020-08-12
      • 2021-01-24
      • 1970-01-01
      • 2019-08-31
      • 1970-01-01
      • 2018-10-11
      相关资源
      最近更新 更多