Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input/output error for luma.oled #372

Open
lmcpith opened this issue Apr 3, 2023 · 6 comments
Open

Input/output error for luma.oled #372

lmcpith opened this issue Apr 3, 2023 · 6 comments

Comments

@lmcpith
Copy link

lmcpith commented Apr 3, 2023

Type of Raspberry Pi

Linux Kernel version

5.4.0-139-generic

kindly suggest a version of luma that can work with linux ubuntu. might be timing or handhake. using oled 128x32

Expected behaviour

trying to use luma.oled library under linux ubuntu
oled is well detected and well mapped under i2c but and mapped as 0x3c, visible
hoping to use this library under linux ubuntu 18

Actual behaviour

    device = ssd1306(serial)
  File "/home/letmein/miniconda3/lib/python3.9/site-packages/luma/oled/device.py", line 171, in __init__
    self.clear()
  File "/home/letmein/miniconda3/lib/python3.9/site-packages/luma/core/mixin.py", line 46, in clear
    self.display(Image.new(self.mode, self.size))
  File "/home/letmein/miniconda3/lib/python3.9/site-packages/luma/oled/device.py", line 200, in display
    self.data(list(buf))
  File "/home/letmein/miniconda3/lib/python3.9/site-packages/luma/core/device.py", line 55, in data
    self._serial_interface.data(data)
  File "/home/letmein/miniconda3/lib/python3.9/site-packages/luma/core/interface/serial.py", line 131, in data
    write(list(data[i:i + block_size]))
  File "/home/letmein/miniconda3/lib/python3.9/site-packages/luma/core/interface/serial.py", line 140, in _write_large_block
    self._bus.i2c_rdwr(self._i2c_msg_write(self._addr, [self._data_mode] + data))
  File "/home/letmein/miniconda3/lib/python3.9/site-packages/smbus2/smbus2.py", line 658, in i2c_rdwr
    ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 5] Input/output error

@thijstriemstra
Copy link
Collaborator

what device are you using? can you link the datasheet or seller link?

@lmcpith
Copy link
Author

lmcpith commented Apr 4, 2023 via email

@ve2opn
Copy link

ve2opn commented Jul 27, 2023

Identical behaviour on latest Fedora Linux/x86_64 6.3.11-200.fc38.x86_64 Kernel
and 2.42" ssd1309 i2c 128x64 module from here : https://www.aliexpress.com/item/1005003091769556.html
I needed to short D2 as explained to get it visible at 0x3c.
The same example (terminal.py) works fine with two other smaller i2c modules based sh1106 and ssd1306 chips.
However with this one, starts and fails after a second-two working.
Typically: ... i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 5] Input/output error

FYI, the module as HW on same host works well with this driver: https://github.com/armlabs/ssd1306_linux

@ve2opn
Copy link

ve2opn commented Jul 27, 2023

Actual behaviour

[root@fedora examples]# python terminal.py -d ssd1309 --i2c-port 0
Version: luma.oled 3.12.0 (luma.core 2.4.0)
Display: ssd1309
Interface: i2c
Dimensions: 128 x 64
------------------------------------------------------------
Traceback (most recent call last):
  File "/home/msh1/TEST/luma.examples/examples/terminal.py", line 82, in <module>
    main()
  File "/home/msh1/TEST/luma.examples/examples/terminal.py", line 31, in main
    term.println("Uses any font to output text using a number of different print methods.")
  File "/usr/local/lib/python3.11/site-packages/luma/core/virtual.py", line 288, in println
    self.puts(text)
  File "/usr/local/lib/python3.11/site-packages/luma/core/virtual.py", line 304, in puts
    method(*args)
  File "/usr/local/lib/python3.11/site-packages/luma/core/virtual.py", line 339, in putch
    self.flush()
  File "/usr/local/lib/python3.11/site-packages/luma/core/virtual.py", line 402, in flush
    self._device.display(self._backing_image)
  File "/usr/local/lib/python3.11/site-packages/luma/oled/device/__init__.py", line 310, in display
    self.data(list(buf))
  File "/usr/local/lib/python3.11/site-packages/luma/core/device.py", line 55, in data
    self._serial_interface.data(data)
  File "/usr/local/lib/python3.11/site-packages/luma/core/interface/serial.py", line 131, in data
    write(list(data[i:i + block_size]))
  File "/usr/local/lib/python3.11/site-packages/luma/core/interface/serial.py", line 140, in _write_large_block
    self._bus.i2c_rdwr(self._i2c_msg_write(self._addr, [self._data_mode] + data))
  File "/usr/local/lib/python3.11/site-packages/smbus2/smbus2.py", line 658, in i2c_rdwr
    ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 5] Input/output error
[root@fedora examples]#

@thijstriemstra
Copy link
Collaborator

I was retesting with Linux ubuntu
latest Fedora Linux/x86_64 6.3.11-200.fc38.x86_64 Kernel

Anyone can test this on Raspberry Pi OS? I don't have such a device so won't be able to test..

@harshamsh
Copy link

harshamsh commented May 28, 2024

Any updates on this issue? having similar problems with ssd1309 on rpi4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants