🤖Have you ever tried Chat.M5Stack.com before asking??😎

Subcategories

  • 7 Topics
    19 Posts
    J
    @pabou try using uiflow to generate the code, then peek copy from there.
  • How to disconnect fro m5mqtt?

    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • Connect to Alexa

    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • Using the M5Stick-C as a controller

    2
    0 Votes
    2 Posts
    4k Views
    J
    @rapgo Your requirement is vague: what exactly are you trying to control?
  • Running code with ampy or rshell or REPL?

    6
    0 Votes
    6 Posts
    14k Views
    J
    @ajb2k3 Adding to this: I'm using the pymakr extension to VS Code. It handles selective code upload (only changed ones). Note that pymakr does not handle binary file transfer eg. jpg.
  • isPressed? wasPressed? What's the difference?

    3
    0 Votes
    3 Posts
    9k Views
    J
    @dclaar isPressed() reflects current state of the button (is it pressed?), and returns a Boolean. wasPressed() is an event trigger you use to execute code when the button is pressed. Sample code below (generated from uiflow) to illustrate. from m5stack import * from m5ui import * from uiflow import * lcd.setRotation(1) setScreenColor(0x111111) isExit = None def buttonB_wasPressed(): global isExit isExit = True pass btnB.wasPressed(buttonB_wasPressed) setScreenColor(0x000000) axp.setLcdBrightness(40) isExit = False while isExit == False: lcd.print((btnA.isPressed()), 3, 0, 0xffffff)
  • how to share lcd spi?

    3
    0 Votes
    3 Posts
    6k Views
    m5stackM
    maybe you could commit a issues to lobo github. and if you want to use multi SPI device control we suggest you use Arduino to program it
  • The dreaded "T" of death...

    3
    0 Votes
    3 Posts
    6k Views
    T
    @robalstona Thanks, I'll give that a try.
  • Micropython AWS IoT connect/add files to UI Flow?

    2
    0 Votes
    2 Posts
    6k Views
    lukasmaximusL
    I assume you'll want to put the certificate in the flash. there are various ways you can transfer files to the flash, check this video on how to do so https://www.youtube.com/watch?v=bdyZx2KC54Y
  • Running out of file descriptors

    1
    0 Votes
    1 Posts
    5k Views
    No one has replied
  • NCIR, i2c_bus and unit Updated micropython code

    7
    0 Votes
    7 Posts
    13k Views
    T
    Thank you for your help @liemph ! I ended up doing something similar. I have only now seen your answer. But for sure that will be helpful to someone!
  • MicroPython Firmware with M5Stack libraries

    11
    0 Votes
    11 Posts
    32k Views
    T
    Hi @lukasmaximus ! Any idea on when an updated version of the micropython m5stack libraries will be available? Since the ones in here are not complete, and don't if they are up to date with the current version used in uiflow
  • The latest MicroPython firmware and Bluetooth

    5
    0 Votes
    5 Posts
    10k Views
    H
    Got it, thanks @lukasmaximus. Is there a way to burn firmware with UiFlow with ONLY MicroPython and none of the other pre-installed modules or packages?
  • How to acquire and upload demo app?

    19
    0 Votes
    19 Posts
    32k Views
    lukasmaximusL
    Upyloader, Mu and Thonny are all great tools with a nice GUI that you can use to transfer files to and from the flash of your device
  • sleep commands

    2
    1 Votes
    2 Posts
    5k Views
    J
    See solution here: https://forum.m5stack.com/topic/1953/how-to-make-m5stickc-go-into-light-sleep/2
  • Error 118, doconnect() not connecting

    2
    0 Votes
    2 Posts
    5k Views
    D
    For anyone interested, I think I found the solution to my problem. The problem wasn't with doConnect. First, the 118 error was caused by lightsleep... I think. Since lightsleep allows RAM to persist, when it would wake up it would still think wlan_sta was active, even though it wasn't. Adding wifiCfg.wlan_sta.active(False) at the end turned the network off before going to sleep. That way each time it would connect as it should. Next, I kept getting error 23 after a few posts. This was caused by not closing the socket that was opened by the request and stored in response. The memory was filling up with socket objects, and running out of room. Calling request.close() removed the socket and freed up the memory. Now it's working just fine.
  • Code only works from Visual Studio

    micropython
    8
    0 Votes
    8 Posts
    15k Views
    D
    Given that I can now see the console, I determined that it throws OSError if the http GET fails. Which is a weird error to throw, but OK. So I put that in my except: clause, and it's humming away!
  • OMG, serial console!

    6
    1 Votes
    6 Posts
    13k Views
    ajb2k3A
    The serial console access is known as REPL. If you didn't know about REPL then it is no wonder that you are surprised.
  • I2C bus already used error

    6
    0 Votes
    6 Posts
    13k Views
    D
    Thank you! I switched back to the i2c_bus module and the code you provided and it worked. No more errors. All that was missing was converting the struct to a short: def get_moisture(): i2c = i2c_bus.easyI2C(i2c_bus.PORTA, 0x36) i2c.write_u8(0x0f, 0x10) wait_ms(5) val = i2c.read(2) val = ustruct.unpack(">H", val)[0] return val
  • catch network problem

    4
    0 Votes
    4 Posts
    8k Views
    D
    I think that I'm running into something similar: When RUN from visual studio, it works great, but when I disconnect it and start standalone, it hangs shortly after connecting to WiFi. It seems that I can do one more print, and that's it.
  • lcd.print disappears with rotate 270 and Y > 104

    8
    0 Votes
    8 Posts
    15k Views
    D
    I will finally note that lcd.print works fine with lcd.orient(lcd.LANDSCAPE) and lcd.orient(lcd.LANDSCAPE_FLIP)