As noted above the latest Raspbian Jessie and Stretch releases have an updated I2C driver that isn't compatible with how this library enables repeated I2C start bits. From the thread about this issue there's a workaround to enable the older I2C driver. Edit the /boot/config.txt on your SD card and add:
dtoverlay=i2c-bcm2708
Then restart your Pi and you should be able to use the library below. If this still fails you might need to fall back to an earlier version of Raspbian which comes with the older driver, see the historical Raspbian images here and pick one from 2016 like 2016-11-29.
Dependencies
Before you install the software you'll first need to install a few dependencies. Make sure your Raspberry Pi or BeagleBone Black is connected to the internet with a wired or wireless connection. Then connect to a terminal on the device using SSH and execute the commands:
sudo apt-get update sudo apt-get install build-essential python-dev python-smbus python-pip git
When prompted to install the dependencies answer yes, and after a few moments the necessary libraries and software should be installed. You can also ignore any messages about dependencies which are already installed.
Installation
Follow the steps below to install the software for the Python MPR121 library. At a terminal execute the following commands to download the library into a subdirectory of your user's home directory.
cd ~ git clone https://github.com/adafruit/Adafruit_Python_MPR121.git
Next execute the following commands to install the library:
cd Adafruit_Python_MPR121 sudo python setup.py install
The setup script will download a few dependencies and install the library. If there are errors, carefully check all the dependencies above were installed and try again.
That's it, the MPR121 library is now installed! Continue on to learn how to run an example program and learn how to use the library.
Page last edited March 08, 2024
Text editor powered by tinymce.