rricharz
Posts: 79
Joined: Tue Apr 19, 2016 8:46 am
Location: Switzerland
Contact: Website

gpio i2cdetect

Sun Mar 19, 2017 2:08 pm

"gpio i2cdetect"gives the following error message on my Raspbian after the latest upgrades:

Code: Select all

$ gpio i2cdetect
gpio: Unable to find i2cdetect command: No such file or directory
i2cdetect is still available:

Code: Select all

whereis i2cdetect
i2cdetect: /usr/sbin/i2cdetect /usr/share/man/man8/i2cdetect.8.gz
"ì2cdetect -y 1" works as expected.

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

Re: gpio i2cdetect

Sun Mar 19, 2017 2:32 pm

Where did you get the idea that gpio can call i2cdetect? That's never going to work it's not in the man page for gpio.

Just run man gpio;i2cdetect -y 1 from a command line
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

rricharz
Posts: 79
Joined: Tue Apr 19, 2016 8:46 am
Location: Switzerland
Contact: Website

Re: gpio i2cdetect

Sun Mar 19, 2017 2:42 pm


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

Re: gpio i2cdetect

Sun Mar 19, 2017 3:29 pm

OK, it looks like you've found a bug in Gordon's code.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

rricharz
Posts: 79
Joined: Tue Apr 19, 2016 8:46 am
Location: Switzerland
Contact: Website

Re: gpio i2cdetect

Tue Mar 21, 2017 6:51 am

Yes,

Cloning wiringPi as follows

Code: Select all

git clone git://git.drogon.net/wiringPi
and then changing line 59 of gpio/gpio.c to

Code: Select all

#define I2CDETECT "i2cdetect"
fixes the bug. Gordon has confirmed that the fix will be in the next release.

Return to “Interfacing (DSI, CSI, I2C, etc.)”