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

OTA example issues due to callback defined inside loop? #191

Closed
adamwolf opened this issue Feb 16, 2024 · 1 comment · Fixed by #180
Closed

OTA example issues due to callback defined inside loop? #191

adamwolf opened this issue Feb 16, 2024 · 1 comment · Fixed by #180

Comments

@adamwolf
Copy link

Hiya folks!

The OTA examples seem to work fine for me, but when adapting them to larger programs, I kept having a series of issues.

I found that the const OTA_Update_Callback callback was being declared in loop() (

const OTA_Update_Callback callback(&progressCallback, &updatedCallback, CURRENT_FIRMWARE_TITLE, CURRENT_FIRMWARE_VERSION, &updater, FIRMWARE_FAILURE_RETRIES, FIRMWARE_PACKET_SIZE);
). I think maybe it should be in a larger scope, so that when loop() exits and restarts the pointers are still good. When I changed this in my larger programs, it seemed to instantly start to work reliably.

It might even be a cause of some of the issues like #183.

@MathewHDYT
Copy link
Contributor

MathewHDYT commented Feb 16, 2024

Aformentioned issue is fixed in the linked Pull Request and has been fixed already because of #159.

For now your fix with putting it into global scope will fix the issue. Once the PR has been merged it can be done like in the examples again. Sorry for any inconviences caused.

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 a pull request may close this issue.

2 participants