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

    lopy4 deep sleep

    Scheduled Pinned Locked Moved LoPy
    lopy4power
    10 Posts 4 Posters 1.2k Views 4 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.
    • A Offline
      abhishek2101
      last edited by

      I want my lopy4 to wake up once a day at a pre-defined time and send the data to my LORAWAN network. the project needs to run on battery. what deep sleep modes can i use ? i want the lopy4 to only connect to LORAWAN over OTAA once and then just keep sending data once a day. Can i maintain the LORAWAN counters and session keys in sleep modes ? how to best achieve this kind of functionality.

      1 Reply Last reply Reply Quote 0
      • rcolisteteR Offline
        rcolistete
        last edited by rcolistete

        Have you tried machine.deepsleep([time_ms]) ?
        Just use 24 x 3600 x 1000 as sleep time. When awaking from deep sleep, is almost the same as rebooting (just "machine.wake_reason()" returns different values).

        The "lora.join(...)" can be avoided after the first time by using "lora.nvram_restore()" (after creating the "lora" object) and "lora.nvram_save()" after sending the LoRaWan packet.
        The LoRaWan counters are preserved.

        To specify the battery, you need to know how many days battery shoud last, the operation duty cycle (time awake / (time awake + time sleeping), the power consumption in each cycle.

        Are you going to use LoPy4 alone or with another board like Expansion Board v2/v3.0/v3.1, or PyTrack, or PySense, etc ? LoPy4 current in deep sleep is about 20 uA when alone, hundreds of uA with Expansion Board.

        If WiFi and Bluetooth are not needed, just disable them :

        • pycom.wifi_on_boot();
        • bluetooth.deinit().

        Even the presence or not, and type of microSD card in Expansion Board/etc, changes the power consumption :
        MicroSD power consumption on Expansion Board, PyTrack, PySense, etc.

        Search for deep sleep in this forum to have more details.

        My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

        A 2 Replies Last reply Reply Quote 1
        • A Offline
          abhishek2101 @rcolistete
          last edited by

          @rcolistete I am not using wifi, Bluetooth Sd card. Also no expansion boards.

          Battery should last for at least 2 years.

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jcaron @abhishek2101
            last edited by

            @abhishek2101 Waking up once a day should be not problem to last for 2 years, but a few things can quickly derail your plan.

            Let's say your LoPy 4 stays awake for 10 seconds (that's a bit long already) and draws 200 mA average (that's quite a lot) during those 10 seconds, and 30 µA the rest of the time.

            Then you draw an average of (10 * 200 + (86400-10)* 0.03) / 86400 = 0.053 mA (53 µA).

            With a 2500 mAh battery, than means over 5 years in ideal conditions.

            But remember to keep your active time as limited as possible. If you suddenly decide you want to wake up every hour instead of every day for instance, you suddenly jump to 585 µA average, over 10 times more, and your battery life drops to less than 6 months.

            Don't forget to actually measure how much power your device draws in real conditions (running on battery, with all the sensors, no USB...), how long you stay awake, etc. The difference between theory and reality can cause big surprises!

            A 1 Reply Last reply Reply Quote 1
            • A Offline
              abhishek2101 @jcaron
              last edited by

              @jcaron thanks for all the info. Is there anyway I can contact you one-on-one for further help ?

              J robert-hhR 2 Replies Last reply Reply Quote 0
              • A Offline
                abhishek2101 @rcolistete
                last edited by

                @rcolistete thanks for all the info. Is there anyway I can contact you one-on-one for further help ?

                1 Reply Last reply Reply Quote 0
                • J Offline
                  jcaron @abhishek2101
                  last edited by

                  @abhishek2101 the whole point of forums such as this one is that any help for you will be available for others having the same questions or issues.

                  If you have other questions, feel free to ask them in the forum. If you need dedicated help, I’m pretty sure there are people available to do that for a fee :-) (not me at this time).

                  1 Reply Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @abhishek2101
                    last edited by

                    @abhishek2101 You can always use the chat for direct communication to specific board members for topics, which you do not want to ask in public.

                    A 1 Reply Last reply Reply Quote 1
                    • A Offline
                      abhishek2101 @robert-hh
                      last edited by

                      @robert-hh that is what i was looking for, I tried to find how to initiate the chat, but could not see it. can you help ?

                      robert-hhR 1 Reply Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh @abhishek2101
                        last edited by

                        @abhishek2101 Go to the profile of the person you want to chat with, and in the middel right there is a circle with some dots. If you open that, teh first topic is: start a chat.

                        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