sborsay / AWS-Serverless-IoT-Book

All Code, Corrections, and Relevant Material for AWS Serverless IoT Book. Find it on Amazon here: https://www.amazon.com/AWS-Serverless-IoT-Inexpensive-Projects-ebook/dp/B0B9P325F7
7 stars 1 forks source link

ch5 - mqtt client code update (ESP32_MicroPython_to_AWS) #5

Open itdog1973 opened 2 weeks ago

itdog1973 commented 2 weeks ago

Hi Steve

I found out that the mqtt library that used on ch5 (ESP32_MicroPython_to_AWS) has an updated change on the mqtt client.

The params ssl_params on mqtt client has been removed.

I need to alter the code to the following.

import ssl added

ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSCLIENT) added_ ssl_context.load_cert_chain(CERT_FILE, keyfile=KEYFILE) added_

MQTT_CLIENT = MQTTClient(client_id=MQTT_CLIENT_ID, server=MQTT_HOST, port=MQTT_PORT, keepalive=5000, ssl=ssl_context) updated

sborsay commented 6 days ago

Yes this works, thank you. It seems the changes occurred with firmware version v1.23.0 (2024-06-02) .bin. The old version of the code will work fine with the old firmware as used in the book, but I will add the modified sketch for the newest firmware versions. Do you know where the documentation fo these changes are other than the release notes?