Connection to Hivemq is failing

Hi,

To communicate with my Internet of Things gadget, I’m using Hivemq. In the browser, I can see that the broker is connected.
However, when I run the app from the device, it fails to establish a WebSocket connection and displays the message Connection failed: network unreachable.
The WebSocket information I provided in my application is
mqtt-dashboard.com is the host
Port: 8884.
Therefore, if you could tell me what I’m missing.

Regards
Manoj

Hi @manoj_p

Greetings and welcome to the HiveMQ Community! It’s great to have you here, especially with your interest in MQTT and the HiveMQ broker. We’re always happy to see new users like you.

Thank you for reaching out about your IoT gadget and the connectivity issue you’re facing with HiveMQ. To better assist you, I have a few follow-up questions:

  1. Could you please provide more details about the app you are running on your device? Knowing the name and any specific configuration settings for this app could help diagnose the issue more accurately.
  2. In your application configuration, you mentioned using “mqtt-dashboard.com” as the host and “Port: 8884” for the WebSocket connection. Did you specify in your app’s configuration that it should use a Secure WebSocket (wss://) connection instead of an insecure one (ws://)? If so, could you share your configuration file or provide screenshots of the relevant settings?
  3. To further narrow down the problem, have you tried connecting to any other ports besides 8884? For example, have you attempted to connect using the following ports:
  • TCP Port: 1883
  • Websocket Port: 8000
  • TLS TCP Port: 8883
  • TLS Websocket Port: 8884

Please provide as much detail as possible, and we’ll do our best to assist you in resolving the connectivity issue.

Best regards,
Dasha from the HiveMQ Team

Hi Daria,

Thank you for your reply.

  1. Am using my application to send the sample data like “Hello world” to the cloud.
    So, I am using a sample mqtt application that connects to the broker and is able
    to send the message.
  2. Now am able to connect with the hivemq broker by providing the hostname
    broker.hivemq.com” with a websocket port “8884” from my application as well
    as in the browser.

Now the issue is am unable to receive the publishing message in the broker messages column.
Please guide me to resolve this.

Regards
Manoj

Please find the below screenshot for your reference.

Regards
Manoj

Hello @manoj_p,

I hope this message finds you well. I’m pleased that we’ve connected. Could you kindly share the details of the changes you made in your code to achieve this outcome?

Thank you in advance.

Sincerely,

Hi Daria,
I think you did not understand my point.
I am able to connect through my application after executing and the output we are seeing in the terminal only.
The actual issue is am unable to see the payload message in the browser.

Regards
Manoj

Hello @manoj_p ,

Thank you for the follow-up - that is curious, indeed!

Based on the image provided, it does appear that we have a subscription set to the solidrun topic appropriately, and are publishing to that topic. In order to test further, I’d like to have you verify if, when setting the QoS level of the subscription and publish to 0 or 1, we see messages being received by this client.

Additionally, if we connect a second client and subscribe to this topic, do we see similar behavior? If you happen to have the client implementation code available, we may be able to review this further as well.

When testing with our public websocket client, available here, with our public broker, available here, I was able to properly subscribe to the solidrun topic, and then publish to the solidrun topic with the message payload of “test”.

Let us know your thoughts!

Best,
Aaron from the HiveMQ Team