Skip to content

Fix MicroPython 1.23 compatibility issues #3

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arch273
Copy link

@arch273 arch273 commented Jul 28, 2024

Description of changes:

This PR fixes issues using the example code with MicroPython 1.23+. There was a breaking change made in the ssl/tls implementation (see micropython/micropython-lib#793)

To keep this example working with older versions, a MicroPython version check was added. This allows selection of a compatible umqtt.simple MQTTClient implementation. I tested this on 1.21 and 1.24-preview.

The ssl module in MicroPython 1.23+ now has the ability to accept both a file path or raw data, so the file reads were removed (in the new connect method) to simplify the example.

This also addresses Issue #2 by documenting and including endpoint validation, and how to get the CA cert needed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

@dpgeorge dpgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this, it looks good to me!

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

Successfully merging this pull request may close these issues.

2 participants