1

Using CloudIotCore documentation I am able to run Quickstart example and EndtoEnd example in my Google cloud platform project.

Using MQTT.fx tool i am unable to connect to same Google cloud Project

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

{ In the above line i changed my project and device details }

Error: MQTTException error

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!
hardillb
  • 54,545
  • 11
  • 67
  • 105
NITHIN N
  • 35
  • 10

1 Answers1

0

A few notes:

  • Your password will expire after 3600 seconds
  • I had to enable TLS 1.3 from the dialog before connecting using MQTT.fx SSL/TLS settings MQTT.fx

After you connect, you will only be able to publish to device-specific topics and only will be able subscribe to device-specific configuration changes.

There are Java samples out there if you need to use Java, it seems a bit suboptimal to use a client when you'll need to regenerate the password every hour.

class
  • 8,621
  • 29
  • 30