Skip to content

MQTT port missing #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Vsaggiomo opened this issue Apr 18, 2022 · 7 comments
Closed

MQTT port missing #89

Vsaggiomo opened this issue Apr 18, 2022 · 7 comments

Comments

@Vsaggiomo
Copy link
Contributor

In the example files, the MQTT port is missing and the microcontroller will not manage to connect to Adafruit IO giving an error in _get_connect_socket.
Adding a line with the port will solve this problem:

Initialize a new MQTT Client object

mqtt_client = MQTT.MQTT(
broker="io.adafruit.com",
port=1883, #IMPORTANT this is missing in the example file!
username=secrets["aio_username"],
password=secrets["aio_key"],

@FoamyGuy
Copy link
Contributor

Thanks for reporting. Would you be willing to make a PR with this change?

@brentru
Copy link
Member

brentru commented Apr 18, 2022

Could you post the error from the REPL?

@Vsaggiomo
Copy link
Contributor Author

Without the "port=1883" this is the error:

Connecting to WiFi...
Connected!
Connecting to Adafruit IO...
Traceback (most recent call last):
File "", line 117, in
File "adafruit_io/adafruit_io.py", line 111, in connect
AdafruitIO_MQTTError: MQTT Error: Unable to connect to Adafruit IO.

the line 117 in the code is: io.connect()

@brentru
Copy link
Member

brentru commented Apr 18, 2022

@Vsaggiomo What hardware are you using to connect to Adafruit IO? Which example?

@Vsaggiomo
Copy link
Contributor Author

Arduino Nano Connect 2040. And all the MQTT examples. I think that some previous versions of the lib had the port in secrets.py. Now the port disapeared both in secrets.py and in the code.

@FoamyGuy
Copy link
Contributor

FoamyGuy commented May 2, 2022

@brentru just checking in, is there anything further needed on this one?

@brentru
Copy link
Member

brentru commented May 2, 2022

@FoamyGuy Addressed in #90

@brentru brentru closed this as completed May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants