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

Wake reasons not showing in the logs correctly #71

Closed
MrDrem opened this issue Sep 5, 2022 · 6 comments
Closed

Wake reasons not showing in the logs correctly #71

MrDrem opened this issue Sep 5, 2022 · 6 comments
Labels
bug Something isn't working fixed in patch Issues that may now be fixed in the patch branch

Comments

@MrDrem
Copy link

MrDrem commented Sep 5, 2022

Looking at lines 211-232 in enviro/init.py, I think that the log file should show the reasons why the system has woken from sleep.

Looking at my log file I can see that most of these are returning 'unknown'.
I know that most of the logs should show 'rtc_alarm' as the cause, but that those at 2022-09-05 18:16:37 and 2022-09-05 19:06:13 should be 'button' as I know those were caused by me hitting the 'poke' button.
I also suspect that at 2022-09-05 18:01:23, 2022-09-05 18:01:26, 2022-09-05 18:01:31, 2022-09-05 18:18:58 & 2022-09-05 18:32:50 should have a wake reason line with 'rain_sensor' against them.

@lowfatcode
Copy link
Member

Is your device powered by USB? If it is then it won't report the wake reason correctly.

Originally Enviro boards were never intended to be powered via USB when in use - they were meant for battery power where the board fully shuts down between readings.

It seems quite a few people want to run their boards on permanent power via the USB port though so we will add support for that use case in the future.

@MrDrem
Copy link
Author

MrDrem commented Sep 6, 2022

Nope, most of the time it's running on a High Capacity Lithium Ion Battery Pack

FaW3KFeXgAQ9Pwp

@lowfatcode
Copy link
Member

Thanks for the feedback, this definitely seems to be a bug - we'll get on it!

@lowfatcode lowfatcode added the bug Something isn't working label Sep 6, 2022
@ZodiusInfuser
Copy link
Member

@MrDrem My best guess is that our code reads the button state too late after wake-up so defaults to reporting unknown. There was a similar issue with the Enviro Weather and detecting rain ticks. I will investigate further.

@ZodiusInfuser
Copy link
Member

@MrDrem Just to let you (and others) know. I'm working on fixes for many of the enviro issues over in https://github.com/pimoroni/enviro/tree/patch. I believe this is one I have now squashed.

@ZodiusInfuser ZodiusInfuser added the fixed in patch Issues that may now be fixed in the patch branch label Nov 15, 2022
@ZodiusInfuser
Copy link
Member

There is a new release that fixes this issue: https://github.com/pimoroni/enviro/releases/tag/v0.0.9
I'll therefore close this but please re-open it or raise a new issue if you update and experience the problem again. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in patch Issues that may now be fixed in the patch branch
Projects
None yet
Development

No branches or pull requests

3 participants