🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5 Stick C + UIFlow + MQTT

    UIFlow
    2
    3
    5.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      michalt
      last edited by

      Hey,

      My setup

      • M5 Stick C
      • flashed and run with UI Flow 1.2.3

      Problem

      I am able to setup connection to my local MQTT server - connection is fast, and durable (doesn't disconnect in general). However after I am connected M5 loose MQTT messages (doesn't receive them, or it doesn't handle them). At times it handles every message (lets say for about 10s), but later it doesn't handles any. Also at times it receive a message but it triggers the callback (the block of code) 5 - 10 s later.

      My feeling is that M5 get's the messages but for some reason those are lost within the device.

      I have similar setup with Wemos D1 (ESP8266) and there is no problem with MQTT.

      I can only imagine that code written in plain C / C++ would be more robust, but I like the UI Flow env a lot and I would like to keep using it.

      Do you have any hint what could be the reason of my problem and how could I try to fix it?

      1 Reply Last reply Reply Quote 0
      • M
        michalt
        last edited by

        Ok, looks like I have solved the problem. I had to add empty infinite loop in order to not stop the device.

        Before

        0_1558263171783_Screenshot 2019-05-19 at 11.42.06.png

        After FIX

        0_1558263221235_Screenshot 2019-05-19 at 12.52.27.png

        ajb2k3A 1 Reply Last reply Reply Quote 1
        • ajb2k3A
          ajb2k3 @michalt
          last edited by

          @michalt Thank you for sharing this solution.

          I had a similar "1 Shot" event like what you are describing but with the buttons.

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post