M5 Fire "get battery level" block
-
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 ?
-
Have you updated the fire to the latest UIFlow Firmware?
-
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. -
Try install Python 3.6 or higher for windows. Then burner software should work without errors.
-
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) -
Find a file esptool.exe and copy this dll to the same folder.
-
I already added python36.dll to the M5burner folder on my computer.
Using esptools, where do I need to add python36.dll ? -
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
-
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 ?! -
@f3l1x could you try erase the flash then burn the firmware again?
-
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...