I2cdetect not found with GrovePi + and Pi 2

The ic2detect command is not found after I set up the software. When I updated the firmware it asked me to connect the jumpers but since it is the + version there are none. I hit a key to continue and it shows everything OK when finished with the update.

Hey Pamd60,

So you tried to update the GrovePi+ firmware.

Do you get a response when you run
sudo i2cdetect -y 1

If so, can you paste it here?

pi@raspberrypi ~ cd GrovePi/Script pi@raspberrypi ~/GrovePi/Script sudo i2cdetect -y 1
sudo: i2cdetect: command not found
pi@raspberrypi ~/GrovePi/Script $

What operating system are you using? Can you tell us a little more about where you got it and how you made it? Was it the Dexter Industries version of Raspbian?

I bought the Raspberry Pi as part of a kit sold by MCM. The micro SD with the operating system came with it.

Hey,
Can you add a link of the site where you brought the kit from. You need a modified image to run that command. We’ll have a look if has our modified image of Raspbian. You can also download and burn that image from here: http://www.dexterindustries.com/howto/raspberry-pi-tutorials/install-raspbian-for-robots-image-on-an-sd-card/ or buy a SD card from here: http://www.dexterindustries.com/site/?product=sd-card-raspbian-wheezy-image-for-raspberry-pi .

-Karan

PAMD, it appears that the image they’re shipping doesn’t include i2c utilities. Karan definitely had the easiest way; downloading our latest image here and then installing it on an SD card. However, you can make the changes yourself; it should be easy enough to add. In the terminal, you can run the following two commands:

sudo apt-get install python-smbus
sudo apt-get install i2c-tools

You’ll also need to run i2c setup:
sudo raspi-config

Select "Advanced Options"
Then A7 Option.
And then confirm that you want to add I2C.

After you make this installation, you should be able to run the i2cdetect command with no problems.

I was able to install the Dexter Raspian and got the GrovePi to be detected in 04 on the grid. Ran LED_BLINK from the terminal and it worked but when I ran it from Python 3 it gave me a syntax error. I then ran the DI Software Update. The card is now detected in 08 and I get a repeating IOERROR when run the blink program from the terminal. Making progress but still not there. Thanks for the speedy responses

Hey,
We have never tried using the GrovePi library with Python and this is the first time someone has complained that there are problems with the Python3. Can you post the full error so that we can have a look. If it is easy enough to make it work, then we’ll do it but if it requires too much of work to make it Python3 compatible, then we might not do it.

-Karan

PamD60, is it possible to use Python 2.7? I’m confused, before Python27 was the default on Raspbian. How are you using Python 3?

I think I’m missing something here.I don’t have a preference for any Python version but the Dexter desktop has icons for IDLE which is Python 2.7.3 and IDLE 3 which is Python 3.2.3. I will use 2.7.3 but it still gives me an error when I run the program using RUN MODULE See below

Python 2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3] on linux2
Type “copyright”, “credits” or “license()” for more information.
>>> ================================ RESTART ================================
>>>

Traceback (most recent call last):
File “/home/pi/Desktop/GrovePi/Software/Python/grove_led_blink.py”, line 5, in <module>
from grovepi import *
File “/home/pi/Desktop/GrovePi/Software/Python/grovepi.py”, line 22, in <module>
bus = smbus.SMBus(1)
IOError: [Errno 13] Permission denied
>>>

Hey,
The permission denied error is because you need to run the program ad root to access the I2C libraries which are used for communicating with the GrovePi. Looks like you are using Idle, so you should just start the prompt like this: sudo python.

Let us know if this helps.

-Karan

Hey Pamd, just to clarify what Karan is talking about: rather than click on Python on the desktop, the examples are run from the command line. So your best bet is to open the command line in the desktop and navigate to the directory where the example is (cd ~/Desktop/GrovePi/)

Once there, you can run any of the examples with:

sudo python example_file_name.py

As I said previously when I do that I get a repeating IOERROR when the LED is plugged into D4. The program ran correctly before I ran the DI Software Update from the desktop. Should I start over and load the Dexter Raspian on the SD and not run the update or should I use another port for the LED. Like I said the detect command showed 04 in the grid before the update and 08 after

I was able to get the LED BLINK to work after I re wrote the SD card and ran the firmware update. I’ve tried a number of digital sensors and they all work, button,switch,PIR motion LED but none of the analog will. I tried the temperature, rotary angle and sound sensor on A0 and A1 and they just give a repeating ERROR. I did not run the DI Software Update because that seemed to mess things up the last time.
Thanks

Hey,
Are you sure that you are running the firmware update for the GrovePi and not the GoPiGo. The GoPiGo shows up on the address 0x08 and would indded show errors if you try using that with the GrovePi.

Can you check this again and post the output of the firmware update process once.

-karan

Yes I did do the grovePi firmware update but it asked me to connect the jumpers which I couldn.t and it did not ask about using ic2 like the instructions said. One thing I noticed when the RP2 boots I see this
FATAL ERROR : MODULE SPI-DEV NOT FOUND

Here is the firmware_version.py output

GrovePi has firmware version: IOError
Traceback (most recent call last):
File “firmware_version.py”, line 4, in <module>
print “GrovePi has firmware version:”, grovepi.version()
File “/home/pi/Desktop/GrovePi/Software/Python/grovepi.py”, line 205, in version
return “%s.%s.%s” % (number[1], number[2], number[3])
TypeError: ‘int’ object has no attribute 'getitem
root@raspberrypi:/home/pi/Desktop/GrovePi/Software/Python#

Hey,
The SPI dev error is normal and not something big to worry about. You should go ahead and try the firmware upgrade script without the I2C check and it should work for you.

DO let us know how it goes.

-Karan

I do not get a prompt like it shows in the firmware instructions about the I2C check. It goes right to the jumper prompt. See output below. I still get ERROR when I run the Analog_read program

root@raspberrypi:/home/pi# cd Desktop/GrovePi/Firmware
root@raspberrypi:/home/pi/Desktop/GrovePi/Firmware# sudo chmod +x firmware_update.sh
root@raspberrypi:/home/pi/Desktop/GrovePi/Firmware# sudo ./firmware_update.sh
Updating the GrovePi firmware

Do you want to update the firmware? [y,n]y
Make sure that GrovePi is connected to Raspberry Pi
Firmware found
Connect the jumper to the Reset pin and Press any key to start firmware update
. . .g
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "grove_pi_firmware.hex"
avrdude: input file grove_pi_firmware.hex auto detected as Intel Hex
avrdude: writing flash (14480 bytes):

Writing | ################################################## | 100% 7.51s

avrdude: 14480 bytes of flash written
avrdude: verifying flash memory against grove_pi_firmware.hex:
avrdude: load data flash data from input file grove_pi_firmware.hex:
avrdude: input file grove_pi_firmware.hex auto detected as Intel Hex
avrdude: input file grove_pi_firmware.hex contains 14480 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.91s

avrdude: verifying …
avrdude: 14480 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

root@raspberrypi:/home/pi/Desktop/GrovePi/Firmware#

I am also having a little trouble with my Grove hooking up to the sensors. Following the conversation above, when running the i2cdetect -y 1 before and after the firmware update, the 04 nor any other number shows up on the grid. The first grove had the same problem but would not allow for the firmware update technique (jumper). So I ordered and just received the second Grove today. It did allow the jumper firmware update, but still no 04 when checking the i2cdetect (see attachment)…

Thanks in advance…