If any of you have installed the new “Stretch” version of Raspbian on the Raspberry Pi, you may have noticed a slight issue with the wiringPi GPIO utility.
will complain of a missing i2cdetect even though it is actually there
Well, here’s a fix:
The problem: When searching for i2c devices, you might use “gpio i2cd” which merely calls i2cdetect with the right parameters for the Raspberry Pi. Well, except it doesn’t. Apparently that has been the case since December 2016 – I was the first to report it and this will be fixed soon. In the meantime, if you have this problem, here’s the fix – and thanks due to Gordon Henderson (I did this as PI user in the PI directory):
Firstly – remove wiringPi
sudo apt-get purge wiringPi
Grab the source
git clone git://git.drogon.net/wiringPi
and assuming all is ok, fix the bug:
Around line 59 you should see this:
#define I2CDETECT "/usr/sbin/i2cdetect"
change it to:
#define I2CDETECT "/i2cdetect"
Recompile and install
sudo make install