crismc / rpi_i2c_oled

Python library to enable 128x32 pixel OLED for Raspberry Pi (both 32 and 64bit).
MIT License
13 stars 10 forks source link

[Feature]: Add support for SSD1306_128_64 #6

Closed hackthis02 closed 4 months ago

hackthis02 commented 1 year ago

Is your feature request related to a problem?

how hard would it be to add support for SSD1306_128_64? I was debating on branching this and give it a go.

Describe the solution you'd like

Be able to use a 128x64 screen

Describe alternatives you've considered

No response

Additional context

Here is the screen I currently using and would like to add support for. https://www.amazon.com/gp/product/B07VDXYDVY

crismc commented 1 year ago

On the face of it, I would say this would be relatively straight forward, but a little time consuming. As this leverages a butchered version of the Adafruit Python SSD1306 library, you can restore the abstraction to include this screen size. The bin/SSD1306.py would need to be replaced with the original Adafruit Python SSD1306 library, and the init.py may also require some updating to accommodate the new import path. Beyond that, it should just... work [hopefully] :).

mediocaballero commented 5 months ago

I would also love to see this happening, just to be able to use this printable case for my pi: https://www.thingiverse.com/thing:4740975

hackthis02 commented 5 months ago

Yeah, I haven't had a chance to look into this yet. But it's on my list.

hackthis02 commented 4 months ago

@mediocaballero I spend about an hour this morning getting it working. It's still using crismc's screens. I might rework those for the lager screen size. If you want to try it out, https://github.com/hackthis02/homeassistant_addons

mediocaballero commented 4 months ago

Hey! Thanks for your update! I downloaded the repo to test, but it seems it's not working for me. This is what I get in the logs (similar than what I had with the original repo):

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[23:53:47] INFO: Starting I2C OLED App...
/dev/i2c-1
[23:53:47] INFO: /dev/i2c-1 enabled
[23:53:47] INFO: I2C access enabled. Proceeding!
[23:53:47] INFO: Display Info to OLED
[23:53:47] INFO: Running 'python3 display.py  -c /data/options.json'
Traceback (most recent call last):
  File "/I2C_OLED/display.py", line 5, in <module>
    from bin.Config import Config
  File "/I2C_OLED/bin/Config.py", line 5, in <module>
    from bin.Screens import *  
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/I2C_OLED/bin/Screens.py", line 55, in <module>
    class BaseScreen:
  File "/I2C_OLED/bin/Screens.py", line 60, in BaseScreen
    def __init__(self, duration, display = Display(), utils = Utils(), config = None):
                                           ^^^^^^^^^
  File "/I2C_OLED/bin/Screens.py", line 19, in __init__
    self.clear()
  File "/I2C_OLED/bin/Screens.py", line 29, in clear
    self.display.begin()
  File "/I2C_OLED/bin/SSD1306.py", line 97, in begin
    self._initialize()
  File "/I2C_OLED/bin/SSD1306.py", line 154, in _initialize
    self.command(SSD1306_DISPLAYOFF)                    # 0xAE
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/I2C_OLED/bin/SSD1306.py", line 89, in command
    self._bus.write_byte_data(self._address, control, value)
OSError: [Errno 5] I/O error
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
hackthis02 commented 4 months ago

I'll look into this. But I don't want to bug crismc, since this isn't related to his repo, go start an issue on my repo.

mediocaballero commented 4 months ago

Thanks! Will do (once you enable them @hackthis02 (-: )