Connect local Mosquitto MQTT broker to Google Cloud IoT











up vote
0
down vote

favorite
1












In my current setup i read data using ebusd from my heating system which works perfectly fine. In the next step i'd like to send this data to a Google IoT Core Device. Unfortunately ebusd does not support setting the clientid externally.



To circumvent this i installed a local Mosquitto Broker which accepts unsecured messages in my Raspberry Pi and shall bridge them to the Google IoT Core Broker. Here is how i configured my local 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


Although this setup works with AWS IoT with Google Cloud IoT i get



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.


After googling some time i found this blog (see http://community.onion.io/topic/2858/omega-onion-connecting-to-cloud-cloud-iot/2) which states that Google Cloud IoT Core does not support connections by "sub-brokers" but i didn't find a second statement claiming the same.



Can anybody either confirm that i am trying to do something impossible or please help with with configuring the broker properly?










share|improve this question


























    up vote
    0
    down vote

    favorite
    1












    In my current setup i read data using ebusd from my heating system which works perfectly fine. In the next step i'd like to send this data to a Google IoT Core Device. Unfortunately ebusd does not support setting the clientid externally.



    To circumvent this i installed a local Mosquitto Broker which accepts unsecured messages in my Raspberry Pi and shall bridge them to the Google IoT Core Broker. Here is how i configured my local 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


    Although this setup works with AWS IoT with Google Cloud IoT i get



    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.


    After googling some time i found this blog (see http://community.onion.io/topic/2858/omega-onion-connecting-to-cloud-cloud-iot/2) which states that Google Cloud IoT Core does not support connections by "sub-brokers" but i didn't find a second statement claiming the same.



    Can anybody either confirm that i am trying to do something impossible or please help with with configuring the broker properly?










    share|improve this question
























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      In my current setup i read data using ebusd from my heating system which works perfectly fine. In the next step i'd like to send this data to a Google IoT Core Device. Unfortunately ebusd does not support setting the clientid externally.



      To circumvent this i installed a local Mosquitto Broker which accepts unsecured messages in my Raspberry Pi and shall bridge them to the Google IoT Core Broker. Here is how i configured my local 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


      Although this setup works with AWS IoT with Google Cloud IoT i get



      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.


      After googling some time i found this blog (see http://community.onion.io/topic/2858/omega-onion-connecting-to-cloud-cloud-iot/2) which states that Google Cloud IoT Core does not support connections by "sub-brokers" but i didn't find a second statement claiming the same.



      Can anybody either confirm that i am trying to do something impossible or please help with with configuring the broker properly?










      share|improve this question













      In my current setup i read data using ebusd from my heating system which works perfectly fine. In the next step i'd like to send this data to a Google IoT Core Device. Unfortunately ebusd does not support setting the clientid externally.



      To circumvent this i installed a local Mosquitto Broker which accepts unsecured messages in my Raspberry Pi and shall bridge them to the Google IoT Core Broker. Here is how i configured my local 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


      Although this setup works with AWS IoT with Google Cloud IoT i get



      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.


      After googling some time i found this blog (see http://community.onion.io/topic/2858/omega-onion-connecting-to-cloud-cloud-iot/2) which states that Google Cloud IoT Core does not support connections by "sub-brokers" but i didn't find a second statement claiming the same.



      Can anybody either confirm that i am trying to do something impossible or please help with with configuring the broker properly?







      mqtt mosquitto google-cloud-iot






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      thomasee

      605




      605
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I reached out to the author of that blog and other people who work on Cloud IoT Core and unfortunately it seems like MQTT bridging indeed is currently not supported. In the meantime, it seems like you're in contact with the ebusd owner on Github to add a configurable clientid feature, which would be a good temporary fix.



          With that said, we have a feature that will be going into beta soon that will help you address this kind of issue specifically, so stay tuned!






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372656%2fconnect-local-mosquitto-mqtt-broker-to-google-cloud-iot%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I reached out to the author of that blog and other people who work on Cloud IoT Core and unfortunately it seems like MQTT bridging indeed is currently not supported. In the meantime, it seems like you're in contact with the ebusd owner on Github to add a configurable clientid feature, which would be a good temporary fix.



            With that said, we have a feature that will be going into beta soon that will help you address this kind of issue specifically, so stay tuned!






            share|improve this answer



























              up vote
              0
              down vote













              I reached out to the author of that blog and other people who work on Cloud IoT Core and unfortunately it seems like MQTT bridging indeed is currently not supported. In the meantime, it seems like you're in contact with the ebusd owner on Github to add a configurable clientid feature, which would be a good temporary fix.



              With that said, we have a feature that will be going into beta soon that will help you address this kind of issue specifically, so stay tuned!






              share|improve this answer

























                up vote
                0
                down vote










                up vote
                0
                down vote









                I reached out to the author of that blog and other people who work on Cloud IoT Core and unfortunately it seems like MQTT bridging indeed is currently not supported. In the meantime, it seems like you're in contact with the ebusd owner on Github to add a configurable clientid feature, which would be a good temporary fix.



                With that said, we have a feature that will be going into beta soon that will help you address this kind of issue specifically, so stay tuned!






                share|improve this answer














                I reached out to the author of that blog and other people who work on Cloud IoT Core and unfortunately it seems like MQTT bridging indeed is currently not supported. In the meantime, it seems like you're in contact with the ebusd owner on Github to add a configurable clientid feature, which would be a good temporary fix.



                With that said, we have a feature that will be going into beta soon that will help you address this kind of issue specifically, so stay tuned!







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 11 hours ago

























                answered 11 hours ago









                Alex Hong

                113




                113






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372656%2fconnect-local-mosquitto-mqtt-broker-to-google-cloud-iot%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                    Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                    A Topological Invariant for $pi_3(U(n))$