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

RTC and Adafruit IO related improvements #132

Merged
merged 6 commits into from
Jan 23, 2023
Merged

Conversation

ZodiusInfuser
Copy link
Member

Adafruit IO destination now specifically checks for the "data in the future" error, and if encountered triggers an RTC resync on the next boot.

To achieve this, the boards now write a file upon RTC sync with the time of that sync. This file is used in addition to the previous "year 2020 or before" to trigger a resync. For instance, if the file is missing or deleted (as is done with this Adafruit IO case), then a resync is forced. Additionally, a resync is triggered after a user defined number of hours. By default this is set to 1 week.

Additionally, this PR fixes two other minor issues with the RTC:

  • The RTC not always getting set when a resync occurred
  • The RTC alarm time being set to the exact second the board goes to sleep, thus never waking up

@@ -172,6 +172,8 @@ def connect_to_wifi():

logging.info(" - ip address: ", ip)
"""
import rp2
rp2.country("GB")

Choose a reason for hiding this comment

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

This should probably be a config setting. It may create wifi connection issues in other countries.

Copy link
Member Author

Choose a reason for hiding this comment

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

This would have been a good thing for me to think of before merging the pull request 🤦. Any chance you can raise an issue for it, or perhaps a PR yourself if have the time?

Choose a reason for hiding this comment

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

Sure, I may have some time this weekend to create a pull request to use a config setting. For now do you think just removing these two lines will be enough?

Copy link
Member Author

Choose a reason for hiding this comment

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

You can remove them on your local copy if they're causing issues. There's no urgency to remove them from this repository though, as most people download versions from the releases tab.

@ZodiusInfuser ZodiusInfuser deleted the patch/adafruit_io_fixes branch July 10, 2023 09:43
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