BeagleBone i2c Interface - MrYsLab/xideco GitHub Wiki
To use i2c devices with the BeagleBone Black, you will need to run the interface as a Python 2 application. To install Python 2 on your computer, go to Python.org and download the latest version of Python 2.
The reason for this restriction is that the Adafruit library being used for i2c only supports Python 2.
You must run the interface with root privileges using sudo.
To start the BeagleBone i2c interface you must specify the router IP address and optionally specify the publisher and subscriber ports. Here is the help menu from the command line.
sudo python2 xibbi2c.py -h
usage: xibbi2c.py [-h] [-b BOARD_NUMBER] [-p PUBLISHER_SOCKET]
[-s SUBSCRIBER_SOCKET] [-r ROUTER_IP_ADDRESS]
optional arguments:
-h, --help show this help message and exit
-b BOARD_NUMBER Board Number - 1 through 10
-p PUBLISHER_SOCKET Publisher Socket Number
-s SUBSCRIBER_SOCKET Publisher Socket Number
-r ROUTER_IP_ADDRESS Router IP Address
Typically you do not need to specify the publisher or subscriber sockets, but you must specify the router IP address. A typical session start using 192.168.1.123 as the address would be:
$ sudo python2 xibbi2c.py -r 192.168.1.123
You would then see the following output to the console:
$ sudo python2 xibbi2c.py -r 192.168.1.123
*****************************************
BeagleBone Black i2c Interface - xibbi2c
Using router IP address: 192.168.1.123
Publisher Socket: 43124
Subscriber Socket: 43125
*****************************************