{"id":188139,"date":"2021-06-23T23:24:08","date_gmt":"2021-06-24T06:24:08","guid":{"rendered":"https:\/\/m2msupport.net\/m2msupport\/?page_id=188139"},"modified":"2021-06-23T23:42:12","modified_gmt":"2021-06-24T06:42:12","slug":"mqtt-connection-not-authorized-to-connect-google-iot","status":"publish","type":"page","link":"https:\/\/m2msupport.net\/m2msupport\/mqtt-connection-not-authorized-to-connect-google-iot\/","title":{"rendered":"MQTT Connection &#8211; Not authorized to connect &#8211; Google IoT"},"content":{"rendered":"<p>When connecting to the MQTT bridge in Google Cloud Platform, an application may encounter connection error.<\/p>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/download-iot-cloud-tester\/\">IoT Cloud Tester<\/a>\u00a0 application will return this error if\u00a0 MQTT protocol is not enabled for the device registry. Also if the public key has not been uploaded to the device, MQTT connection error is returned.<\/p>\n<p>In the below example, MQTT is not enabled for registry reg_702539, so MQTT connection error is returned.<\/p>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_connection_error.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-188141\" src=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_connection_error.png\" alt=\"\" width=\"848\" height=\"725\" srcset=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_connection_error.png 848w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_connection_error-300x256.png 300w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_connection_error-768x657.png 768w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_connection_error-600x513.png 600w\" sizes=\"auto, (max-width: 848px) 100vw, 848px\" \/><\/a><\/p>\n<h1>To fix this error, enable MQTT for the device registry,<\/h1>\n<ul>\n<li>Go to Google IoT console and enable MQTT for the device registry.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_not_enabled.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-188147\" src=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_not_enabled.png\" alt=\"\" width=\"1248\" height=\"879\" srcset=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_not_enabled.png 1248w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_not_enabled-300x211.png 300w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_not_enabled-768x541.png 768w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_not_enabled-1024x721.png 1024w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/mqtt_not_enabled-600x423.png 600w\" sizes=\"auto, (max-width: 1248px) 100vw, 1248px\" \/><\/a><\/p>\n<ul>\n<li>Verify if public key has been uploaded for the device.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/public_key_not_uploaded.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-188149\" src=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/public_key_not_uploaded.png\" alt=\"\" width=\"1261\" height=\"834\" srcset=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/public_key_not_uploaded.png 1261w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/public_key_not_uploaded-300x198.png 300w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/public_key_not_uploaded-768x508.png 768w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/public_key_not_uploaded-1024x677.png 1024w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/06\/public_key_not_uploaded-600x397.png 600w\" sizes=\"auto, (max-width: 1261px) 100vw, 1261px\" \/><\/a><\/p>\n<div class=\"video-responsive\"><iframe loading=\"lazy\" id=\"youTubePlayer\" src=\"https:\/\/www.youtube.com\/embed\/6wcpnDEDPIQ?hd=1\" width=\"750\" height=\"421\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When connecting to the MQTT bridge in Google Cloud Platform, an application may encounter connection error. IoT Cloud Tester\u00a0 application will return this error if\u00a0 MQTT protocol is not enabled for the device registry. Also if the public key has &hellip; <a href=\"https:\/\/m2msupport.net\/m2msupport\/mqtt-connection-not-authorized-to-connect-google-iot\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"iot_tutorial_template.php","meta":{"footnotes":""},"class_list":["post-188139","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/188139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/comments?post=188139"}],"version-history":[{"count":3,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/188139\/revisions"}],"predecessor-version":[{"id":188150,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/188139\/revisions\/188150"}],"wp:attachment":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/media?parent=188139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}