hi @felmue
Yes, thank you! Manual adding of the Init pahub_0 block has solved this.
Posts made by UP_BIM
-
RE: Nesting of multiple PAhubs
-
RE: Nesting of multiple PAhubs
Hi @felmue
Thank you for your advice. With a Core 2, I get a "PAHUBUnit isn't defined" error with this line of code:env4_0 = ENVUnit(i2c=PAHUBUnit(i2c=i2c0, channel=0 , address=0x71), type=4)
UIFlow2 also creates the same micropython line (just without the 0x71 address allocation), with the same error. In UiFlow 1 this is not a problem.
I have not yet been able to attempt this with other M5 cores. In your solution, which M5 core did you use?
I am wondering if there is not a different call for Core 2's
-
RE: Nesting of multiple PAhubs
Thanks @felmue (Felix)
I think that will do the trick. Much appreciated! -
RE: Nesting of multiple PAhubs
Hello @felmue (Felix)
Measurements from several device types (ENV IV x 7 , CO2 x 2, Dlight x 4 , Voltmeter x3 etc ) are required. The ENV sensors on their own will need more than one PaHUB: so either a parallel, or nested approach is needed.
Either way (parallel or nested), I am unable to correctly add the sensors in UiFlow or in python. By default sensors are assigned to a PaHUB with address (0x70) via this python command (example an ENV 4 unit is added):
env4_0 = unit.get(unit.ENV4, unit.PAHUB0) ----------- [1]
"unit.PAHUB0" refers to channel 0 of the hub connected to port A that has an address of (0x70).
To add other PaHubs is easy (in this case the hub's address was altered via hardwiring to 0x71):
pahub_0 = unit.get(unit.PAHUB, unit.PORTA, 0x71) ----------- [2]
But it is unclear how to add sensors to such a hub. I am looking for the correct python syntax in line [1] to refer to a PaHUB that has an address other than (0x70).
-
RE: Nesting of multiple PAhubs
Thank you Felix
Here is an example that mentions expansion to 36 I2C ports using 7 PAhubs:
https://www.bastelgarage.ch/m5stack-pa-hub-2-i2c-expansion-unit-1-to-6
"...For example, you can wire PaHUBs with the Root-PaHUB to get more places for your I2C slave devices. If you have seven of them, you can extend up to 36 I2C GROVE ports."
So, I gather this is a nesting using two levels: 1 "Root PaHUB" (6x channels) and 6 secondary hubs (each with 6 channels).
I anybody had success with this inside Uiflow or some other method, any advice will be appreciated.
(I have the need to log data from about 15 sensors, some that are of the same type)
-
Nesting of multiple PAhubs
Re: 2x PaHUB mit UIFlow
I think this is related to a very old post, but there was no reply to it, so I opened a new topic:I wish to nest PAhubs (PAhub2) to expand the number of i2c sensor unit inputs beyond 6, by plugging in secondary PAhub(s) onto a primary PAhub. From what I gather, the hardware is able to do this and several websites selling the hubs specifically mentions the example of connecting 6 PaHubs to a primary hub to support 36 sensor units. It is also biefly mentioned in one of the official m5stack tutorial videos.
But in UiFlow, how do I access the sensor units that are connected to the secondary PAhub(s)? It is easy to get addess assignment for the sensor units on the primary PAhub, but not for the secondary hubs. Any suggestions?