Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. ondrej1024
    3. Posts
    O
    • Continue chat with ondrej1024
    • Start new chat with ondrej1024
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by ondrej1024

    • How to change background color of M5Msgbox

      The documentation of the M5 LVGL API does not state a method for specifying the background color of a M5Msgbox.
      However, I found that a M5Msgbox object has a style property which has a set_bg_color method . So I tried this:

      myMsgboxObj.style.set_bg_color(lvgl.STATE.DEFAULT, lvgl.color_hex(0x888888))

      This does not produce an error but meither does it change the backgound color of the box.

      Any ideas?

      posted in Micropython
      O
      ondrej1024
    • RE: ntptime.getTimestamp returns incorrect timestamp.

      Looks like this ntptime timestamp is relative to 01/01/2000, and not to 01/01/1970 like the Epoch Unix timestamp.

      posted in Micropython
      O
      ondrej1024
    • RE: How to interrupt urequests if it hangs

      Yes, watchdog timer could be an idea. The same can be done with a normal timer and calling machine.reset() when it fires.

      However I was wondering if there was a more graceful way of handling this, e.g. interrupting just the hanging urequests.request() method and then continuing with the program without rebooting the whole device.

      posted in Micropython
      O
      ondrej1024
    • How to interrupt urequests if it hangs

      The urequests.request() method does not implement e timeout parameter (like its big brother). So if there is not response to a certain request, the method will hang forever.

      To work around this I am starting a timer just before the urequests.request() call and stop it directly after it. So if the method does not return within a define time, the timer will fire and I can do something.

      So the question is, when the timer fires, which means urequests.request() is stuck, what can I do to recover? One thing could be to reset the device. But is there a more soft way to do this and continue with the application?

      Thanks, Ondrej

      posted in Micropython
      O
      ondrej1024
    • RE: How to distribute Micropython application as binary flash image ?

      Thanks a lot. This seems exactly what I was looking for. Command line is not a problem. Will try it.

      posted in Micropython
      O
      ondrej1024
    • RE: [Core2] How to disable speaker tone during booting / power-up?

      I accidentally deleted the wav file in the res/ folder on the Core2 flash (don't remember the exact name of the file). But you could just rename it. Now the startup sound is gone. So this is a qick'n'dirty fix if you don't want this sound.

      posted in General
      O
      ondrej1024
    • How to distribute Micropython application as binary flash image ?

      Is it possible to distribute a Micropython application (for Core2 in my case) as binary flash image which can simply be burned on the device with M5Burner?

      We would need a way to create that image from a device running the application and having all needed files installed.

      Any idea ?

      posted in Micropython
      O
      ondrej1024
    • MicroPython: handling multiple screens on Core2 with M5Screen()

      According to this documentation the object returned by M5Screen() has the methods get_new_screen() and load_screen().
      These seem to allow switching between multiple screens but I cannot work out how is this supposed to work. Can anyone point me to some example code which shows the correct usage of these functions ?

      Thanks a lot.

      posted in UIFlow
      O
      ondrej1024
    • RE: Core2: Python API to get battery charge level

      Thanks. I checked on the Core2 and here battery voltage also ranges from about 3.2V to 4.2V.

      posted in UIFlow
      O
      ondrej1024
    • RE: Core2: Python API to get battery charge level

      I see that your code applies to the M5stickC. Do you think the table is the same for the M5 Core2?

      posted in UIFlow
      O
      ondrej1024
    • Core2: Python API to get battery charge level

      Is there a Python API to get battery charge level for the Core2 battery?

      I found power.getChargeState() but it just returns true/false (charging/discharging). There is also power.getBatVoltage() which could be an indication of the charge level but would need some additional math to calculate the percentage.

      posted in UIFlow
      O
      ondrej1024
    • RE: Core2 with Visual Studio Code

      Thanks, I will also have a look at Thonny.

      posted in Core 2
      O
      ondrej1024
    • RE: Core2 with Visual Studio Code

      Update to the latest version of vscode-m5stack-mpy (1.0.9 as of today) fixes this issue.

      posted in Core 2
      O
      ondrej1024
    • Core2 with Visual Studio Code

      I would like to develop a project in MicroPython for the Core2.

      I followed the video tutorial for Micropython Development for M5Stack in VSCode. I get to the point when the vscode-m5stack-mpy extension is installed in Visual Studio Code, which succeeds.

      However, after this step the button "Add M5Stack" is supposed to appear at the bottom of the VS Code window. This is not happening here.

      Has anyone done this successfully with a Core2 device? What am I doing wrong?

      It might help to know that the UIFlow IDE is working fine. I am using Ubuntu 20.4.

      posted in Core 2
      O
      ondrej1024