peterhinch / micropython-mqtt

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.
MIT License
549 stars 116 forks source link

Connection failed on Raspberry Pi Pico W #94

Closed sandhan26 closed 1 year ago

sandhan26 commented 1 year ago

Hi, I am trying to use the mqtt_as library on my Raspberry Pi Pico W . I was running the clean.py script for testing.

I tried with both local mosquitto server as well as HiveMQTT online server. But Everytime I get the same Connection failed message.

Checking WiFi integrity. Got reliable connection Connecting to broker. Connection failed.

peterhinch commented 1 year ago

I have tested with the Pico W.

The first step is to get the local broker working. Are you using mosquitto? If not, I recommend it. You can verify your connection using mosquitto_pub and mosquitto_sub on a PC. If they work OK then you know you've got the correct connection parameters (IP address, password if applicable). Then, with the same parameters, mqtt_as should work.

peterhinch commented 1 year ago

See https://github.com/peterhinch/micropython-mqtt/issues/100 and the docs for information on how to use HiveMQ.