Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. [SOLVED] Cannot get GwWS5100MQTT to connect to cloudmqtt.com

[SOLVED] Cannot get GwWS5100MQTT to connect to cloudmqtt.com

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 5 Posters 4.8k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • bgunnarbB Offline
    bgunnarbB Offline
    bgunnarb
    wrote on last edited by Yveaux
    #1

    Hi!
    I have been tinkering with MySensors for a while now and the goal is to build a HA-system using OpenHAB. For that purpose I want to use a public MQTT broker at cloudmqtt.com. I have built the WS5100MQTT client downloaded from GitHub, using an Arduino Nano and MySensors 2.0 API. I have also built and tested a few sensors which work fine.

    It all works fine part from the issue that I cannot get the client to connect to the cloudmqtt server (m21.cloudmqtt.com) It just tries and tries about every second and on the cloudmqtt log I can see the connection attempts. Cloudmqtt assigns various ports and you cannot choose port number. Ports I have used are e.g. 15536 and 19946. They are not SSL ports.

    I have also tried to connect to a test broker at broker.hivemq.com port 1883 and there the client connects immediately and starts publishing topics.

    I have tried both the Arduino 1.6.11 release and now the 1.6.9 release, both on Windows and Mac.

    So, I have reached the end of the road as far as my knowledge goes. Any ideas are appreciated.

    I have never been so busy since I retired!

    mfalkviddM 1 Reply Last reply
    0
    • bgunnarbB bgunnarb

      Hi!
      I have been tinkering with MySensors for a while now and the goal is to build a HA-system using OpenHAB. For that purpose I want to use a public MQTT broker at cloudmqtt.com. I have built the WS5100MQTT client downloaded from GitHub, using an Arduino Nano and MySensors 2.0 API. I have also built and tested a few sensors which work fine.

      It all works fine part from the issue that I cannot get the client to connect to the cloudmqtt server (m21.cloudmqtt.com) It just tries and tries about every second and on the cloudmqtt log I can see the connection attempts. Cloudmqtt assigns various ports and you cannot choose port number. Ports I have used are e.g. 15536 and 19946. They are not SSL ports.

      I have also tried to connect to a test broker at broker.hivemq.com port 1883 and there the client connects immediately and starts publishing topics.

      I have tried both the Arduino 1.6.11 release and now the 1.6.9 release, both on Windows and Mac.

      So, I have reached the end of the road as far as my knowledge goes. Any ideas are appreciated.

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      Welcome to the NySensors community @bgunnarb! Does the serial debug output say anything interesting?

      1 Reply Last reply
      0
      • bgunnarbB Offline
        bgunnarbB Offline
        bgunnarb
        wrote on last edited by
        #3

        Here is a printout at startup:

        0;255;3;0;9;Attempting MQTT connection...
        IP: 192.168.1.210
        0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
        0;255;3;0;9;TSM:INIT
        0;255;3;0;9;TSM:RADIO:OK
        0;255;3;0;9;TSM:GW MODE
        0;255;3;0;9;TSM:READY
        IP: 192.168.1.210
        0;255;3;0;9;No registration required
        0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
        IP: 192.168.1.210
        0;255;3;0;9;Attempting MQTT connection...
        IP: 192.168.1.210
        0;255;3;0;9;Attempting MQTT connection...
        IP: 192.168.1.210
        0;255;3;0;9;Attempting MQTT connection...
        IP: 192.168.1.210
        0;255;3;0;9;Attempting MQTT connection...

        I am using a fixed IP but have also tried with DHCP without success.

        I have never been so busy since I retired!

        1 Reply Last reply
        0
        • bgunnarbB Offline
          bgunnarbB Offline
          bgunnarb
          wrote on last edited by
          #4

          Here is a copy of the parameter setup in the sketch:

          // Enable these if your MQTT broker requires usenrame/password
          #define MY_MQTT_USER "xxxxxxxx"
          #define MY_MQTT_PASSWORD "yyyyyyyyy"

          // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
          #define MY_IP_ADDRESS 192,168,1,210

          // If using static ip you need to define Gateway and Subnet address as well
          #define MY_IP_GATEWAY_ADDRESS 192,168,1,1
          #define MY_IP_SUBNET_ADDRESS 255,255,255,0

          // MQTT broker ip address or url. Define one or the other.
          #define MY_CONTROLLER_URL_ADDRESS "m21.cloudmqtt.com"
          //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 201

          // The MQTT broker port to to open
          #define MY_PORT 19946

          I have never been so busy since I retired!

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #5

            Could it be something blocking in your router?

            1 Reply Last reply
            0
            • bgunnarbB Offline
              bgunnarbB Offline
              bgunnarb
              wrote on last edited by
              #6

              I have tried opening the port e.g. 19946 to tcp-traffic but no change. Should the port be open to udp as well?

              I have never been so busy since I retired!

              YveauxY 1 Reply Last reply
              0
              • E Offline
                E Offline
                elmezie
                wrote on last edited by
                #7

                I get the same error, using cloudmqtt and also using a python mqtt broker that i have locally installed. It never completes the connect part. Using 2.0 API

                1 Reply Last reply
                0
                • bgunnarbB bgunnarb

                  I have tried opening the port e.g. 19946 to tcp-traffic but no change. Should the port be open to udp as well?

                  YveauxY Offline
                  YveauxY Offline
                  Yveaux
                  Mod
                  wrote on last edited by
                  #8

                  @bgunnarb maybe the mqtt version of the mysensors client is not supported by the broker. I remember a similar issue in the past where RPI contained an older version of mosquitto and that also silently failed.
                  Could also be the reason why it works with one broker and fails on another.
                  Can you find out the mqtt protocol versions supported by the various brokers?

                  http://yveaux.blogspot.nl

                  bgunnarbB 1 Reply Last reply
                  0
                  • YveauxY Yveaux

                    @bgunnarb maybe the mqtt version of the mysensors client is not supported by the broker. I remember a similar issue in the past where RPI contained an older version of mosquitto and that also silently failed.
                    Could also be the reason why it works with one broker and fails on another.
                    Can you find out the mqtt protocol versions supported by the various brokers?

                    bgunnarbB Offline
                    bgunnarbB Offline
                    bgunnarb
                    wrote on last edited by
                    #9

                    @Yveaux I am so terribly embarrassed! In order to rule out something wrong with the WS5100 I rebuilt the GW using an old Arduino UNO with an Ethernet shield. Still same problem. Then to really make sure I pasted/copied username and password from the cloudmqtt into the sketch. Immediate success! It turned out that I had misread an uppercase I (indigo) for a lower case l (lima). Still the suggestions from the community were good since I could iron out one possible cause after another. Thanks for the support!

                    I have never been so busy since I retired!

                    1 Reply Last reply
                    3
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    23

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular