<?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 know when the power of the USB port is cut off?]]></title><description><![CDATA[<p dir="auto">Hi Everyone,</p>
<p dir="auto">I need to record how long a vehicle is on, for this I have to know when the power of the USB port is cut off. Does anyone have any idea how to do that?</p>
<p dir="auto">Regards</p>
]]></description><link>https://community.m5stack.com/topic/787/how-to-know-when-the-power-of-the-usb-port-is-cut-off</link><generator>RSS for Node</generator><lastBuildDate>Mon, 04 May 2026 13:15:10 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/787.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Mar 2019 03:10:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Wed, 04 Sep 2019 01:13:12 GMT]]></title><description><![CDATA[<p dir="auto">Are you using an older version of the library? if so would you mind telling me which version. You can check in the manage libraries panel</p>
]]></description><link>https://community.m5stack.com/post/5446</link><guid isPermaLink="true">https://community.m5stack.com/post/5446</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Wed, 04 Sep 2019 01:13:12 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Tue, 03 Sep 2019 19:17:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lukasmaximus" aria-label="Profile: lukasmaximus">@<bdi>lukasmaximus</bdi></a> m5Stack library version?</p>
]]></description><link>https://community.m5stack.com/post/5443</link><guid isPermaLink="true">https://community.m5stack.com/post/5443</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Tue, 03 Sep 2019 19:17:44 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Tue, 03 Sep 2019 03:18:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cepics" aria-label="Profile: cepics">@<bdi>cepics</bdi></a> I get the error "Class M5Stack has no member named Power"</p>
]]></description><link>https://community.m5stack.com/post/5433</link><guid isPermaLink="true">https://community.m5stack.com/post/5433</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Tue, 03 Sep 2019 03:18:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Thu, 29 Aug 2019 13:30:09 GMT]]></title><description><![CDATA[<p dir="auto">I found this:</p>
<pre><code>M5.Power.isCharging()
</code></pre>
]]></description><link>https://community.m5stack.com/post/5371</link><guid isPermaLink="true">https://community.m5stack.com/post/5371</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Thu, 29 Aug 2019 13:30:09 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Tue, 27 Aug 2019 14:52:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/hardmax" aria-label="Profile: hardmax">@<bdi>hardmax</bdi></a> said in <a href="/post/3420">How to know when the power of the USB port is cut off?</a>:</p>
<blockquote>
<p dir="auto">I found this solution:</p>
<pre><code>uint8_t getIP5306REG(uint8_t reg)
{
	Wire.beginTransmission(0x75);
	Wire.write(reg);
	if (Wire.endTransmission(false) == 0
		&amp;&amp; Wire.requestFrom(0x75, 1)) {
		return Wire.read();
	}
	return 0;
}

bool batery_mode = (getIP5306REG(0x70) &amp; 0x04) // Return 1 Batery Mode, 0 Charging or V_In enable
</code></pre>
</blockquote>
<p dir="auto">is it working for you?</p>
<p dir="auto">tnks</p>
]]></description><link>https://community.m5stack.com/post/5318</link><guid isPermaLink="true">https://community.m5stack.com/post/5318</guid><dc:creator><![CDATA[cepics]]></dc:creator><pubDate>Tue, 27 Aug 2019 14:52:41 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Sun, 24 Mar 2019 21:24:25 GMT]]></title><description><![CDATA[<p dir="auto">I found this solution:</p>
<p dir="auto">uint8_t getIP5306REG(uint8_t reg)<br />
{<br />
Wire.beginTransmission(0x75);<br />
Wire.write(reg);<br />
if (Wire.endTransmission(false) == 0<br />
&amp;&amp; Wire.requestFrom(0x75, 1)) {<br />
return Wire.read();<br />
}<br />
return 0;<br />
}</p>
<p dir="auto">bool batery_mode = (getIP5306REG(0x70) &amp; 0x04) // Return 1 Batery Mode, 0 Charging or V_In enable</p>
]]></description><link>https://community.m5stack.com/post/3420</link><guid isPermaLink="true">https://community.m5stack.com/post/3420</guid><dc:creator><![CDATA[hardmax]]></dc:creator><pubDate>Sun, 24 Mar 2019 21:24:25 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Sat, 23 Mar 2019 14:34:36 GMT]]></title><description><![CDATA[<p dir="auto">I found this info about controler charger:</p>
<p dir="auto">IP5306 <a href="https://yadi.sk/i/dRp0HTF4oPCo2g" target="_blank" rel="noopener noreferrer nofollow ugc">https://yadi.sk/i/dRp0HTF4oPCo2g</a></p>
<p dir="auto">Same thing for IP5209 IP5109 IP5207 IP5108<br />
<a href="https://yadi.sk/i/oNhqTei36jFwSg" target="_blank" rel="noopener noreferrer nofollow ugc">https://yadi.sk/i/oNhqTei36jFwSg</a></p>
<p dir="auto">I going to try found something about external power...<br />
I write to you when I find what I'm looking for</p>
]]></description><link>https://community.m5stack.com/post/3402</link><guid isPermaLink="true">https://community.m5stack.com/post/3402</guid><dc:creator><![CDATA[hardmax]]></dc:creator><pubDate>Sat, 23 Mar 2019 14:34:36 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Fri, 22 Mar 2019 14:26:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/watson" aria-label="Profile: watson">@<bdi>watson</bdi></a> Its a tractor...I use a USB Charger (12v to 5v USB..I connect M5 to USB) and when I turn on the tractor, it power on M5 (because power in adapter is ON)...<br />
The problem is when I turn off the tractor, the M5 is still on for several minutes more by the internal battery...I need to detect when the external power to the M5 is removed (the tractor shuts down and register that time) and that it remains on for a few minutes so that it finishes sending the data and then Power Off the M5.</p>
<p dir="auto">Do you have any Idea??...I try to Ask to Internal IP5306 charger, but i dont find any register that show if externaly is connected ( I find, status of charge, batery level but not external power) (<a href="https://github.com/m5stack/M5Stack/issues/74" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5Stack/issues/74</a>)</p>
]]></description><link>https://community.m5stack.com/post/3399</link><guid isPermaLink="true">https://community.m5stack.com/post/3399</guid><dc:creator><![CDATA[hardmax]]></dc:creator><pubDate>Fri, 22 Mar 2019 14:26:48 GMT</pubDate></item><item><title><![CDATA[Reply to How to know when the power of the USB port is cut off? on Fri, 22 Mar 2019 04:31:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hardmax" aria-label="Profile: hardmax">@<bdi>hardmax</bdi></a> What's your specific meaning? What's the vehicle?</p>
]]></description><link>https://community.m5stack.com/post/3382</link><guid isPermaLink="true">https://community.m5stack.com/post/3382</guid><dc:creator><![CDATA[m5-docs]]></dc:creator><pubDate>Fri, 22 Mar 2019 04:31:39 GMT</pubDate></item></channel></rss>