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

    Determine power consumption on lopy4

    Scheduled Pinned Locked Moved LoPy
    6 Posts 4 Posters 72 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.
    • J Offline
      jjbarriga
      last edited by jjbarriga

      Is there a way to determine power consumption of cryptographic operations in lopy4, such as AES and hashing? Thanks

      robert-hhR 1 Reply Last reply Reply Quote 0
      • K Offline
        kjm
        last edited by

        You could use one of those inline USB power meters & check what happens when you run encryption code. Although I have to say my lopy4 current when a program is running is not much different to when the module is just idling, contemplating it's navel & flashing it's blue light every 4s

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          jjbarriga
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • J Offline
            jjbarriga @kjm
            last edited by

            @kjm Thanks for the answer. Do you know any python code to perform such measure? Thanks again for your help.

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

              @jjbarriga If you want to do a fine measurement, like for side channel analysis of the crypto oprations, you have to go the ususal way. Eiter:
              a) insert a small resistor into the ESP32 GND connection and pick up the current profile with a fast and precise instrument like an oscilloscope, or
              b) use a micro ESD probe to pick up the radiation from the crypto unit.

              Both requires substantial investment, but should be doable. I do not expect the ESP32 to be resistant against side channel attacks, but did not make any tests yet myself. No need to do so.

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

                @jjbarriga you just make a loop around whatever bit of code you want to test.

                If you want to measure power (which is instantaneous, measured in W), you just read the power drawn while that loop executed (you can use an infinite loop as long as you have a way to get out of it of course).

                If you want to measure energy (which is the integral of the power used of a time period, measured in Ws or Wh or whatever power * time unit), you read the power drawn while the loop is executed, and measure the time it takes to execute the loop, which needs to have a set number of executions. Dividing the total time by the number of iterations will give you the time per execution, multiply that by the power and you have the associated energy.

                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