GrovePi on Ubuntu

According to the Dexter GrovePi docs on GitHub, I can execute the line below in the Linux Terminal to add support for GrovePi to a Pi4 running a non-RaspianForRobots Linux distro:

curl -kL dexterindustries.com/update_gopigo | bash

However, it errors out when I run it on ym Pi4 running Ubuntu 20.04.

Is this not yet functional? If so, will it be eventually?

Thanks!

1 Like

What specific errors did you see?  That is important information that will help us help you track down the specific problem.

Heya!

Here’s the terminal text I got when I tried to execute the upgrade:

ubuntu@ubuntu:~$ curl -kL dexterindustries.com/update_gopigo | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   250  100   250    0     0   1059      0 --:--:-- --:--:-- --:--:--  1059
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 11096  100 11096    0     0  11357      0 --:--:-- --:--:-- --:--:-- 48243
id: ‘pi’: no such user
main: line 24: [: 1000: unary operator expected
Welcome to GoPiGo Installer.
Updating GoPiGo for master branch with the following options:
  --no-dependencies=false
  --no-update-aptget=false
  --bypass-rfrtools=false
  --bypass-python-rfrtools=false
  --bypass-gui-installation=false
  --user-local=false
  --env-local=false
  --system-wide=true
Using "master" branch
Options used for RFR_Tools script: "--system-wide master --use-python3-exe-too --update-aptget --install-deb-deps --install-python-package --install-gui"
main: line 162: /home/pi/.tmp_rfrtools.sh: No such file or directory
Installing RFR_Tools. This might take a while..
bash: /home/pi/.tmp_rfrtools.sh: No such file or directory
rm: cannot remove '/home/pi/.tmp_rfrtools.sh': No such file or directory
RFR_Tools failed installing with exit code 127. Exiting.
ubuntu@ubuntu:~$ 

1 Like

You say you’re trying to load software for GrovePi but you’re running the install script for GoPiGo.

Try:

curl -kL dexterindustries.com/update_grovepi | bash

I don’t see where it says this will work with “a non-RaspianForRobots Linux distro”.

more info here: https://github.com/DexterInd/GrovePi
and here: https://github.com/DexterInd/GrovePi/blob/master/Script/README.md

-Kevin

1 Like

My understanding is that if you have any recent version of plain-vanilla Raspbian, it will (should) work. If not, post here and at-mention cleoqc.

Thanks for the feedback, folks. And duh on me for missing that package name.

I’ll try it on a current Raspian build soon then.

1 Like

I too am having problems seeing the grovepi on my raspberrypi4 running ubuntu 20.04.

The i2c_bcm2708 kernel module is loaded, an i2c device exists at /dev/i2c-1 and i2cdetect correctly lists my i2c bus which is 1.

The command ‘sudo i2cdetect 1’ shows no devices connected, I was expecting to see the grovepi at address 0x04.

Note that the scripts in the GrovePi repo don’t work with the same errors as above i.e there is no ‘/home/pi’ directory, ‘pi’ user etc. as this is not raspbian. I could hack these maybe to overcome this but I’m not sure this will help at the mo.

Note using raspbian or any variant of it is not an option for me.

1 Like

Steve,

Short answer:
You may be hosed.

Longer answer:
Though you may be hosed, you might be able to work around it.

As far as I know, (based on my reading the posts made by those more skilled than I), these libraries we’re specifically designed for a Raspbian / Raspbian for Robots environment and there are important dependencies for Raspbian there.

I have also seen posts that talk about using C# and/or C++ libraries with the 'bots, that they exist, but I don’t remember where.  You can try snooping the Dexter GitHub repo or searching these fora for posts about alternative libraries.

I understand that there may be real reasons why Raspbian and/or Raspbian for Robots is not desirable.  You may, if possible, want to try a first iteration or two using Raspbian, just to verify that things work the way you expect - and then branch out into uncharted territory.

Go ahead and try, see what you can find, and let us know what happens!

P.S.
I am going to mention @Cleoqc and @cyclicalobsessive, they being my go-to wizards.  They might remember something I’ve forgotten.

1 Like

Hi jimrh,

Thanks for the reply, I’ll do as you suggest in that case, I’ll have a good look round the repo to see what I can find, also it won’t kill me to just put a raspbian image on an sd card and boot from that just to check the board out. I’ve no reason to believe its not working but it might give me some more pointers.

I’ll post back here with my findings.

1 Like

hello @steve.hamblett,

Is running Raspbian for setup permissible?

You need to make sure your grovepi runs firmware 1.4, and it can only be updated via Raspbian. Once it’s updated, you can use Ubuntu. This may be the cause of the device not showing up on the i2cbus. Please, make sure you do see it on Raspbian first. Then we can eliminate that potential issue.

The file you definitely need from the repo is this one:


but go ahead and clone the repo because there may be some drivers also, depending on which sensors/actuators you use in your project. Running setup.py shouldn’t be raspbian dependant although I’m not 100% certain.

1 Like

OK thanks, yes, I can use raspbian to set this up and then switch to ubuntu,. I’ll get the board working in its native env first as you suggest.

1 Like

Ok, getting somewhere, on a fresh raspbian install after executing the install script

curl -kL dexterindustries.com/update_grovepi | bash

and rebooting, if I run i2cdetect -l I get

i2c-1 i2c bcm2835 I2C adapter I2C adapter

so i2c is on bus 1, when I scan it I see no devices.

Running the script /home/pi/Dexter/GrovePi/Troubleshooting/complete_test.sh and selecting option 3, the i2c test, I get

Checking I2C bus 0

Error: Could not open file /dev/i2c-0' or /dev/i2c/0’: No such file or directory

so it seems to want i2c bus 0, whereas i2c bus 1 has been created.

I’m guessing this is not right. Note option 1 of this script, the software test seems to be OK, the only errror i get is

wiringPi Not Found (ERR)

OK, ubuntu was creating i2c bus 1, hence they are both doing the same.

1 Like

Bit more

the command python grovepi.py gives

library supports this fw versions: 1.4.0

the command bash firmware_update.sh gives

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

… and more …

OK, think were OK now, I added the line

dtparam=i2c_vc=on

to the boot/config.txt on Raspbian, this gave me i2c bus 0, so I now have 12c 0 and 1.

Scanning the buses now shows that the grovepi is on bus 1 as device 0x04, not bus 0 as I expected, but at least it was present. I plugged in some of my i2c grove devices, these were seen correctly again on bus 1.

Updated the firmware as per the instruction in the README, this seemed to work, verified it with the complete_test script in trobleshooting.

Over to Ubuntu, only one i2c bus, bus 1 but the grovepi and my devices were present as on raspbian.

OK, I access my devices through mraa’s i2c api, I need to look at this next.

1 Like

Steve,

On any later version of the Pi, (where “later version” means a version with a 40-pin GPIO), i2c buss zero is now dedicated to the HAT IDENT function and is no longer on pins 2 and 3 as before.

On the old, 26 pin devices, pins 2 and 3 were i2c buss 0, because that was all there was - there was no i2c buss 1 then as the hardware didn’t support it.

When the Raspberry Pi Foundation updated things to the 40-pin GPIO, i2c buss 0 was moved to (physical) pins 27 and 28 to handle the IDENT feature of the new HAT specification, and the newly added i2c buss 1 was wired to pins 2 and 3, replacing the i2c connection that used to be there.

So, anything that uses the older 26 pin standard for the GPIO, (and the older versions of Raspbian that ran on them), will have to have the i2c buss ID changed from zero to one when used on newer versions of the Pi and/or newer versions of Raspbian.

1 Like