No i2c bus recognized
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

No i2c bus recognized

by pauln34 on Fri Jan 25, 2013 8:15 pm

I just got my Raspberry and am using Occidentalis 0.2 When I run the check of my i2c bus nothing shows up--that is I get all zeros in the grid. Furthmore when I run the servo test program it keeps telling me no i2c bus address found.

Any idea what might be done to fix this?

Thanks
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by pauln34 on Fri Jan 25, 2013 8:41 pm

Let me give a little more background on my issue. I am using the Cobbler board and ribbon cable. The GPIO pins work just fine--I've been able to get 7 leds lighting up. The problem is the i2c bus. I'm getting nothing.

thanks for any help
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by ennbr on Fri Jan 25, 2013 10:33 pm

Specifically what i2c device have you connected to the bus?
ennbr
 
Posts: 26
Joined: Sun Feb 12, 2012 12:17 pm

Re: No i2c bus recognized

by pauln34 on Fri Jan 25, 2013 10:40 pm

I have a servo motor connected via the cobbler port. I get no sign of an i2c bus when it is either connected or not connected.

Thanks
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by ennbr on Fri Jan 25, 2013 11:02 pm

The servo by itself is not an i2c device. However if connected to the adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface it will then show up in the list.

https://www.adafruit.com/products/815
ennbr
 
Posts: 26
Joined: Sun Feb 12, 2012 12:17 pm

Re: No i2c bus recognized

by pauln34 on Sat Jan 26, 2013 8:55 am

I am confused, then. I am following both the tutorial for driving a servo (Raspberry tutorial #8), as well as a guide for installing the i2c kernel. Both imply you should see the i2c interface when running i2cdetect whether or not anything else is connected to the raspberry. Tutorial #8 also does not require the PWM/Servo driver chip.

Am I misunderstanding something?
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by pauln34 on Sat Jan 26, 2013 10:10 am

A little more information: IN the tutorial on using the PWM/Servo module it states that: "All the files can be found in the directory /sys/class/rpi-pwm/pwm0/ on your Raspberry Pi." This is from the Occidentalis distro. On my installation of Occidentalis, this directory does not exist. Is the tutorial out of date, or is there something wrong with my installation?
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by adafruit_support_rick on Sat Jan 26, 2013 10:45 am

pauln34 wrote:I am confused, then. I am following both the tutorial for driving a servo (Raspberry tutorial #8), as well as a guide for installing the i2c kernel. Both imply you should see the i2c interface when running i2cdetect whether or not anything else is connected to the raspberry. Tutorial #8 also does not require the PWM/Servo driver chip.

Am I misunderstanding something?


First of all, ennbr is correct. Tutorial #8 doers not use I2C to drive the servo -instead, a PWM output of the Pi is used. The tutorial refers to the Adafruit 16-Channel Servo/PWM Breakout Board tutorial for driving more than one servo. That board is an I2C device.

So, the servo alone won't show up on the I2c bus, and you should not be trying to use any I2C code to drive it. Instead, use the code found on the 'Software' page of Tutorial #8

Have you looked at Adafruit's tutorial for configuring I2C on the Pi? You may be looking for the wrong I2C bus. The 512MB Model B uses I2C bus 1. The command for inspecting that is
Code: Select all | TOGGLE FULL SIZE
sudo i2cdetect -y 1
However, the 256MB Model B uses I2C bus 0, and so the command for inspecting that is
Code: Select all | TOGGLE FULL SIZE
sudo i2cdetect -y 0

adafruit_support_rick
 
Posts: 12913
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: No i2c bus recognized

by pauln34 on Sat Jan 26, 2013 11:10 am

Thanks. I was using the software from tutorial 8, and following all of the wiring diagrams.

When I run the program, what I get is lots of lines of:

Error writing to: servo value: 63
Error writing to: delayed value: 0
Error writing to: mode value: servo
Error writing to: servo_max value: 180
Error writing to: active value: 1

I notice the program has the following call:

open("/sys/class/rpi-pwm/pwm0/" + property, 'w')

But my system does not seem to have the rip-pwm class in its class directory. is there something wrong with the code? Is the rpi-pwm class some other place?
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by adafruit_support_rick on Sat Jan 26, 2013 3:28 pm

Hi - I just did a clean install of occidentalis 0.2, and "/sys/class/rpi-pwm/pwm0/" is there. It's the only thing in the rpi-pwm directory. Do you see the "/sys/class/rpi-pwm" directory?

The file "/sys/class/rpi-pwm/pwm0" itself is a softlink to "/sys/devices/platform/rpi-pwm/pwm0". Do you see that path on your pi?

adafruit_support_rick
 
Posts: 12913
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: No i2c bus recognized

by pauln34 on Sat Jan 26, 2013 9:51 pm

Strangely enough, it is not there. I just downloaded Occidentalis a few days ago. What might I have done to not have those directories in my system?

Thanks
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by adafruit on Sat Jan 26, 2013 10:03 pm

did you do an apt-get upgrade or apt-get update? because that would overwrite the kernel
User avatar
adafruit
 
Posts: 11712
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: No i2c bus recognized

by pauln34 on Sun Jan 27, 2013 8:35 am

I did do apt-get update and upgrade, as recommended. Would this delete the rpi-pwm folder? Why would it do that?

Any thoughts on how to reinstall (or where to find the code to reinstall), the rpi-pwm stuff?

Thanks
pauln34
 
Posts: 9
Joined: Fri Jan 25, 2013 8:13 pm

Re: No i2c bus recognized

by adafruit_support_rick on Sun Jan 27, 2013 8:15 pm

Actually, the tutorial only recommends "update", not "upgrade". Update will only get new versions of installed software, but "upgrade" will overwrite the kernel with a new version of linux. I'm guessing here, but you probably wound up overwriting occidentalis with raspbian.

Occidentalis is Adafruits version of Raspbian configured for hardware support. I believe the PWM support is an occidentalis thing, and not part of raspbian.

I'm afraid you're going to have to start over and re-install occidentalis.

adafruit_support_rick
 
Posts: 12913
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: No i2c bus recognized

by Walleee on Sun Jan 27, 2013 9:02 pm

I'm afraid you're going to have to start over and re-install occidentalis.


That seems to lead to some inconsistencies - when my RPi starter kit came in a couple weeks ago I installed Occidentalis v0.2 on the card. I noticed the RPi was only recognizing 256 MB of RAM instead of 512, so I emailed support asking if there was a problem with it. Phil responded with a couple of links to the RPi forums on the memory issue, and those links indicated the solution was to Update/Upgrade. I did that, and all 512 MB were recognized. I have not tried using I2C or PWM yet so I don't know what would happen there.

At least in my case, reinstalling Occidentalis v0.2 would cause the RPi to no longer recognize half of the installed RAM.

The links Phil sent me:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=20255
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=24411

Wally
Walleee
 
Posts: 1
Joined: Mon Jun 20, 2011 2:59 am