Closed Vsaggiomo closed 2 years ago
Thanks for reporting. Would you be willing to make a PR with this change?
Could you post the error from the REPL?
Without the "port=1883" this is the error:
Connecting to WiFi...
Connected!
Connecting to Adafruit IO...
Traceback (most recent call last):
File "
the line 117 in the code is: io.connect()
@Vsaggiomo What hardware are you using to connect to Adafruit IO? Which example?
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.
@brentru just checking in, is there anything further needed on this one?
@FoamyGuy Addressed in https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/pull/90
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"],