<?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[Randomness ...]]></title><description><![CDATA[<p dir="auto">So I decided to use UIFlow/Core2 to build a Nest-like smart thermostat. The thermostat communicates with the outside world (Home Assistant, AC Relay, Heater Relay, Fan Relay, etc.) through MQTT. All of the HVAC functionality (setting target temperature, deciding to turn on/off heat/AC, handling cycle times, swing mode, etc.) are built into my code.</p>
<p dir="auto">You can download my code from github: <a href="https://github.com/marcvl64/M5Stack-Core2-Thermostat" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/marcvl64/M5Stack-Core2-Thermostat</a> and also check out a screenshot of what the UI looks like.<img src="/assets/uploads/files/1616103463420-screen-shot-2021-03-18-at-2.36.06-pm-resized.png" alt="0_1616103460908_Screen Shot 2021-03-18 at 2.36.06 PM.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The code is missing certain pieces (MQTT comms with HA's HVAC platform is missing), but by and far, all features mentioned above are done.</p>
<p dir="auto">As I started adding more features, I increasingly started noticing random behavior when uploading my code to the Core2. Specifically:</p>
<ul>
<li>
<p dir="auto">Background color changes make certain display elements disappear. They might come back after a screen refresh (20 sec) or they might not. It's random.</p>
</li>
<li>
<p dir="auto">The buttons at the bottom of the screen don't work reliably. After upload, 1 might work, sometimes 2, and if I'm lucky all 3 will work. Again random.</p>
</li>
<li>
<p dir="auto">Sometimes everything just freezes for no apparent reason.</p>
</li>
<li>
<p dir="auto">Sometimes when I add a completely innocent line of code (display debug info), I see odd behavior after uploading (e.g. certain screen elements that used to show up no longer show).</p>
</li>
</ul>
<p dir="auto">I have 3 questions:<br />
1/ Am I trying to do too much with UIFlow? Have I outgrown the resources of the Core2? How would I know? How can I monitor what is going on?<br />
2/ If yes, what would be the better development environment? Arduino?<br />
3/ If no, what am I doing wrong?</p>
]]></description><link>https://community.m5stack.com/topic/3102/randomness</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:21:11 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3102.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Mar 2021 21:38:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Randomness ... on Wed, 23 Feb 2022 07:44:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/joefly" aria-label="Profile: joefly">@<bdi>joefly</bdi></a></p>
<p dir="auto">adding some small delays fixes the artifacts for me:</p>
<pre><code>import time

