{"id":179513,"date":"2021-05-04T23:35:16","date_gmt":"2021-05-05T06:35:16","guid":{"rendered":"https:\/\/m2msupport.net\/m2msupport\/?page_id=179513"},"modified":"2021-05-04T23:47:01","modified_gmt":"2021-05-05T06:47:01","slug":"add-a-gateway-device-in-google-cloud-platform-gcp-using-iot-cloud-tester","status":"publish","type":"page","link":"https:\/\/m2msupport.net\/m2msupport\/add-a-gateway-device-in-google-cloud-platform-gcp-using-iot-cloud-tester\/","title":{"rendered":"Add a gateway device in Google Cloud Platform (GCP) using IoT Cloud Tester"},"content":{"rendered":"<p>Gateway devices connect its client devices to the Google Cloud Platform. Gateway devices can authenticate and send data on behalf of its client devices.<\/p>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/download-iot-cloud-tester\/\">IoT Cloud Tester<\/a>\u00a0 application provides an easy interface to create gateway devices in Google Cloud platform.<\/p>\n<h1>To create a gateway in Google Cloud project,<\/h1>\n<ul>\n<li>Select the project.<\/li>\n<li>In the &#8216;Gateways&#8217; tab, select the region, registry and press &#8216;Add Gateway&#8217;.<\/li>\n<li>Gateway ID is automatically generated but that can be changed.<\/li>\n<\/ul>\n<p>Following information are required to create a gateway device in Google Cloud,<\/p>\n<ul>\n<li>Gateway ID<\/li>\n<li>Project ID<\/li>\n<li>Cloud Region<\/li>\n<li>Registry<\/li>\n<\/ul>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/create_gateway.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-179552\" src=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/create_gateway.png\" alt=\"\" width=\"1002\" height=\"735\" srcset=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/create_gateway.png 1002w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/create_gateway-300x220.png 300w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/create_gateway-768x563.png 768w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/create_gateway-600x440.png 600w\" sizes=\"auto, (max-width: 1002px) 100vw, 1002px\" \/><\/a><\/p>\n<p>To create a gateway in GCP, a post request is made to the below URL. IoT Cloud Tester tool generates the device key for the Gateway and includes it as a post parameter.<\/p>\n<p><strong>Request sent to GCP to create new device registry.<\/strong><\/p>\n<p>POST:https:\/\/cloudiot.googleapis.com\/v1\/projects\/iot-cloud-tutorial\/locations\/asia-east1\/registries\/reg_193129\/devices<\/p>\n<p>{<\/p>\n<p>&#8220;credentials&#8221; : [ {<\/p>\n<p>&#8220;publicKey&#8221; : {<\/p>\n<p>&#8220;format&#8221; : &#8220;RSA_PEM&#8221;,<\/p>\n<p>&#8220;key&#8221; : &#8220;&#8212;&#8211;BEGIN PUBLIC KEY&#8212;&#8211;\\r\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiYG3gcPCuQZlrhb8M+tQ\\r\\nxPuQCMQokHFuLJB8OCcM84Q7WCCu+x3rXvFR1i6XMqLVg+b4RdsrNn9Ln1Cr9f8S\\r\\ne48gcwbNbu0Q24LWUkdgiLhMEVj4llpVYBmxB91\/b+8VIZzVzqNjdKoZC9c0s\\r\\nrtyb0Knm85fxFGcmgJxITSo\/JOEYIc+E3h66reG+eJrNAQCnuGADqhm816Q\/4xzh\\r\\nVqXawxhQa+5g1tDrGdbyaPkpNW\/ioO8sQUE2Yx2Rcxm85hkQBywThs1kfxylh\\r\\nhRH9YLbMpt270wK40ALfT8ibRBfa9kL9xMwBAvk4VckkipuR4vhnZQGmdwYLlq4W\\r\\n1wIDAQAB\\r\\n&#8212;&#8211;END PUBLIC KEY&#8212;&#8211;\\r\\n&#8221;<\/p>\n<p>}<\/p>\n<p>} ],<\/p>\n<p>&#8220;gatewayConfig&#8221; : {<\/p>\n<p>&#8220;gatewayAuthMethod&#8221; : &#8220;ASSOCIATION_ONLY&#8221;,<\/p>\n<p>&#8220;gatewayType&#8221; : &#8220;GATEWAY&#8221;<\/p>\n<p>},<\/p>\n<p>&#8220;id&#8221; : &#8220;gw_32110&#8221;<\/p>\n<p>}<\/p>\n<p><strong>Response for GCP for gateway creation.\u00a0<\/strong><\/p>\n<p>{<\/p>\n<p>&#8220;config&#8221; : {<\/p>\n<p>&#8220;cloudUpdateTime&#8221; : &#8220;2021-05-05T06:20:56.063326Z&#8221;,<\/p>\n<p>&#8220;version&#8221; : 1<\/p>\n<p>},<\/p>\n<p>&#8220;credentials&#8221; : [ {<\/p>\n<p>&#8220;expirationTime&#8221; : &#8220;1970-01-01T00:00:00Z&#8221;,<\/p>\n<p>&#8220;publicKey&#8221; : {<\/p>\n<p>&#8220;format&#8221; : &#8220;RSA_PEM&#8221;,<\/p>\n<p>&#8220;key&#8221; : &#8220;&#8212;&#8211;BEGIN PUBLIC KEY&#8212;&#8211;\\r\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiYG3gcPCuQZlrhb8M+tQ\\r\\nxPuQCMQokHFuLJB8OCcM84Q7WCCu+x3rXvFR1i6XMqLVg+b4RdsrNn9Ln1Cr9f8S\\r\\ne48gcwbNbu0Q24LVu0oUkdgiLhMEVj4llpVYBmxB91\/b+8VIZzVzqNjdKoZC9c0s\\r\\nrtybm85fxFGcmgJxITSo\/JOEYIc+E3h66reG+eJrNAQCnuGADqhm816Q\/4xzh\\r\\nVqXawxbkVhQa+5g1tDrGdbyaPkpNW\/ioO8sQUE2Yx2Rcxm85hkQBywThs1kfdsdslh\\r\\nhRH9YLbMpt270wK40ALfT8ibRBfa9kL9xMwBAvk4VckkipuR4vhnZQGmdwYLlq4W\\r\\n1wIDAQAB\\r\\n&#8212;&#8211;END PUBLIC KEY&#8212;&#8211;\\r\\n&#8221;<\/p>\n<p>}<\/p>\n<p>} ],<\/p>\n<p>&#8220;gatewayConfig&#8221; : {<\/p>\n<p>&#8220;gatewayAuthMethod&#8221; : &#8220;ASSOCIATION_ONLY&#8221;,<\/p>\n<p>&#8220;gatewayType&#8221; : &#8220;GATEWAY&#8221;<\/p>\n<p>},<\/p>\n<p>&#8220;id&#8221; : &#8220;gw_32110&#8221;,<\/p>\n<p>&#8220;name&#8221; : &#8220;projects\/iot-cloud-tutorial\/locations\/asia-east1\/registries\/reg_193129\/devices\/3145477801942776&#8221;,<\/p>\n<p>&#8220;numId&#8221; : 3145477801942776<\/p>\n<p>}<\/p>\n<p><code><br \/>\n<\/code><br \/>\nThe added gateway can be viewed in the Google Cloud console.<\/p>\n<p>https:\/\/console.cloud.google.com\/iot\/locations\/asia-east1\/registries\/reg_193129\/gateways?project=iot-cloud-tutorial<\/p>\n<p><a href=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/gateway_in_gcp.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-179569\" src=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/gateway_in_gcp.png\" alt=\"\" width=\"1550\" height=\"830\" srcset=\"https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/gateway_in_gcp.png 1550w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/gateway_in_gcp-300x161.png 300w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/gateway_in_gcp-768x411.png 768w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/gateway_in_gcp-1024x548.png 1024w, https:\/\/m2msupport.net\/m2msupport\/wp-content\/uploads\/2021\/05\/gateway_in_gcp-600x321.png 600w\" sizes=\"auto, (max-width: 1550px) 100vw, 1550px\" \/><\/a><\/p>\n<div class=\"video-responsive\"><iframe loading=\"lazy\" id=\"youTubePlayer\" src=\"https:\/\/www.youtube.com\/embed\/1u1nhvmnRAg?hd=1\" width=\"750\" height=\"421\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Gateway devices connect its client devices to the Google Cloud Platform. Gateway devices can authenticate and send data on behalf of its client devices. IoT Cloud Tester\u00a0 application provides an easy interface to create gateway devices in Google Cloud platform. &hellip; <a href=\"https:\/\/m2msupport.net\/m2msupport\/add-a-gateway-device-in-google-cloud-platform-gcp-using-iot-cloud-tester\/\">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-179513","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/179513","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=179513"}],"version-history":[{"count":2,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/179513\/revisions"}],"predecessor-version":[{"id":179592,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/179513\/revisions\/179592"}],"wp:attachment":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/media?parent=179513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}