🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5 Fire "get battery level" block

    M5Stack Fire
    4
    11
    12.5k
    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.
    • F
      F3l1x
      last edited by

      Hi
      I'm getting started with the M5 Fire and UI Flow
      I am trying to print the battery level using the "get battery level" block
      I get an awful red ERROR message with "name 'power' isn't defined"
      The code is
      from m5stack import *
      from m5ui import *
      from uiflow import *
      import time
      label0 = M5TextBox(262, 204, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)
      BatLvl = None
      while True:
      BatLvl = power.getBatteryLevel()
      label0.setText(str(BatLvl))
      speaker.sing(147, 1)
      wait(1)

      I thought power was part of the library... If not, what is the correct way of defining it ?

      1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3
        last edited by

        Have you updated the fire to the latest UIFlow Firmware?

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        1 Reply Last reply Reply Quote 0
        • F
          F3l1x
          last edited by

          Yes I thought I should update...unfortunately, M5burner does not work on my Windows laptop
          "Error loading Python DLL 'C:\Users\xxx\AppData\Local\Temp_MEI97002\python36.dll'.
          LoadLibrary: The specified module could not be found.

          1 Reply Last reply Reply Quote 0
          • R
            robalstona
            last edited by

            Try install Python 3.6 or higher for windows. Then burner software should work without errors.

            1 Reply Last reply Reply Quote 0
            • F
              F3l1x
              last edited by

              python36.dll DOES exist on my computer
              Is there a way to give it's path to M5burner as a parameter? (I tried adding python36.dll to the Windows PATH, with no luck)

              1 Reply Last reply Reply Quote 0
              • R
                robalstona
                last edited by

                Find a file esptool.exe and copy this dll to the same folder.

                1 Reply Last reply Reply Quote 0
                • F
                  F3l1x
                  last edited by

                  I already added python36.dll to the M5burner folder on my computer.
                  Using esptools, where do I need to add python36.dll ?

                  1 Reply Last reply Reply Quote 0
                  • R
                    robalstona
                    last edited by

                    i download M5Burner in zip file. When i unpack it i has tools folder which include esptool. Copy dll file in this folder. Eventually find downloaded firmware files in firmwares folder and burn it with other flash tools like esp flash tool from espressif home page

                    1 Reply Last reply Reply Quote 0
                    • F
                      F3l1x
                      last edited by

                      Hi again
                      I tried M5burner on another laptop
                      It "sees" the M5 fire but cannot flash it
                      "A fatal error occurred: File fatfs_image_0x370000.bin (length 2678784) at offset 3604480 will not fit in 4194304 bytes of flash. Use --flash-size argument, or change flashing address."
                      Weird, as the firmware is meant for the fire hardware, it should match its memory size ?!

                      m5stackM 1 Reply Last reply Reply Quote 0
                      • m5stackM
                        m5stack @F3l1x
                        last edited by

                        @f3l1x could you try erase the flash then burn the firmware again?

                        1 Reply Last reply Reply Quote 0
                        • F
                          F3l1x
                          last edited by

                          I did erase, and M5Burner did never complain but it didn't solve the problem
                          I don't know why but as I tried again and again, it worked...pretty weird...

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post