Skip to content
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

Add support for MQTT pver SSL and update to attemp disconnects and extra loggin on mqtt failures #125

Merged
merged 7 commits into from
Dec 13, 2022

Conversation

dave-ct
Copy link
Contributor

@dave-ct dave-ct commented Dec 5, 2022

Add support for a local mqtt broke that uses ssl. Allow user to add in their ca,crt file and if exists use SSL for mqtt uploads.

Relates to issue #122

Add support for a local mqtt broke that uses ssl.  Allow user to add in their ca,crt file and if exists use SSL for mqtt uploads.
@ZodiusInfuser
Copy link
Member

Thanks for this. A few additions:

  • Could you add this new mqtt parameter to the config_template, such that it will get picked up when someone newly provisions a board.
  • For the check of the parameter's value, there should first be a check (or a try except) to handle if/when that parameter is not present within a user's config.

Added new mqtt parameter to the config_template for ca.crt file location and added check for ca.crt parameter variable incase it is not there in user's config
When low disk space detected try to upload the readings to free up the disk space.  On Boot sleep for 0.5 seconds at start.
@dave-ct dave-ct changed the title Add support for SSL when using mqtt destination Add support for MQTT SSL and Uploads if disk space approaching full Dec 11, 2022
Have monitored different errors from MQTT during upload after connection.  In the event of an OSError or IndexError try to disconnect MQTT to see if it prevents hangs.
@dave-ct
Copy link
Contributor Author

dave-ct commented Dec 11, 2022

Added a couple more updates here, still testing to see if they work.

If edit made in pycharm ignore .idea/ structure
@ZodiusInfuser
Copy link
Member

Thank you for the additions. Any chance you can raise the logging change as a separate PR to this please? Makes it easier on my end to evaluate and approve the changes.

@dave-ct
Copy link
Contributor Author

dave-ct commented Dec 13, 2022

@ZodiusInfuser have reverted from here and created new pull request #128

Will also clean this pull request so it just relates to mqtt

@dave-ct dave-ct changed the title Add support for MQTT SSL and Uploads if disk space approaching full Add support for MQTT pver SSL and update to attemp disconnects and extra loggin on mqtt failures Dec 13, 2022
Corrected logging in mqtt update as missing import on error
@ZodiusInfuser
Copy link
Member

Thanks for tidying this up. There's a few things from a code standpoint that I'd like to do, but they can be done after this is merged in 🙂

@ZodiusInfuser
Copy link
Member

Specifically, turn that exception logging line into a neater function call, and correct a few typos in the comments

@ZodiusInfuser ZodiusInfuser merged commit bafd8dd into pimoroni:main Dec 13, 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

Successfully merging this pull request may close these issues.

2 participants