klaas2
Posts: 3
Joined: Sun Dec 01, 2013 3:12 pm

i2cdetect causes "segmentation fault" or no output at all

Sun Dec 01, 2013 3:29 pm

Hi,

I have a Raspberry Pi A model (256 mb) with a ADS1115 a/d converter connected to it, but Raspbian OS can't seem to find it.

When I type in the terminal window

Code: Select all

sudo i2cdetect -y 0
or

Code: Select all

sudo i2cdetect -y 1
there is no output at all, and without 'sudo' it says "segmentation fault".

- The a/d converter is connected as described on the adafruit website
- I installed the i2c-tools and python-smbus packages
- I commented the "blacklist i2c-bcm2708" line in raspi-blacklist.conf
- I added "i2c-dev" to /etc/modules

What am I doing wrong? I'm quite new to Linux and Raspberry Pi.

Thanks for any help.


User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13142
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: i2cdetect causes "segmentation fault" or no output at al

Mon Dec 02, 2013 11:22 pm

you do not mention at what voltage you run the AD converter, but note that when you use 5V it doesn't work with a PI as according to the chips data-sheet Vih min is 0,7 x 5V = 3.5V which isn't met by the PI's Vih of 3.3V, using the PI's pullups. Either run the chip at 3.3V, or use an I2C level converter.

The driver should never "segfault", no matter how you connect up the hardware, so I suspect data corruption of the driver.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: i2cdetect causes "segmentation fault" or no output at al

Tue Dec 03, 2013 12:43 am

klaas2 wrote: When I type in the terminal window

Code: Select all

sudo i2cdetect -y 0
or

Code: Select all

sudo i2cdetect -y 1
there is no output at all, and without 'sudo' it says "segmentation fault".
At a guess you've not updated /etc/modules to include the i2c device drivers in your Linux kernel.

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
i2c-dev
Add that "i2c-dev" line or if it's there remove the # char (don't remove any other lines), save the file and reboot.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

klaas2
Posts: 3
Joined: Sun Dec 01, 2013 3:12 pm

Re: i2cdetect causes "segmentation fault" or no output at al

Tue Dec 03, 2013 10:20 pm

Thanks for all answers :)
DougieLawson wrote:Add that "i2c-dev" line or if it's there remove the # char
I already did that, but without the desired result.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: i2cdetect causes "segmentation fault" or no output at al

Tue Dec 03, 2013 10:23 pm

klaas2 wrote:Thanks for all answers :)
DougieLawson wrote:Add that "i2c-dev" line or if it's there remove the # char
I already did that, but without the desired result.
What kernel are you running?
Is the device driver loaded?

sudo vcgencmd version
uname -a
lsmod
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

powerfullback
Posts: 2
Joined: Thu Dec 05, 2013 2:20 am

Re: i2cdetect causes "segmentation fault" or no output at al

Thu Dec 05, 2013 2:25 am

I have the exact same problem. Everything is set up according to the tutorials and I see the module when I run lsmod. When I check the return code (echo $?), it's 139.

Not sure what's up. I'm guessing it's a library problem. I haven't had a chance to attach mine to a network and I'm hoping a software update will help. I'll post here when I figure it out.

powerfullback
Posts: 2
Joined: Thu Dec 05, 2013 2:20 am

Re: i2cdetect causes "segmentation fault" or no output at al

Fri Dec 06, 2013 5:55 am

I fixed my problem by connecting to the network and installing the newest versions of i2c-tools and python-smbus. Everything works fine now.

I suggest connecting to a network and do a

Code: Select all

sudo apt-get update && sudo apt-get dist-upgrade
to make sure you have all the latest packages.

-power

Return to “Troubleshooting”