<?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[Using MQTT deletes UI elements on M5StickC Plus]]></title><description><![CDATA[<p dir="auto">I am using UI Flow V 1.7.5 in the browser.<br />
I am using an M5StickC Plus with the newest UI Firmware V1.7.5-plus</p>
<p dir="auto">When I use the M5mqtt - Library all my UI elements like labels disappear.<br />
When I switch from blockly to python code and move the UI-elements AFTER the mqtt block, this does not happen. That change gets lost every time I change back to blockly.</p>
<p dir="auto">I run very similar code on the M5Stack Fire and the problem does not appear there.</p>
<p dir="auto">Example 1: This is the generated code and it makes the three labels disappear</p>
<p dir="auto">from m5stack import *<br />
from m5ui import *<br />
from uiflow import *<br />
import wifiCfg<br />
from m5mqtt import M5mqtt</p>
<p dir="auto">setScreenColor(0x111111)</p>
<p dir="auto">wifiCfg.autoConnect(lcdShow=False)<br />
button_a = M5TextBox(45, 213, "Mqtt D", lcd.FONT_Default, 0xFFFFFF, rotate=0)<br />
mqtt_msg = M5TextBox(33, 84, "...", lcd.FONT_DejaVu72, 0xFFFFFF, rotate=0)<br />
button_b = M5TextBox(86, 35, "Mqtt E", lcd.FONT_Default, 0xFFFFFF, rotate=0)</p>
<p dir="auto">def fun_mirror_cmd_(topic_data):<br />
mqtt_msg.setText(str(topic_data))<br />
pass</p>
<p dir="auto">def buttonA_wasPressed():<br />
m5mqtt.publish(str('mirror/cmd'),str('D'))<br />
pass<br />
btnA.wasPressed(buttonA_wasPressed)</p>
<p dir="auto">def buttonB_wasPressed():<br />
m5mqtt.publish(str('mirror/cmd'),str('E'))<br />
pass<br />
btnB.wasPressed(buttonB_wasPressed)</p>
<p dir="auto">m5mqtt = M5mqtt('m5StickC', '192.168.1.106', 1883, '', '', 300)<br />
m5mqtt.subscribe(str('mirror/cmd'), fun_mirror_cmd_)<br />
m5mqtt.start()</p>
<p dir="auto">Example 2: This is the slightly altered code (the UI-Elements have been moved to the end) and the labels stay</p>
<p dir="auto">from m5stack import *<br />
from m5ui import *<br />
from uiflow import *<br />
import wifiCfg<br />
from m5mqtt import M5mqtt</p>
<p dir="auto">setScreenColor(0x111111)</p>
<p dir="auto">wifiCfg.autoConnect(lcdShow=False)</p>
<p dir="auto">def fun_mirror_cmd_(topic_data):<br />
mqtt_msg.setText(str(topic_data))<br />
pass</p>
<p dir="auto">def buttonA_wasPressed():<br />
m5mqtt.publish(str('mirror/cmd'),str('D'))<br />
pass<br />
btnA.wasPressed(buttonA_wasPressed)</p>
<p dir="auto">def buttonB_wasPressed():<br />
m5mqtt.publish(str('mirror/cmd'),str('E'))<br />
pass<br />
btnB.wasPressed(buttonB_wasPressed)</p>
<p dir="auto">m5mqtt = M5mqtt('m5StickC', '192.168.1.106', 1883, '', '', 300)<br />
m5mqtt.subscribe(str('mirror/cmd'), fun_mirror_cmd_)<br />
m5mqtt.start()</p>
<p dir="auto">button_a = M5TextBox(45, 213, "Mqtt D", lcd.FONT_Default, 0xFFFFFF, rotate=0)<br />
mqtt_msg = M5TextBox(33, 84, "...", lcd.FONT_DejaVu72, 0xFFFFFF, rotate=0)<br />
button_b = M5TextBox(86, 35, "Mqtt E", lcd.FONT_Default, 0xFFFFFF, rotate=0)</p>
]]></description><link>https://community.m5stack.com/topic/3213/using-mqtt-deletes-ui-elements-on-m5stickc-plus</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 19:42:52 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3213.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Apr 2021 23:46:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using MQTT deletes UI elements on M5StickC Plus on Tue, 01 Jun 2021 01:29:34 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, there is no reply for a long time, we will investigate this bug.</p>
]]></description><link>https://community.m5stack.com/post/13966</link><guid isPermaLink="true">https://community.m5stack.com/post/13966</guid><dc:creator><![CDATA[IAMLIUBO]]></dc:creator><pubDate>Tue, 01 Jun 2021 01:29:34 GMT</pubDate></item><item><title><![CDATA[Reply to Using MQTT deletes UI elements on M5StickC Plus on Sun, 30 May 2021 11:23:11 GMT]]></title><description><![CDATA[<p dir="auto">I've run into similar issues, I have elements on the StickC that disappear or only work with certain fonts, the UI designer itself won't let me place items on parts of the StickC screen, and whole chunks of code don't run.</p>
<p dir="auto">I've worked around it for now in my Test Application, but this is a serious problem for anyone trying to build something complex.</p>
<p dir="auto">Most cases, I've had to shift the location of the MQTT code in the python in order to activate parts of the on screen functionality, seems like maybe a library is conflicting or interfering with the rest of the code.</p>
]]></description><link>https://community.m5stack.com/post/13954</link><guid isPermaLink="true">https://community.m5stack.com/post/13954</guid><dc:creator><![CDATA[DaveC]]></dc:creator><pubDate>Sun, 30 May 2021 11:23:11 GMT</pubDate></item></channel></rss>