Navigation

    M5Stack Community

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

    Posts made by jhfoo

    • RE: Wake up on pick-up

      @davesee I heard about setting a flag on movement detected, written at the C level. Hoping to avoid that level of coding. Will forward your link to my (volunteer) team who do C coding if they can confirm your design.

      posted in M5 Stick/StickC
      J
      jhfoo
    • RE: Unable to find documentation for Python in UIFlow

      @thrasher I especially like the reference to his github repo for compatible libraries to be used on generic upython firmware: https://github.com/lukasmaximus89/M5Stick-C-Micropython-1.12

      posted in Cores
      J
      jhfoo
    • RE: UIFlow 1.5.3

      @m5stack By GA I mean Generally Available. As in out of beta, ready for production use.

      posted in Official Updates
      J
      jhfoo
    • RE: Creating an infinite async loop

      @m5stack I will share pseudo-codes of the current implementation, which is stable so far:

      CycleTimer = Timer(-1)
      
      def main():
        # init and connect mqtt client
        doCycle()
      
      def doCycle():
        global CycleTimer
        # send stuff from mqtt
        # NOTE: do not use machine.lightsleep() as publish() is NOT synchronous
        # lightsleep() will block data from being sent
        CycleTimer.init(period=5000, mode=Timer.ONE_SHOT, callback=doCycle)    
      

      NOTE: this is power-intensive; calling lightsleep() will cause uiflow's mqtt client to crash quickly.

      posted in Micropython
      J
      jhfoo
    • RE: Creating an infinite async loop

      Am trying using ONE_SHOT timers. Not sure if this is the recommended approach.

      posted in Micropython
      J
      jhfoo
    • Creating an infinite async loop

      Looking to write code that will send data via mqtt perpetually. Learn recently that the publish() method is NOT synchronous, which I augmented by listening to a topic for an ack message before calling the iteration done, and the next iteration publish begins.

      So I tried to close the loop by calling the publish() method within the subscribe() handler, and the app crashed with message 'RuntimeError: maximum recursion depth exceeded'.

      How do people get around this?

      posted in Micropython
      J
      jhfoo
    • RE: M5stick C - Rasp Pi integration with MQTT

      @nirvana07 I would suggest you:

      1. First learn about writing normal Python code to learn, test, and validate your MQTT server setup.
      2. Use uiflow blockly to draw out your MQTT code, and flip to the Python tab to see the auto generated code. Make changes as needed.

      No free lunch here. As newbie you should be prepared to invest time into this.

      posted in General
      J
      jhfoo
    • Wake up on pick-up

      Is there any way to program StickC to wake up when it moved eg. picked up? Maybe some behavior from the IMU waking up deep sleep? I'm open for anything.

      posted in M5 Stick/StickC
      J
      jhfoo
    • RE: I think my StickC has died ... any suggestions?

      When you connect to the PC does it detect a device? Hopefully it's just the screen that blew.

      posted in M5 Stick/StickC
      J
      jhfoo
    • Is m5mqtt.publish async?

      I put my M5StickC to sleep after .publish() and data was never received on the server. Is there a way to confirm data receipt, maybe through a callback or some other indicator?

      posted in Micropython
      J
      jhfoo
    • How to disconnect fro m5mqtt?

      m5mqtt.disconnect() throws an error.

      posted in Micropython
      J
      jhfoo
    • RE: UIFlow 1.5.2

      @ajb2k3 Take care boss. Slow down and enjoy the earl grey.

      Also: don't.do.anything.stupid. :D

      posted in Official Updates
      J
      jhfoo
    • RE: UIFlow 1.5.3

      Echo support! Exciting! When is it GA?

      posted in Official Updates
      J
      jhfoo
    • RE: What does m5base.app_start() do?

      @robalstona Yes I get that. But WHY? As I mentioned earlier, this makes testing code uploads a pain.

      posted in UIFlow
      J
      jhfoo
    • Connect to Alexa

      Any idea if/ how one can connect to Alexa/ Google Assistant using the mic and speaker on M5StickC?

      posted in Micropython
      J
      jhfoo
    • RE: Using the M5Stick-C as a controller

      @rapgo Your requirement is vague: what exactly are you trying to control?

      posted in Micropython
      J
      jhfoo
    • RE: Running code with ampy or rshell or REPL?

      @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.

      posted in Micropython
      J
      jhfoo
    • RE: isPressed? wasPressed? What's the difference?

      @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)
      
      
      posted in Micropython
      J
      jhfoo
    • RE: Bluetooth support

      @hanphony how much do you really need? uiflow as i understand it is a layer on top of micropython, simplifying the hardware choices in the product. i tried to use stock (Lobo) firmware and just getting the LCD to work was a bloody pain.

      Also checked the space consumed with os.statvfs(): there's plenty of write space for some decent code.

      That said, will be nice to have official BLE support.

      posted in UIFlow
      J
      jhfoo
    • RE: "Smart" network configuration from UIFlow?

      @devilstower have you tried using the scan method described here?
      https://docs.micropython.org/en/latest/library/network.html

      posted in UIFlow
      J
      jhfoo