I’m attempting to connect a pH2 click and a water detect 3 click through a pi 4 click shield. Has anyone attempted anything similar? I had a ANAVI gardening uhat that i tried to get working but never could. It worked fine on my raspberry pi 4. Is there anything special about the 40 pin connector? AI is telling me to recompile the kernel and update the device tree.
I got it working! I have the pH sensor reporting information over the pi-4 click adapter and the water sensor working through gpio reading. I haven’t used linux a lot in the past but I have gotten further with this setup than I ever have with my Nordic/Zephyr based dev kits. If anyone is interested, you can check gpio by using gpioinfo gpiochipx where x is 0 for access to the 40pin. We have chip0-5 on our board and I don’t know what they are all used for so hopefully someone can chime in about what they are used for. Then to read the gpio value (i’m reading a water sensor), I use gpioget gpiochip0 6 (6 being the gpio i need). For my pH sensor, I am using i2c. I use i2cdetect -l to see all the busses. Again, I don’t know what all the other ones are for, I just know to use 1 through trial and error. Then I scan bus 1 using i2cdetect -y -r 1 to scan for i2c devices on bus 1. My water sensor is on 0x4d but I got confused because there is a i2c device on the pi-4 click adapter as well at 0x48. Once I figured that out I read the pH click by using i2cget -y 1 0x4d. Piece of cake! Well, if that cake took 4 hours to make….
You might want to look at using circuitpython libraries (traditionally for microcontrollers), which use Adafruit_Blinka as an integration layer for single board computers running regular python.
There are a wealth of circuitpython drivers and they can all be pip installed like adafruit_circuitpython_vl53l1x for example.
You might want to have a glance at our PR for Tachyon support in Adafruit's Blinka repo:
You'll see all of the GPIO's defined for use with libgpio (Tachyon currently has v1.4.1 which is very different than v2.x libraries. Note: Tachyon cannot support v2.x libgpio until ubuntu 24.04 is available)
The pinout for Tachyon will be very useful to look at in comparison to whatever schematic you have for various development HATs you're trying to port over: