@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.
jhfoo
@jhfoo
Posts made by jhfoo
-
RE: Wake up on pick-up
-
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
-
RE: UIFlow 1.5.3
@m5stack By GA I mean Generally Available. As in out of beta, ready for production use.
-
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.
-
RE: Creating an infinite async loop
Am trying using ONE_SHOT timers. Not sure if this is the recommended approach.
-
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?
-
RE: M5stick C - Rasp Pi integration with MQTT
@nirvana07 I would suggest you:
- First learn about writing normal Python code to learn, test, and validate your MQTT server setup.
- 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.
-
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.
-
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.
-
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?