Navigation

    M5Stack Community

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

    jhfoo

    @jhfoo

    3
    Reputation
    46
    Posts
    326
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    jhfoo Follow

    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