Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.

Error running i2c example code on BeagleBone Black #4

Closed
pavo opened this issue Dec 20, 2014 · 1 comment
Closed

Error running i2c example code on BeagleBone Black #4

pavo opened this issue Dec 20, 2014 · 1 comment

Comments

@pavo
Copy link

pavo commented Dec 20, 2014

Please see the trace below:

/usr/local/lib/python2.7/dist-packages/setuptools-3.5.1-py2.7.egg/pkg_resources.py:1031: UserWarning: /home/ubuntu/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
Traceback (most recent call last):
File "image.py", line 47, in
disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST)
File "build/bdist.linux-armv7l/egg/Adafruit_SSD1306/SSD1306.py", line 239, in init
File "build/bdist.linux-armv7l/egg/Adafruit_SSD1306/SSD1306.py", line 105, in init
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 64, in get_i2c_device
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 75, in init
IOError: [Errno 2] No such file or directory

The above is having modified image.py appropriately for my display:

128x64 display with hardware I2C:

disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST)

Beaglebone Black pin configuration:

RST = 'P9_12'

Note the following are only used with SPI:

DC = 'P9_15'
SPI_PORT = 1
SPI_DEVICE = 0

I hope this can help someone.

@tdicola
Copy link
Contributor

tdicola commented Dec 24, 2014

It sounds like the SPI device you're using might not be enabled with a device tree overlay. Can you try running this command to show all the SPI devices?

ls /dev/spi*

Based on the device and port you should see a /dev/spidev1.0 device. If you don't see that device then you'll need to enable it with a device overlay. Check out the bottom of this page for a little more info on how to enable the SPI device: https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black/wiring

One other thing to be careful about, since it looks like you're using Ubuntu. Make sure the kernel version is 3.8.x and not a later one like 3.14.x. The later kernels don't support device tree overlays so they can't dynamically add SPI ports, etc. You can check the kernel version by runnning:

uname -r

If it's a later kernel (like 3.14) try installing the official Debian image from there as it's still using 3.8: http://beagleboard.org/latest-images

@tdicola tdicola closed this as completed Dec 24, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants