<?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[How to save battery with M5Stack Core 2]]></title><description><![CDATA[<p dir="auto">Hey guys,<br />
M5Stack Core 2 is my first controller. Normally I work in webdev and gamedev. I'm trying to create a MQTT monitor. The idea is simple: Check for messages every x seconds and display them.</p>
<p dir="auto">But I doubt that my code is efficient :/ The battery (500mAh) is not even lasting a day when constantly checking for MQTT messages in loop function. I tried to implement a timeout for MQTT checks. But that results in messages being not received (see the comment in the loop function).</p>
<p dir="auto">Maybe you could have a look at my code and tell me what I can improve?<br />
<a href="https://www.codebin.cc/code/cm7n9k4ox0001jv03t45j3yaj:AHZXQjLPQ75nXtJ9nq4tuXzUQrWn6hrjDaYAsNySRNT5" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.codebin.cc/code/cm7n9k4ox0001jv03t45j3yaj:AHZXQjLPQ75nXtJ9nq4tuXzUQrWn6hrjDaYAsNySRNT5</a></p>
<p dir="auto">Btw, I'm using UIFlow 2.0. Started using the UI but after looking at the autogenerated code, which was a total disaster, I started to write and optimize the code myself.</p>
]]></description><link>https://community.m5stack.com/topic/7332/how-to-save-battery-with-m5stack-core-2</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 05:07:18 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7332.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Feb 2025 12:14:28 GMT</pubDate><ttl>60</ttl></channel></rss>