wait_ms(25)
touch_button0.set_hidden(True)
wait_ms(25)
lcd.circle(130, 100, 90, fillcolor=0xffff66)
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/16737</link><guid isPermaLink="true">https://community.m5stack.com/post/16737</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 23 Feb 2022 07:44:00 GMT</pubDate></item><item><title><![CDATA[Reply to Randomness ... on Tue, 22 Feb 2022 06:13:40 GMT]]></title><description><![CDATA[<p dir="auto">I think this is similar to the above problem.  But it consistently happens as I demonstrated with this<br />
Core2 UIFLOW v1.9.1<br />
<img src="/assets/uploads/files/1645510140563-7ac687f7-1e51-4842-8d5f-0646dabdf2fe-image-resized.png" alt="0_1645510136123_7ac687f7-1e51-4842-8d5f-0646dabdf2fe-image.png" class=" img-fluid img-markdown" /><br />
with Python code</p>
<p dir="auto">from m5stack import *<br />
from m5stack_ui import *<br />
from uiflow import *</p>
<p dir="auto">screen = M5Screen()<br />
screen.clean_screen()<br />
screen.set_screen_bg_color(0x000000)</p>
<p dir="auto">touch_button0 = M5Btn(text='Button', x=22, y=86, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)<br />
touch_button1 = M5Btn(text='Button', x=117, y=86, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)<br />
touch_button2 = M5Btn(text='Button', x=213, y=86, w=70, h=30, bg_c=0xFFFFFF, text_c=0x000000, font=FONT_MONT_14, parent=None)<br />
touch_button0.set_hidden(True)<br />
lcd.circle(130, 100, 90, fillcolor=0xffff66)</p>
<p dir="auto">if you run the code in UIflow, it shows different results but it consistently shows the "artifact" of the hidden button.</p>
<p dir="auto">how do you get rid of the hidden button artifact?</p>
]]></description><link>https://community.m5stack.com/post/16725</link><guid isPermaLink="true">https://community.m5stack.com/post/16725</guid><dc:creator><![CDATA[joefly]]></dc:creator><pubDate>Tue, 22 Feb 2022 06:13:40 GMT</pubDate></item><item><title><![CDATA[Reply to Randomness ... on Mon, 05 Apr 2021 23:41:34 GMT]]></title><description><![CDATA[<p dir="auto">Update on the randomness .... it's gone :-)</p>
<p dir="auto">Basically, I think my UIFlow project became too complex for the system to handle. So, I rewrote everything in micropython. The code runs very well, no more randomness.</p>
<p dir="auto">Github repository of my MQTT Thermostat running on Core2 is <a href="https://github.com/marcvl64/M5stack-Core2-MQTT-Thermostat" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">It's pretty cool. The thermostat supports various modes: off/auto/manual/heat/cool/fan. You can specify minimum cycle duration as well as set swing mode parameters. It automatically gets discovered by Home Assistant. You can set thermostat mode and target temperature in Home Assistant and they will automatically get reflected on the Core2 display.</p>
<p dir="auto">It currently relies on the ENVII module for temperature reading, and requires a WIFI connection and an active MQTT broker. I haven't had time to implement error handling, so if something goes wrong, it might be non-obvious to figure out why. More work to be done.</p>
]]></description><link>https://community.m5stack.com/post/13380</link><guid isPermaLink="true">https://community.m5stack.com/post/13380</guid><dc:creator><![CDATA[marcvl]]></dc:creator><pubDate>Mon, 05 Apr 2021 23:41:34 GMT</pubDate></item><item><title><![CDATA[Reply to Randomness ... on Fri, 19 Mar 2021 19:12:36 GMT]]></title><description><![CDATA[<p dir="auto">Github link is <a href="https://github.com/marcvl64/M5Stack-Core2-Thermostat" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>. It includes the .m5f file and the images that go above the buttons A, B, and C. I was trying to copy and paste the Python to make it easier to read, but copy/paste doesn't seem to work on my MAC version of the UIFlow software :-(</p>
]]></description><link>https://community.m5stack.com/post/13142</link><guid isPermaLink="true">https://community.m5stack.com/post/13142</guid><dc:creator><![CDATA[marcvl]]></dc:creator><pubDate>Fri, 19 Mar 2021 19:12:36 GMT</pubDate></item><item><title><![CDATA[Reply to Randomness ... on Fri, 19 Mar 2021 14:04:18 GMT]]></title><description><![CDATA[<p dir="auto">1/ Possibly, but I'm not sure how you would verify the extents/limitations of the hardware while using uiFlow. I think in general though, working with the UI elements of uiFlow can be a little tricky at times, especially with more complicated programs like this.  You have to carefully manage the UI elements and the layers they are on. If you make changes on the screen, you might have to update the elements with the <code>Set ... show/hide</code> block to ensure they display properly after making a change to the display. Sometimes it's a bit of trial and error for me.  I have developed some fairly complex flows on the M5Stack devices with uiFlow. <a href="https://github.com/bstein2379/M5Stack-IoT-Pool-Controller" target="_blank" rel="noopener noreferrer nofollow ugc">Here is one example</a>. I'm not a software programmer though, so other people might say it's not complex, but it was for me ;-)</p>
<p dir="auto">2/ Arduino would give you more control vs. uiFlow where you rely on blocks to do the work (coding) for you. If you don't know what's going on "under the covers" of the blocks (due to lack of documentation, uiFlow not being open source, etc.), it's hard to debug the corner-case issues. The downside to Arduino is that UI development is harder (you can't just drag/drop elements to the screen like with uiFlow). Also, you need to be a good programmer and understand all the syntax to make something work :-)</p>
<p dir="auto">3/ Not quite sure yet. I'll give your program a try to see if I can figure anything out. Can you please also post the images that go above buttons A, B, and C? I already have HA set up and ready to go.</p>
]]></description><link>https://community.m5stack.com/post/13136</link><guid isPermaLink="true">https://community.m5stack.com/post/13136</guid><dc:creator><![CDATA[world101]]></dc:creator><pubDate>Fri, 19 Mar 2021 14:04:18 GMT</pubDate></item><item><title><![CDATA[Reply to Randomness ... on Fri, 19 Mar 2021 13:19:04 GMT]]></title><description><![CDATA[<p dir="auto">same for me... sometimes my code is working, i change a little thing and no more working... remove my add and not come back to a working state....</p>
]]></description><link>https://community.m5stack.com/post/13135</link><guid isPermaLink="true">https://community.m5stack.com/post/13135</guid><dc:creator><![CDATA[todely]]></dc:creator><pubDate>Fri, 19 Mar 2021 13:19:04 GMT</pubDate></item><item><title><![CDATA[Reply to Randomness ... on Fri, 19 Mar 2021 09:57:36 GMT]]></title><description><![CDATA[<p dir="auto">Recommendation: use GitHub (or similar) to host your code, not Google Drive :)  It makes things easier to read through quickly, plus people can make pull requests to improve the code.</p>
]]></description><link>https://community.m5stack.com/post/13131</link><guid isPermaLink="true">https://community.m5stack.com/post/13131</guid><dc:creator><![CDATA[fonix232]]></dc:creator><pubDate>Fri, 19 Mar 2021 09:57:36 GMT</pubDate></item></channel></rss>