karl60
August 19, 2022, 8:30am
1
Newbie trying to connect RPI Pico W using module mqtt_as to HiveMQ Cloud.
Using Port 8883 gives error code -1 ‘Connection closed by host’ (Instant error)
Using Port 1883 gives error code -1 ‘Timeout on socket read’ (After a delay)
Any guidance on how to resolve the connection issue would be welcome.
Thanks.
PS The Pico connects to my wifi OK.
Does your code work to connect to other brokers such as test.mosquitto.org or mqtt.eclipseprojects.io on port 1883?
karl60
August 22, 2022, 11:50am
3
Thank you for your response. Code works perfectly with the public brokers ‘mqtt.eclipseprojects.io ’, ‘broker.hivemq.com ’, ‘test.mosquitto.org ’ on port 1883.
Hi @karl60 ,
Nice to see your interest in MQTT and HiveMQ Cloud, please welcome to our community
Using port 1883 on HiveMQ Cloud doesn’t make any sense, there are only following ports available:
Port (TLS):
8883
Port (Websocket + TLS):
8884
To connect to 8883 you need:
hostname of your cluster;
username and password from the clusters MQTT Credentials;
HiveMQ Cloud requires the TLS-SNI extension to be available and used, please refer here and check if it is available in your system.
some devices require the root certificate. You can download the root certificate here .
I hope this helps,
Kind regards,
Dasha from HiveMQ