I can’t use buttons nor encoders on my GroovePI, I suspect it comes from the firmware.
My GroovePI firmware version is 1.2.2, and I want to upgrade to 1.4.0
When I run the script sudo bash firmware_update.sh from /home/pi/Dexter/GrovePi/Firmware, I get the an error saying: gpio/direction: No such file or directory
Full script output below:
pi@raspberrypi:~/Dexter/GrovePi/Firmware $ sudo bash firmware_update.sh
Updating the GrovePi firmware
=============================
http://www.dexterindustries.com/grovepi
Run this program:
sudo ./firmware_update.sh
=============================
Do you want to update the firmware? [y,n]y
Make sure that GrovePi is connected to Raspberry Pi
Firmware found
Press any key to start firmware update
. . .
gpio/direction: No such file or directory
avrdude done. Thank you.
gpio/direction: No such file or directory
avrdude done. Thank you.
gpio/direction: No such file or directory
avrdude done. Thank you.
gpio/direction: No such file or directory
avrdude done. Thank you.
pi@raspberrypi:~/Dexter/GrovePi/Firmware $
I started from a fresh install using the recommanded RaspOS version, eg 2023-05-03-raspios-buster-armhf
I enabled SPI and I2C with raspi-config.
A Raspberry Pi-3 or earlier. : (A Pi-3/3+ is recommended though a Pi-2 will also work.)
Note that you cannot use a Pi-4 to update firmware![1] [2]
The Grove board attached to the Raspberry Pi device.
You will then go into the control panel applet on the desktop and select “update firmware”. (P.S. I am doing this from memory, I haven’t flashed firmware on ANYTHING in years!)
The really-and-truly authorized software for the GrovePi/GrovePi+ is Raspbian for Robots. You can try working with other self-installed versions, but they may or may not work depending on the positions of individual planets, stars, constellations, etc. In other words: Your Mileage May Vary.
If you want to try using Raspbian for Robots (and a GrovePi/GrovePi+), with a Pi-4, there is an “experimental” version of Raspbian for Robots based on Buster that should work on the Pi-4. https://www.dexterindustries.com/download/r4r_buster
Note that you still should not attempt to re-flash the firmware using a Pi-4 because it can “brick” your GrovePi board. Even if it seems to allow it, DON’T!
(There’s some interesting history about these releases if you or anyone else is interested.)
Thanks, I’ll try with this distribution and I’ll keep you posted.
For reference, I tried with a Rasp 1 model B and a Rasp 3 model B, with a Groove Pi+, and with the distribution I mentioned in my first post.
I am assuming it’s a “home-brew” (curl’d) install and sometimes they have problems. If your firmware is really as old as you say, once you get it updated it might work with the version you originally tried.
It will be interesting to see what happens when you get the correct version of the firmware installed.
Hi @jimrh
I’ve been able to update the firmware, thank you SO much!!
From the Raspbian for Robots distrib, I was able to upgrade from version 1.2.2 to 1.3.0
Then I upgraded to the latest 1.4.0 firmware.
I made some quick tests. The grove button which did not work with 1.2.2 works great, but not the encoder. The script starts, but it does not detect any change (I checked the port).
Personally, I know nothing about the GrovePi+, or the encoder.
What I do see is that something is listed as 0x04 AND there is a forum note about post epidemic some Grove products being shipped needing address 0x08 and suggesting the need to change the address.
You might make a local copy of grovepi.py to the same folder as your test script, change the address in line 60 to 0x08, and see if the sensor is now visible to the GrovePi.
grovepi.py is in the same repo folder you linked and possibly on your RaspberryPi under /home/pi/Dexter/GrovePi/Software/Python/ - Like I said, I don’t know anything about the GrovePi.
To get it from the repo to your local test folder:
With the changed local copy in the same folder you execute from, will import from the local copy of grovepi.py rather than the copy in the python site packages.