<?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[PbHub 1.1 on STAMPLC - Couldn&#x27;t find Pbhub on PortA]]></title><description><![CDATA[<p dir="auto">I am using STAMPLC and have all function included the PWR485 are normal.  However, I purchase a PbHub to use as a extended input for buttons.   I cannot connect the PbHub on PortA or PortC on STAMPLC.<br />
I follow the sample code as follow in setup:<br />
#include "M5UnitPbHub.h"<br />
M5UnitPbHub pbhub;<br />
void setup() {<br />
Serial.begin(115200);<br />
if (!pbhub.begin(&amp;Wire, UNIT_PBHUB_I2C_ADDR, 2, 1, 400000U)) {<br />
Serial.println("Couldn't find Pbhub");<br />
while (1) delay(1);<br />
}<br />
}</p>
<p dir="auto">void loop() {<br />
Serial.printf("ch:%d adc:%d\r\n", 0 , pbhub.analogRead(0));<br />
delay(1);<br />
}</p>
<p dir="auto">The following is the response on Serial Monitor:<br />
Couldn't find Pbhub</p>
<p dir="auto">E (1982) i2c.master: I2C transaction unexpected nack detected<br />
E (1983) i2c.master: s_i2c_synchronous_transaction(924): I2C transaction failed<br />
E (1984) i2c.master: i2c_master_multi_buffer_transmit(1186): I2C transaction failed</p>
<p dir="auto">Wirings and functions are correct, G1 and G2 can get analogue and digital data I/O as normal.  Any hints to solve the problem.   I have write a simple I2C scanner program on Port A G2, G1 pin, there was response from Address 0x61, but Pbhub library cannot read data from Pbhub</p>
]]></description><link>https://community.m5stack.com/topic/7650/pbhub-1-1-on-stamplc-couldn-t-find-pbhub-on-porta</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 16:10:21 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7650.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Jul 2025 04:53:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PbHub 1.1 on STAMPLC - Couldn&#x27;t find Pbhub on PortA on Mon, 07 Jul 2025 03:35:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/232827">@Slarck</a> Thank you.<br />
Just check and add delay before and after pbhub.begin(), the program with only this library is very stable.  However, the program with complete library set was not working.<br />
I tried to remove it ne by one.    Finally, I found somthing :</p>
<ol>
<li>Every time have M5StamPLC.update();  the program cannot read data from Pbhub</li>
<li>I tried to add delay before and after every M5StamPLC.update(), pbhub.begin() Pbhub.analogRead(0), the situation is not solved.</li>
<li>I guess there is some trick while using pbhub together with SD card, StamPLC display , Digital Input scan.   However, at this moment I still cannot make everything working at the same time.</li>
</ol>
]]></description><link>https://community.m5stack.com/post/29414</link><guid isPermaLink="true">https://community.m5stack.com/post/29414</guid><dc:creator><![CDATA[bensonwhlee]]></dc:creator><pubDate>Mon, 07 Jul 2025 03:35:44 GMT</pubDate></item><item><title><![CDATA[Reply to PbHub 1.1 on STAMPLC - Couldn&#x27;t find Pbhub on PortA on Fri, 04 Jul 2025 17:12:39 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> said in <a href="/post/29403">PbHub 1.1 on STAMPLC - Couldn't find Pbhub on PortA</a>:</p>
<blockquote>
<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/306979">@bensonwhlee</a></p>
<p dir="auto">try adding a delay(500) before calling pbhub.begin(). My above linked code fails to initialize PbHub without a delay.</p>
<p dir="auto">Thanks<br />
Felix</p>
</blockquote>
<p dir="auto">“Thanks <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a>, that’s a helpful tip about the delay. I’ve seen similar I2C issues where peripherals don’t initialize properly without a short wait after boot. Good to know it applies to the PbHub too!”</p>
]]></description><link>https://community.m5stack.com/post/29405</link><guid isPermaLink="true">https://community.m5stack.com/post/29405</guid><dc:creator><![CDATA[Slarck]]></dc:creator><pubDate>Fri, 04 Jul 2025 17:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to PbHub 1.1 on STAMPLC - Couldn&#x27;t find Pbhub on PortA on Fri, 04 Jul 2025 12:19:38 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/306979">@bensonwhlee</a></p>
<p dir="auto">try adding a <code>delay(500)</code> before calling <code>pbhub.begin()</code>. My above linked code fails to initialize PbHub without a delay.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/29403</link><guid isPermaLink="true">https://community.m5stack.com/post/29403</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 04 Jul 2025 12:19:38 GMT</pubDate></item><item><title><![CDATA[Reply to PbHub 1.1 on STAMPLC - Couldn&#x27;t find Pbhub on PortA on Fri, 04 Jul 2025 10:17:51 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><br />
Thank you Felmue,<br />
By testing  the Wire interface and M5UnitPbHub seperately, I finally got response from the PbHub.   I'm not sure what cause the problem.   When I used your sample with the minimal code, the PbHub responsed and got analog data back after serval reset or unplug/replug the PortA cable.  But it is not consistency working after each program download.<br />
In my more complicated program with SD, PWR485 , M5StamPLC.Display , the PbHub did not work at all.   But if I just put in I2C scanning code together with my program, there is response from PbHub that address 0x61 was found.<br />
I think the problem is the command:<br />
pbhub.begin(&amp;Wire, UNIT_PBHUB_I2C_ADDR, 2, 1, 400000U)    and<br />
Serial.printf("0:%d  1: %d 2:%d  3:%d  4:%d  5:%d \n",pbhub.analogRead(0), pbhub.analogRead(1), pbhub.analogRead(2), pbhub.analogRead(3), pbhub.analogRead(4),pbhub.analogRead(5));</p>
]]></description><link>https://community.m5stack.com/post/29402</link><guid isPermaLink="true">https://community.m5stack.com/post/29402</guid><dc:creator><![CDATA[bensonwhlee]]></dc:creator><pubDate>Fri, 04 Jul 2025 10:17:51 GMT</pubDate></item><item><title><![CDATA[Reply to PbHub 1.1 on STAMPLC - Couldn&#x27;t find Pbhub on PortA on Thu, 03 Jul 2025 10:05:05 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/306979">@bensonwhlee</a></p>
<p dir="auto">I think you need to use the M5StamPLC library together with M5Unified and M5GFX libraries for it to work properly.</p>
<p dir="auto">Please find an example <a href="https://github.com/felmue/MyM5StackExamples/blob/main/M5StamPLC/PbHubOnPortA/PbHubOnPortA.ino" target="_blank" rel="noopener noreferrer nofollow ugc">here</a> which works for me.</p>
<p dir="auto">Edit: if you don't need M5StamPLC specific functions then it should be sufficient to add the following line to your setup code:</p>
<pre><code>Wire.begin(2, 1, 400000U);
</code></pre>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/29378</link><guid isPermaLink="true">https://community.m5stack.com/post/29378</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 03 Jul 2025 10:05:05 GMT</pubDate></item></channel></rss>