Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    General LoPy + Pytrack Sleep Questions

    Scheduled Pinned Locked Moved LoPy
    lopysleepdeepsleeppytrackpython
    1 Posts 1 Posters 749 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      Burgeh
      last edited by Burgeh

      Greetings!

      I have a few questions regarding the LoPy with Pytrack expansion board and the sleep functions.

      1. Does the the py = pytrack() and sleep functions sleep the whole system (or just the LoPy for example)? See example code.
      2. Is there a deepsleep for pytrack? Example code intended for the pytrack expansion/pycoproc.py only seems to show just sleep.
      3. How does that function differ from machine.sleep() or machine.deepsleep() from microPython?
      4. Is there an easier way to debug/stop the running code that has sleep functions in it? Such as stopping the example code below? When I program the chip it can be very hard to stop the system with CTRL+C and re-flashing it to be able to access the file system again? Same thing with see print statements. I know when it sleeps it shuts down the UART so it has to reconnect almost instantly to see the outputs, correct?

      Example Code.

      from pytrack import Pytrack
      from L76GNSS import L76GNSS
      import time
      import pycoproc
      import pycom
      py = Pytrack()
      l76 = L76GNSS()
      pycom.heartbeat(False)
      
      time.sleep(10)
      pycom.rgbled(0xff0000) # red
      print("Wakeup reason: " + str(py.get_wake_reason()))
      #print("Approximate sleep remaining: " + str(py.get_sleep_remaining()) + " sec")
      time.sleep(5)
      pycom.rgbled(0x0000ff) # blue
      time.sleep(5)
      
      py.setup_sleep(30)
      py.go_to_sleep()
      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post

      Pycom on Twitter

      Pycom