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

    Accelerometer wake-up features added to Pytrack and Pysense

    Scheduled Pinned Locked Moved Announcements & News
    library
    22 Posts 10 Posters 11.6k Views 11 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.
    • M Offline
      Meirssv @catalin
      last edited by

      @catalin said in Accelerometer wake-up features added to Pytrack and Pysense:

      @meirssv, Ok, great!

      you could use the wakeup reason to verify if the accelerometer awoke the system

      Yes, I already figured that one out. You could even check the remaining seconds < 1s... Thanks!

      1 Reply Last reply Reply Quote 0
      • T Offline
        ThomasP @catalin
        last edited by

        Hi @catalin, I'm new in programming and it looks like I've missed something.
        When I try this script it returns 96 as a Wakeup reason. The red led is on all the time.

        What should I do ? I'm using Pysense board and everything is updated.

        catalinC 1 Reply Last reply Reply Quote 0
        • catalinC Offline
          catalin @ThomasP
          last edited by

          Hi @thomasp, on the first call, the return value could have some garbage; but the valid values are (1, 2, 4 or 8).
          Could you put it to sleep: py.go_to_sleep() and wake it up immediately pressing the Reset button (from the Pysense)? You should obtain value 2, of the py.get_wake_reason()
          Here are the Sleep functions explained: https://docs.pycom.io/chapter/pytrackpysense/apireference/sleep.html

          Catalin,

          Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io
          Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

          T 1 Reply Last reply Reply Quote 0
          • T Offline
            ThomasP @catalin
            last edited by

            @catalin

            Well I tried and It doesn't work. Now I can't connect my board anymore. It says "Failed to connect (Error : Port is not open)." or "Failed to connect (Error: Writing to COM port (WriteFile): Unknown error code 22)."

            Each time I run the script with these commands, the program doesn't execute the line. I mean it starts looping but stay at the same line and I can't do anything. I have to unplug the board to be able to restart the script.

            catalinC 1 Reply Last reply Reply Quote 0
            • catalinC Offline
              catalin @ThomasP
              last edited by catalin

              @thomasp There seems to be a problem with COM port (serial port). What program are you using to connect/upload scripts? Atom with pymakr plugin?
              Once the go_to_sleep() is executed, the serial connection is disconnected, and it comes back after the Pysense is awaken; and next, the script is executed again. This situation loops, and becomes difficult to catch the serial COM ready for connection.
              So, for development purpose, maybe you should not have go_to_sleep() in the script, but execute it manually, on the REPL console (>>>).
              The script can be stopped with Ctrl+C.

              Catalin,

              Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io
              Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

              T 1 Reply Last reply Reply Quote 0
              • T Offline
                ThomasP @catalin
                last edited by

                @catalin
                Yes I'm using Atom with pymark as recommanded. How do I wake up my board ? I'm pressing the restart button and shaking it but I can't connect it.
                It never stops connecting and disconnecting it.

                catalinC 1 Reply Last reply Reply Quote 0
                • catalinC Offline
                  catalin @ThomasP
                  last edited by

                  @thomasp
                  Yes, it seems the script keeps on re-executing quickly after wakeup.

                  Try safe-boot procedure; if you don't have Expander board, could be tricky: https://docs.pycom.io/chapter/toolsandfeatures/bootmodes.html

                  On Windows platform, maybe Realterm can catch the serial https://realterm.sourceforge.io; on linux+mac that would be minicom and allow you to give Ctrl+C to stop the scripts.

                  Catalin,

                  Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io
                  Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

                  T 1 Reply Last reply Reply Quote 0
                  • T Offline
                    ThomasP @catalin
                    last edited by

                    @catalin

                    I can now run a simple program but I can't use pycom.rgbled().
                    It says : "OSError: the requested operation is not possible"
                    And sometimes I get : "An error occurred: Not enough memory available on the board.
                    Upload failed. Please reboot your device manually."

                    But I tried all the reboot and reset but It doesnt work.
                    So I used the command to Reset the Filesystems but still the same errors appears.

                    I updated firmware just in case but no result.
                    The led is flashing blue every 4 seconds.

                    1 Reply Last reply Reply Quote 0
                    • sebS Offline
                      seb
                      last edited by

                      @ThomasP

                      Could you create a new forum thread for the issues you are facing and I will help you get your board set up and running.

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        KenM
                        last edited by

                        Hi,

                        I have an extra I2C sensor on the Pysense. (water pressure)
                        I would like to wake up my lopy4 if it's above a certain value.

                        Can this be done?
                        And which code should I change/update?

                        Thanks

                        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
                        • 2
                        • 2 / 2
                        • First post
                          Last post

                        Pycom on Twitter

                        Pycom