Hi there
Please note that I have been using Raspberry PIs for several years now, incl. connecting various sensors, screens, etc., and so far I have had no trouble with it.
But I am new in the Grove world, so please bear with me.
I have a Raspberry 3 Model B, and I just bought a Grove Base Hat and a couple of sensors and the LED Bar.
I cant’ get that thing set up properly. I tried several ways:
With a virgin install of Bookworm 32bit on my RPi, I have tried to install the software myself following these steps: Setting Up The Software - Dexter Industries The install does not complete, e.g. when I run grove-ledbar.py it throws an di_i2c ModuleNotFoundError. Apparently something is missing.
Also, I did enable the I2C and the SPI bus, but the Grove Base Hat does not show up which sudo i2cdetect -y 1
Can someone help me to overcome these hurdles. Any hint is greatly appreciated!
Welcome… I have to admit that i never tried to use Grove and Raspberry Pi together… I use Arduino IDE to program and never tried to program on Raspberry Pi so please continue to keep us up to date on your progress as I also would like to learn
in the basic … grove is a modular 4 wire connector where one wire is ground… black one wire is 3v3 red and you have a data 0 - white and data 1 yellow… or vice versa… i cant remember… the grove data pins are mltiplexed gibing you many more options for connecting… only the IIC pins share a common bus… otherwide each grove connector connects a different pair of pins… so you have toi connec the grove connector which addresses the the pins you want and you have to use the software to read the pins from the port… hope that helps!
I get the “layout” of the Grove Hat, but my initial problem is that I don’t even see it on the I2C bus. And the installation of the libraries (as described in the various “Get Started” guides) does not seem to work. Did anybody have success running the Grove Base Had to RPI and got the respective libraries installed. If so, what version of Raspbian did you use and which installation guide did you follow?
OK, I am one step further: I managed to get Dexter’s Raspian for Robots (Install the Image on The Raspberry Pi) running, and I now do see the HAT as 0x04 in “i2cdetect -y 1”. So far so good.
Now I want to run a test with the LED bar. The program itself (which I have copied from Grove - LED Bar | Seeed Studio Wiki) runs fine, but the LED bar does not light up. I have connected it to D5, but I also tried D16 (yes, I have changed the value in the program), but still nothing. (Note: I did NOT update the HAT firmware because I assume that it comes with the latest FW version. Is that assumption correct?)
For whatever reason that install does not find the bmm150 module, and since I don’t need the BMM150 compass module, I simply removed all references to it in the setup.py script.
So far so good. The next step is to recreate everything on Raspian BUSTER which - according to https://sethi.org/tutorials/tutorials-iot/setup-raspi-grove.html - seems to be the latest version of Raspbian that is compatible with the Dexter libraries. If that does not work I can always go back to the Raspian for Robots (which is based on STRETCH).
I was courageous and installed the latest Raspbian version (Trixie).
Then I created a python virtual environment and in it I installed grove.py via “pip3 install grove.py“. Apart from the fact that pip warned about an outdated installation method everything works. (I hope that the Dexter/Grove folks will update the grove.py install at some point! I am not an expert in that area, otherwise I would do it myself…) I found that one does not need to install Dexter’s GrovePi modules (that installation does not work on newer Raspian version at all), grove.py is all you need.
Currently I have the following widgets hooked up to the HAT:
LED Bar (hooked up to GPIO)
Water Level Sensor (GPIO)
Two Buttons module (hooked up to I2C).
grove.py encapsulates some of the functionality needed to run those sensors/widgets but some are missing. e.g. I wrote the code for the buttons myself and copied the code for the Water Level sensor
The one thing I have not tried is to use the ADC. There is one thing I don’t understand: the Raspian/Debian i2c has a valid range of 0x08 - 0x77. Why then did Grove select a chip that has its address (0x04) in the “reserved” range of 0x00-0x07? Older versions of Rasbian i2cdetect list the i2c range of 0x03-0x77, but the version on Trixie lists 0x08-0x77 (and complains if one tries to specify the range outside that). Perhaps someone can shine a light on that… and even tell me how you have solved that problem.
For now I don’t need the ADC, I’ll deal with it when the time comes.