<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Can&#x27;t subscribe to MQTT topic]]></title><description><![CDATA[<p dir="auto">Can anyone demonstrate the example for subscribing to certain MQTT topic? All I'm getting is an error: "'NoneType' object has no attribute 'subscribe'". Meanwhile publishing to MQTT works as it should.</p>
]]></description><link>https://community.m5stack.com/topic/5282/can-t-subscribe-to-mqtt-topic</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 14:32:27 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5282.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 May 2023 10:32:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Tue, 20 Jun 2023 08:47:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/36189">@lbuque</a> Thanks a million to You, I finally got the code working! Looks like the thing I was missing was to use "MQTT apply for messaging" block in the loop. And changing the default 0 keepalive value (after some searching I found it caused problems with my Mosquitto broker).</p>
]]></description><link>https://community.m5stack.com/post/21240</link><guid isPermaLink="true">https://community.m5stack.com/post/21240</guid><dc:creator><![CDATA[Oskars]]></dc:creator><pubDate>Tue, 20 Jun 2023 08:47:11 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Mon, 19 Jun 2023 03:56:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/38897">@Oskars</a></p>
<p dir="auto">version: Alpha-17</p>
<p dir="auto"><img src="/assets/uploads/files/1687146693829-962d9af4-e8c5-4fd8-97bb-ee12201bde39-image-resized.png" alt="0_1687146705149_962d9af4-e8c5-4fd8-97bb-ee12201bde39-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-python">import os, sys, io
import M5
from M5 import *
from umqtt import *


label0 = None
label2 = None
label1 = None
label3 = None
mqtt_client = None


def mqtt_testtopic_event(data):
  global label0, label2, label1, label3, mqtt_client
  label0.setText(str(((str('Topic:') + str((data[0]))))))
  label1.setText(str(((data[1]).decode())))


def mqtt_testtopic1_event(data):
  global label0, label2, label1, label3, mqtt_client
  label2.setText(str(((str('Topic:') + str((data[0]))))))
  label3.setText(str(((data[1]).decode())))


def setup():
  global label0, label2, label1, label3, mqtt_client

  M5.begin()
  label0 = Widgets.Label("Text", 4, 3, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
  label2 = Widgets.Label("Text", 4, 55, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
  label1 = Widgets.Label("Text", 4, 29, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
  label3 = Widgets.Label("Text", 3, 81, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)

  mqtt_client = MQTTClient('umqtt_client', '192.168.2.50', port=1883, user='m5stack', password='m5stack', keepalive=0)
  mqtt_client.connect(clean_session=True)
  mqtt_client.subscribe('testtopic', mqtt_testtopic_event, qos=0)
  mqtt_client.subscribe('testtopic1', mqtt_testtopic1_event, qos=0)
  label0.setFont(Widgets.FONTS.DejaVu12)
  label1.setFont(Widgets.FONTS.DejaVu12)
  label2.setFont(Widgets.FONTS.DejaVu12)
  label3.setFont(Widgets.FONTS.DejaVu12)


def loop():
  global label0, label2, label1, label3, mqtt_client
  M5.update()
  mqtt_client.wait_msg()


if __name__ == '__main__':
  try:
    setup()
    while True:
      loop()
  except (Exception, KeyboardInterrupt) as e:
    try:
      from utility import print_error_msg
      print_error_msg(e)
    except ImportError:
      print("please update to latest firmware")

</code></pre>
<p dir="auto">test_mqtt.m5f2</p>
<pre><code class="language-json">{"version":"V2.0","type":"atoms3","components":[{"name":"screen","type":"screen","layer":0,"screenId":"","screenName":"","id":"__atoms3_screen","createTime":1681463262614,"x":0,"y":0,"width":280,"height":280,"backgroundColor":"#000","size":0},{"name":"label0","type":"label","layer":1,"screenId":"builtin","screenName":"","id":"v^k&amp;_0&amp;lzY#a-pVu","createTime":1681787932237,"x":4,"y":3,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0},{"name":"label1","type":"label","layer":2,"screenId":"builtin","screenName":"","id":"lg-u6bmP&amp;KAb-BFg","createTime":1681787940036,"x":4,"y":29,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0},{"name":"label2","type":"label","layer":1,"screenId":"builtin","screenName":"","id":"m+Am3fMqYyQ$+VEm","createTime":1681788301006,"x":4,"y":55,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"width":37,"height":20},{"name":"label3","type":"label","layer":2,"screenId":"builtin","screenName":"","id":"fj^rW#mTo@K0dL5r","createTime":1681788303358,"x":3,"y":81,"color":"#ffffff","backgroundColor":"#222222","text":"Text","engine":"gfx","font":"Widgets.FONTS.DejaVu18","rotation":0,"width":37,"height":20}],"resources":[{"software":["mqtt"]}],"units":[],"hats":[],"i2cs":[],"blockly":"&lt;block type=\"basic_on_loop\" id=\"loop_block\" deletable=\"false\" x=\"490\" y=\"70\"&gt;&lt;mutation isUpdate=\"true\"&gt;&lt;/mutation&gt;&lt;field name=\"UPDATEOP\"&gt;true&lt;/field&gt;&lt;statement name=\"FUNC\"&gt;&lt;block type=\"system_m5_update\" id=\"system_m5_update\"&gt;&lt;next&gt;&lt;block type=\"mqtt_wait_msg\" id=\"T1rVj/Q%g){|@a=eic@f\"&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/statement&gt;&lt;/block&gt;&lt;block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"130\" y=\"110\"&gt;&lt;mutation isBegin=\"true\"&gt;&lt;/mutation&gt;&lt;field name=\"UPDATEOP\"&gt;true&lt;/field&gt;&lt;statement name=\"FUNC\"&gt;&lt;block type=\"system_m5_begin\" id=\"system_m5_begin\"&gt;&lt;next&gt;&lt;block type=\"mqtt_set_client\" id=\"g+(|o=#m4jpn7OLPkw)J\"&gt;&lt;value name=\"ID\"&gt;&lt;shadow type=\"text\" id=\"?[M!b8*f#bx*SpMXH!!5\"&gt;&lt;field name=\"TEXT\"&gt;umqtt_client&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;value name=\"SERVER\"&gt;&lt;shadow type=\"text\" id=\"oNzSR(TF-,inxj~YS2}#\"&gt;&lt;field name=\"TEXT\"&gt;192.168.2.76&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;value name=\"PORT\"&gt;&lt;shadow type=\"math_number\" id=\"e~GXuZ!~qfASA;IYe3f=\"&gt;&lt;mutation max=\"Infinity\" min=\"-Infinity\" precision=\"0\"&gt;&lt;/mutation&gt;&lt;field name=\"NUM\"&gt;1883&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;value name=\"USER\"&gt;&lt;shadow type=\"text\" id=\"3PbUi]|zTswyRzP*h=Zm\"&gt;&lt;field name=\"TEXT\"&gt;m5stack&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;value name=\"PASSWORD\"&gt;&lt;shadow type=\"text\" id=\"d.(iU%~um%@j5=N8C!9:\"&gt;&lt;field name=\"TEXT\"&gt;m5stack&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;value name=\"KEEPALIVE\"&gt;&lt;shadow type=\"math_slider\" id=\"4lCv3Yqkt^hJHwEHH,R)\"&gt;&lt;mutation max=\"65535\" min=\"0\" step=\"1\" precision=\"1\"&gt;&lt;/mutation&gt;&lt;field name=\"NUM\"&gt;0&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;next&gt;&lt;block type=\"mqtt_connect\" id=\"N$GCr?UqrYp~!@[yZfZ~\"&gt;&lt;field name=\"CLEAN\"&gt;True&lt;/field&gt;&lt;next&gt;&lt;block type=\"label_set_font\" id=\"sBjX6,JwP2hIWbkZU]#L\"&gt;&lt;field name=\"NAME\"&gt;label0&lt;/field&gt;&lt;field name=\"FONT\"&gt;Widgets.FONTS.DejaVu12&lt;/field&gt;&lt;next&gt;&lt;block type=\"label_set_font\" id=\"l{(uGTFfhsb)s(6iS/hU\"&gt;&lt;field name=\"NAME\"&gt;label1&lt;/field&gt;&lt;field name=\"FONT\"&gt;Widgets.FONTS.DejaVu12&lt;/field&gt;&lt;next&gt;&lt;block type=\"label_set_font\" id=\"Rn6r~[cLiSQf+]nM8sTq\"&gt;&lt;field name=\"NAME\"&gt;label2&lt;/field&gt;&lt;field name=\"FONT\"&gt;Widgets.FONTS.DejaVu12&lt;/field&gt;&lt;next&gt;&lt;block type=\"label_set_font\" id=\"oaK+AUCEaQtl@kR^|jP;\"&gt;&lt;field name=\"NAME\"&gt;label3&lt;/field&gt;&lt;field name=\"FONT\"&gt;Widgets.FONTS.DejaVu12&lt;/field&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/statement&gt;&lt;/block&gt;&lt;block type=\"mqtt_subscribe\" id=\"w7Ov@_:I,|/99:[91gQ+\" x=\"90\" y=\"570\"&gt;&lt;value name=\"MSG\"&gt;&lt;shadow type=\"text\" id=\"5+0D;yAI;M9Kab.KdV([\"&gt;&lt;field name=\"TEXT\"&gt;testtopic&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;statement name=\"FUNC\"&gt;&lt;block type=\"label_set_text\" id=\"qN{uc|lEU4,^0u_YYo@7\"&gt;&lt;field name=\"NAME\"&gt;label0&lt;/field&gt;&lt;value name=\"TEXT\"&gt;&lt;shadow type=\"text\" id=\"5~k^hoGX6L}naX9o!pt=\"&gt;&lt;field name=\"TEXT\"&gt;Label&lt;/field&gt;&lt;/shadow&gt;&lt;block type=\"text_add_str\" id=\"tAsN]8zdz!{wa]J5fQRj\"&gt;&lt;value name=\"VALUE1\"&gt;&lt;shadow type=\"text\" id=\"NTGIBKM?0;M)9Q$?/F/E\"&gt;&lt;field name=\"TEXT\"&gt;Topic:&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;value name=\"VALUE2\"&gt;&lt;block type=\"mqtt_get_topic\" id=\"O)j9sIdBDlw?k(Y4#E{]\"&gt;&lt;/block&gt;&lt;/value&gt;&lt;/block&gt;&lt;/value&gt;&lt;next&gt;&lt;block type=\"label_set_text\" id=\"AIj|L5*V}(Na=i~]!Wr{\"&gt;&lt;field name=\"NAME\"&gt;label1&lt;/field&gt;&lt;value name=\"TEXT\"&gt;&lt;shadow type=\"text\" id=\"9gNvISVfV@]35[tz`S6-\" disabled=\"true\"&gt;&lt;field name=\"TEXT\"&gt;Label&lt;/field&gt;&lt;/shadow&gt;&lt;block type=\"text_decode_str\" id=\"}[Ilzb9o=Qd12AOz*Q/k\"&gt;&lt;value name=\"VALUE\"&gt;&lt;block type=\"mqtt_get_msg\" id=\"p48aW7MN4QcC/]H_RqLv\"&gt;&lt;/block&gt;&lt;/value&gt;&lt;/block&gt;&lt;/value&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/statement&gt;&lt;/block&gt;&lt;block type=\"mqtt_subscribe\" id=\":g;Bc#f6bCJv3D=P,C24\" x=\"690\" y=\"550\"&gt;&lt;value name=\"MSG\"&gt;&lt;shadow type=\"text\" id=\"p!BP(rRWfzb8%w2;)|Z/\"&gt;&lt;field name=\"TEXT\"&gt;testtopic1&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;statement name=\"FUNC\"&gt;&lt;block type=\"label_set_text\" id=\"+{@FB5tyv:a,[(0)S^?^\"&gt;&lt;field name=\"NAME\"&gt;label2&lt;/field&gt;&lt;value name=\"TEXT\"&gt;&lt;shadow type=\"text\" id=\"5~k^hoGX6L}naX9o!pt=\"&gt;&lt;field name=\"TEXT\"&gt;Label&lt;/field&gt;&lt;/shadow&gt;&lt;block type=\"text_add_str\" id=\"MOXaUlFRx59,!q}DPD;6\"&gt;&lt;value name=\"VALUE1\"&gt;&lt;shadow type=\"text\" id=\"ABnF09VK)vlEkGQ|B9P*\"&gt;&lt;field name=\"TEXT\"&gt;Topic:&lt;/field&gt;&lt;/shadow&gt;&lt;/value&gt;&lt;value name=\"VALUE2\"&gt;&lt;block type=\"mqtt_get_topic\" id=\"3w2H7IRX7ZEIXgo$ZPFE\"&gt;&lt;/block&gt;&lt;/value&gt;&lt;/block&gt;&lt;/value&gt;&lt;next&gt;&lt;block type=\"label_set_text\" id=\"sAd`+qhCgZXd{Kt,+h$r\"&gt;&lt;field name=\"NAME\"&gt;label3&lt;/field&gt;&lt;value name=\"TEXT\"&gt;&lt;shadow type=\"text\" id=\"9gNvISVfV@]35[tz`S6-\" disabled=\"true\"&gt;&lt;field name=\"TEXT\"&gt;Label&lt;/field&gt;&lt;/shadow&gt;&lt;block type=\"text_decode_str\" id=\"(3lEfMbcJYt7tw_fl=%3\"&gt;&lt;value name=\"VALUE\"&gt;&lt;block type=\"mqtt_get_msg\" id=\"YAAO(q1I]VjM1vGhYh2R\"&gt;&lt;/block&gt;&lt;/value&gt;&lt;/block&gt;&lt;/value&gt;&lt;/block&gt;&lt;/next&gt;&lt;/block&gt;&lt;/statement&gt;&lt;/block&gt;","screen":[{"simulationName":"Built-in","type":"builtin","width":128,"height":128,"scale":1.3,"screenName":"","blockId":"","id":"builtin","createTime":1681463262611}]}
</code></pre>
]]></description><link>https://community.m5stack.com/post/21232</link><guid isPermaLink="true">https://community.m5stack.com/post/21232</guid><dc:creator><![CDATA[lbuque]]></dc:creator><pubDate>Mon, 19 Jun 2023 03:56:56 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Sat, 10 Jun 2023 00:03:27 GMT]]></title><description><![CDATA[<p dir="auto">MQTT topic subscribe still seems to be not working in Alpha 16 - no error but no activity on message receiving either. Anyone else has the same issue?</p>
]]></description><link>https://community.m5stack.com/post/21149</link><guid isPermaLink="true">https://community.m5stack.com/post/21149</guid><dc:creator><![CDATA[Oskars]]></dc:creator><pubDate>Sat, 10 Jun 2023 00:03:27 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Sat, 27 May 2023 16:21:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> It would be good if M5stack had some sort of chart or spreadsheet that stated what currently worked and what didn't. Also an eta for things coming etc. Compared with the number of M5stack youtube "how to" videos that appeared for previous "Core" products, the CoreS3 is suffering. Maybe I got on the Core2/Fire bandwagon after most teething troubles were fixed and most features  were no longer "Alpha"!</p>
]]></description><link>https://community.m5stack.com/post/21008</link><guid isPermaLink="true">https://community.m5stack.com/post/21008</guid><dc:creator><![CDATA[UKTechguy]]></dc:creator><pubDate>Sat, 27 May 2023 16:21:42 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Sat, 27 May 2023 15:10:12 GMT]]></title><description><![CDATA[<p dir="auto">Its is still alpha so not the finale item and ma have code changed.</p>
]]></description><link>https://community.m5stack.com/post/21005</link><guid isPermaLink="true">https://community.m5stack.com/post/21005</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sat, 27 May 2023 15:10:12 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Sat, 27 May 2023 13:39:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> Somewhat annoying that so much seems to be broken at the moment. We have no buttons and I cannot work out how to do anything with the microsd card. Would like to play a wav alarm file when specific MQTT message is received. Neither seems possible yet.</p>
]]></description><link>https://community.m5stack.com/post/21004</link><guid isPermaLink="true">https://community.m5stack.com/post/21004</guid><dc:creator><![CDATA[UKTechguy]]></dc:creator><pubDate>Sat, 27 May 2023 13:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Sat, 27 May 2023 10:22:24 GMT]]></title><description><![CDATA[<p dir="auto">Hello guys</p>
<p dir="auto">just tested again. MQTT subscribe is still broken for me in alpha 14. Please fix.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/21001</link><guid isPermaLink="true">https://community.m5stack.com/post/21001</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sat, 27 May 2023 10:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Wed, 24 May 2023 19:37:30 GMT]]></title><description><![CDATA[<p dir="auto">Any news here?</p>
]]></description><link>https://community.m5stack.com/post/20969</link><guid isPermaLink="true">https://community.m5stack.com/post/20969</guid><dc:creator><![CDATA[alwa123]]></dc:creator><pubDate>Wed, 24 May 2023 19:37:30 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Sat, 13 May 2023 08:50:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> Thank You, after I changed the code via Thonny and moved mqtt_client.subscribe after initialization the error disappeared. However the device still does not react to MQTT topics it has subscribed. So the bug is not only in UIFlow2 (incorrectly placed subscribe call) but also in MQTT library or firmware?</p>
]]></description><link>https://community.m5stack.com/post/20839</link><guid isPermaLink="true">https://community.m5stack.com/post/20839</guid><dc:creator><![CDATA[Oskars]]></dc:creator><pubDate>Sat, 13 May 2023 08:50:24 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Wed, 10 May 2023 19:59:23 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/38897">@Oskars</a></p>
<p dir="auto">FWIW: global variable <code>mqtt_client</code> is used in setup to subscribe before it is initialized. Unfortunately in UIFlow2 the Python tab is non functional yet, so the sequence cannot be fixed on the fly.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/20809</link><guid isPermaLink="true">https://community.m5stack.com/post/20809</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 10 May 2023 19:59:23 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Wed, 10 May 2023 13:10:01 GMT]]></title><description><![CDATA[<p dir="auto">@ajb2k3In that case, is there an option to use UIFlow with S3 while UIFlow2 is "for testing only"? I did not see any warnings saying "things will not work" while buying it. Is there any timeframe when the already enabled functionality might work? I'm currently not asking about new features or support for more hardware, just for the things that already are available in UI.</p>
]]></description><link>https://community.m5stack.com/post/20808</link><guid isPermaLink="true">https://community.m5stack.com/post/20808</guid><dc:creator><![CDATA[Oskars]]></dc:creator><pubDate>Wed, 10 May 2023 13:10:01 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Wed, 10 May 2023 12:40:22 GMT]]></title><description><![CDATA[<p dir="auto">Well that explains it. MQTT in UIFlow is a bit broken as UIFlow2 is for testing only</p>
]]></description><link>https://community.m5stack.com/post/20807</link><guid isPermaLink="true">https://community.m5stack.com/post/20807</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 10 May 2023 12:40:22 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Wed, 10 May 2023 12:22:17 GMT]]></title><description><![CDATA[<p dir="auto">Hardware used is Atom S3, software  - UiFlow2.<br />
My UiFlow2 code:<br />
<img src="/assets/uploads/files/1683720996831-uiflow2-resized.png" alt="0_1683721000559_uiflow2.png" class=" img-fluid img-markdown" /><br />
Without "MQTT subscribe" block all else works.<br />
Error when running on device:<br />
<img src="/assets/uploads/files/1683721023073-error.jpeg" alt="0_1683721028662_error.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Python code generated by UiFlow:</p>
<p dir="auto">import os, sys, io<br />
import M5<br />
from M5 import *<br />
from umqtt import *</p>
<p dir="auto">circle0 = None<br />
mqtt_client = None</p>
<p dir="auto">def mqtt_mqttDebugIncoming_event(data):<br />
global circle0, mqtt_client<br />
circle0.setColor(color=0x009900, fill_c=0x009900)</p>
<p dir="auto">def setup():<br />
global circle0, mqtt_client<br />
mqtt_client.subscribe('mqttDebugIncoming', mqtt_mqttDebugIncoming_event, qos=0)</p>
<p dir="auto">M5.begin()<br />
circle0 = Widgets.Circle(62, 62, 50, 0xffffff, 0xffffff)</p>
<p dir="auto">mqtt_client = MQTTClient('mqttDebug', 'homeassistant.local', port=1883, user='mqttdebug', password='mqttdebug', keepalive=300)<br />
mqtt_client.connect(clean_session=True)<br />
mqtt_client.publish('mqttDebugOutgoing', 'This works, broker receives message!', qos=0)<br />
circle0.setColor(color=0x3333ff, fill_c=0x3333ff)</p>
<p dir="auto">def loop():<br />
global circle0, mqtt_client<br />
M5.update()</p>
<p dir="auto">if <strong>name</strong> == '<strong><strong>main</strong></strong>': # Forum message formatter messes this up<br />
try:<br />
setup()<br />
while True:<br />
loop()<br />
except (Exception, KeyboardInterrupt) as e:<br />
try:<br />
from utility import print_error_msg<br />
print_error_msg(e)<br />
except ImportError:<br />
print("please update to latest firmware")</p>
]]></description><link>https://community.m5stack.com/post/20806</link><guid isPermaLink="true">https://community.m5stack.com/post/20806</guid><dc:creator><![CDATA[Oskars]]></dc:creator><pubDate>Wed, 10 May 2023 12:22:17 GMT</pubDate></item><item><title><![CDATA[Reply to Can&#x27;t subscribe to MQTT topic on Wed, 10 May 2023 09:09:24 GMT]]></title><description><![CDATA[<p dir="auto">What hardware and software are you using as that’s a hardware base error</p>
]]></description><link>https://community.m5stack.com/post/20805</link><guid isPermaLink="true">https://community.m5stack.com/post/20805</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 10 May 2023 09:09:24 GMT</pubDate></item></channel></rss>