oliverstrother
Posts: 10
Joined: Wed Dec 20, 2017 11:16 pm

OLED error.

Sat Jan 12, 2019 7:37 pm

Hi there,
I've followed a tutorial on how to use a SSD1306 OLED with a raspberry PI.

https://learn.adafruit.com/ssd1306-oled ... lack/usage

When I try to run one of the examples, I get the following error. I think it's something simple, but I don't know how to interpret the error. Any help much appreciated.

thanks!
Ollie.

Traceback (most recent call last):
File "shapes.py", line 70, in <module>
disp.begin()
File "build/bdist.linux-armv6l/egg/Adafruit_SSD1306/SSD1306.py", line 148, in begin
File "build/bdist.linux-armv6l/egg/Adafruit_SSD1306/SSD1306.py", line 292, in _initialize
File "build/bdist.linux-armv6l/egg/Adafruit_SSD1306/SSD1306.py", line 129, in command
File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 116, in write8
File "build/bdist.linux-armv6l/egg/Adafruit_PureIO/smbus.py", line 256, in write_byte_data
IOError: [Errno 121] Remote I/O error

MarkDH102
Posts: 329
Joined: Fri Feb 13, 2015 3:18 pm

Re: OLED error.

Sat Jan 12, 2019 9:22 pm

I think you need to go to the preferences > raspberry pi configuration menu and enable the i2c interface.

User avatar
neilgl
Posts: 622
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: OLED error.

Sat Jan 12, 2019 9:24 pm

Ah that tutorial looks to be from 2014?
On my pizero I am currently using luma, login as pi then:

Code: Select all

sudo apt-get install python-dev python-pip libfreetype6-dev libjpeg-dev build-essential
sudo -H pip install --upgrade luma.oled
Then you can try their examples...

oliverstrother
Posts: 10
Joined: Wed Dec 20, 2017 11:16 pm

Re: OLED error.

Sat Jan 12, 2019 10:32 pm

thanks for the suggestions,
I checked that i2c interface is enabled. I've got it set up for an SPI interface and get the following error.

Working on the luma, but I'm getting the following error.,

pi@raspberrypi:~/luma.examples/examples $ sudo python 3d_box.py
Version: luma.oled 3.1.0 (luma.core 1.8.3)
Display: ssd1306
Interface: i2c
Dimensions: 128 x 64
------------------------------------------------------------
usage: 3d_box.py [-h] [--config CONFIG] [--display DISPLAY] [--width WIDTH]
[--height HEIGHT] [--rotate ROTATION] [--interface INTERFACE]
[--i2c-port I2C_PORT] [--i2c-address I2C_ADDRESS]
[--spi-port SPI_PORT] [--spi-device SPI_DEVICE]
[--spi-bus-speed SPI_BUS_SPEED] [--spi-cs-high SPI_CS_HIGH]
[--spi-transfer-size SPI_TRANSFER_SIZE] [--gpio GPIO]
[--gpio-mode GPIO_MODE]
[--gpio-data-command GPIO_DATA_COMMAND]
[--gpio-reset GPIO_RESET] [--gpio-backlight GPIO_BACKLIGHT]
[--block-orientation ORIENTATION] [--mode MODE]
[--framebuffer FRAMEBUFFER] [--bgr] [--h-offset H_OFFSET]
[--v-offset V_OFFSET] [--backlight-active VALUE]
[--transform TRANSFORM] [--scale SCALE] [--duration DURATION]
[--loop LOOP] [--max-frames MAX_FRAMES]
3d_box.py: error: I2C device not found on address: 0x3C

MarkDH102
Posts: 329
Joined: Fri Feb 13, 2015 3:18 pm

Re: OLED error.

Sun Jan 13, 2019 7:15 am

Have you tried the i2c tools? They should be installed by default.
From a terminal window, run :

i2cdetect -y 1

If I have understood correctly, you should see an entry at 3C.
If there is another entry in the list, and you have no other devices connected to the Pi, then the address of the display is not 3C and you may need to change it in the code.
If not, then show us how the display is connected to the Pi.

User avatar
neilgl
Posts: 622
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: OLED error.

Sun Jan 13, 2019 10:49 am

Post an image of your connections so we can look at it.
And good point about i2cdetect @MarkDH102.

DirkS
Posts: 9871
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: OLED error.

Sun Jan 13, 2019 5:10 pm

oliverstrother wrote:
Sat Jan 12, 2019 10:32 pm
I checked that i2c interface is enabled. I've got it set up for an SPI interface and get the following error.
i2c and spi are different protocols and use different pins.
Which one of the two are you actually trying to use?

Return to “Troubleshooting”