m5Dail MQTT and Wifi Help



  • Please i need some help to set up a simple MQTT to send and receive messages
    i bought the M5Dail over 3 months ago and i still cant use it, i keep getting all kind of errors, i updated to the latest firmware and its still not working
    0_1708954894539_035d4811-b035-40af-9721-fe7ed27e15ef-image.png

    then i get these errors, including on the screen
    0_1708954943111_7060e1fc-a12d-4b69-86ef-51551794e3e1-image.png

    Edit: Even if i try to just setup a simple WIFI client, i get this error
    Traceback (most recent call last):
    File "<stdin>", line 22, in <module>
    File "<stdin>", line 15, in setup
    OSError: Wifi Internal Error

    Can anyone please post your flow of a working MQTT?
    thank you



  • I'm using external Hive MQTT and it didn't worked with build in blocks for mqtt on my M5Dial so had to use "execute code" way and it was fine

    add wifi config to your code too



  • I posted an example in UIFlow2’s project zone for the atom. I found the issue is with the placement of the MQTT unit block

    The error says the host is unreachable, are you sure you have the correct address?



  • Thank you for the quick replies, i think i managed to make it work, it seemed to be an issue with WIFI
    now i can publish messages everytime i rotart the dial, but the new issue i'm having is receiving messages (or in other words Subscribing)
    below is a sample bock code, i would receive one message then it stops receiving.
    do you know the block "MQTT Apply For Messages" what is it used for? if i add it i would receive one message, i tried adding in the subscribe blocky but then i cant publish, any idea what i'm doing wrong?

    0_1708957753002_163b591b-6414-4efe-a6d6-ae2fe9c68705-image.png



  • @iosapps420 said in m5Dail MQTT and Wifi Help:

    Thank you for the quick replies, i think i managed to make it work, it seemed to be an issue with WIFI
    now i can publish messages everytime i rotart the dial, but the new issue i'm having is receiving messages (or in other words Subscribing)
    below is a sample bock code, i would receive one message then it stops receiving.
    do you know the block "MQTT Apply For Messages" what is it used for? if i add it i would receive one message, i tried adding in the subscribe blocky but then i cant publish, any idea what i'm doing wrong?

    0_1708957753002_163b591b-6414-4efe-a6d6-ae2fe9c68705-image.png

    are you publishing and subscribing to same topic or two different so something else is acting for topic you subscribing?



  • Hi guys

    please find my M5Dial MQTT (subscribe and publish) example called M5Dial_WiFi_MQTT_UIFlow2.0.1 in the UIFlow2 Play Zone.

    BTW: MQTT apply for messaging (e.g. mqtt_client.wait_msg() block is a blocking call, e.g. it waits until a message is received. If you only want to check for new messages (non blocking) you'll need to use an Execute mpy code block with mqtt_client.check_msg() in it.

    Thanks
    Felix



  • @felmue said in m5Dail MQTT and Wifi Help:

    M5Dial_WiFi_MQTT_UIFlow2.0

    Thank you all very much
    @felmue your example worked perfectly, i really appreciate it



  • This post is deleted!


  • Hi, I am trying to get MQTT to work on M5Dial, I started using uiflow2 and building myself, I have made it work in the past with a Core2 and UIFlow, but no luck yet with UIFLOW2 and the dial.

    Using the M5Dial_WiFi_MQTT_UIFlow2.0.1 example from @felmue I can get it to work, but if I change the subscribe block to display the MQTT message, or to set a variable to get message(return bytes), I get the following error:

    File "umqtt/simple.py", line 114, in connect
    MQTTException: 2

    Can anyone help?

    Further info: I have found that this is actually from the broker side. If I restart the broker, it will connect fine, until I power cycle, or reset. The second connection fails.

    Solution: I ended up changing libraries to PicoMQTT and was able to get everything working.