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 deep sleep between readings #2

Open
ClemensGruber opened this issue May 11, 2019 · 3 comments
Open

Add deep sleep between readings #2

ClemensGruber opened this issue May 11, 2019 · 3 comments

Comments

@ClemensGruber
Copy link

see https://docs.pycom.io/datasheets/boards/deepsleep/api.html

@einsiedlerkrebs
Copy link

I have tried deep sleep, but without success. Tried 1s sleep but device didn't wake up.

I have to admit that I did not do any debugging on this yet.
see: hiveeyes/terkin-datalogger@191a46b

@amotl
Copy link

amotl commented Jun 7, 2019

Hi there,

with one of the recent commits [1], the Hiveeyes MicroPython Datalogger Firmware for BOB should support deep sleep well, at least it works on my machine ;].

You might want to pick up the cherries into this codebase. The update will probably not be that difficult, as you can see the patch is rather non-invasive [2] and should reasonably blend into any piece of Pycom MicroPython code.

We will be happy [3] to see or add refinements, especially wrt. to computing the appropriate time_until_next_measurement as seen here with [4].

Cheers,
Andreas.

[1] hiveeyes/terkin-datalogger@3e73a3fe
[2] hiveeyes/terkin-datalogger@3e73a3fe#diff-c23a2e105b0f535cc439641a30ae7806L177
[3] hiveeyes/terkin-datalogger#4
[4]

FiPy/main.py

Lines 75 to 81 in d4c05d1

perf.stop()
time_elapsed = perf.read()
perf.reset()
time_until_measurement = measurement_interval - time_elapsed
print('Seconds elapsed: {:.2f}s, time until next measurement: {:.2f}s'.format(time_elapsed, time_until_measurement))
if time_until_measurement > 0:
time.sleep_ms(int(time_until_measurement * 1000))

@amotl
Copy link

amotl commented Jun 12, 2019

We just wanted to ping you about that @pinguin999 pushed the relevant bits and pieces to #9. Thanks already!

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

No branches or pull requests

3 participants