SSD1322 OLED problem

Hi!

I´ve got problem with SSD1322 OLED-display.

Text won´t fit to display, orientation wrong and white line on the other end of display.

Any ideas what could be wrong, display faulty?

Tested also with same model display and result is the same.
Displays bought from Aliexpress.

My code / pinout configuration:

spi:
  clk_pin: 5
  mosi_pin: 23

display:
  - platform: ssd1322_spi
    model: "SSD1322 256x64"
    reset_pin: 17
    cs_pin: 22
    dc_pin: 19
    lambda: |-
      it.print(0, 0, id(font1), " Hello World!");

font:
  - file: 'arial.ttf'
    id: font1
    size: 25 

Sounds like you need a “flip_x” type setting.

This issue sounds a bit similar.

Can´t use rotate_chip+reverse_enable+flip_x attributes with ssd1322_spi-component.

With rotation: 180 attribute I was able to rotate text but wrong orientation and white line still exists.

display:
  - platform: ssd1322_spi
    model: "SSD1322 256x64"
    rotation: 180
    spi_mode: mode1
    brightness: 10%
    rotate_chip: 180
    reverse_enable: true
    reset_pin: GPIO17
    cs_pin: GPIO22
    dc_pin: GPIO19
    lambda: |-
      it.print(0, 0, id(font1), "Hello World!");

Hello,

did you resolve this as I have exactly the same display with exactly this issue!!!

G

Issue not solved :frowning:

I solved this problem. I have exactly this same OLED display like you showed on first post. Mirror on the screen and blank bar exist for olikraus u8g2 arduino drivers and ESPHome as well.
For olikraus u8g2 drivers solution is explained at the link: Blank bar and text mirrored on 256x64 SSD1322 OLED display · Issue #2386 · olikraus/u8g2 · GitHub
For ESPHome you need to do following steps:

  1. You need to change some parameters at SSD1322 ESPHome drivers. To be possible to do it you need to create external components at ESPHome yaml.
    You need to put ESPHome drivers for SSD1322 at my_components folder. My example of external component is following:
    external_components:
external_components:
  - source:
      type: local
      path: my_components
    components: [ ssd1322_base, ssd1322_spi ]
  1. After that you need to modify file ssd1322_base.cpp

this->command(SSD1322_SETREMAP);
this->data(0x016);
this->data(0x11);

and

void SSD1322::display() {
this->command(SSD1322_SETCOLUMNADDRESS); // set column address
int offset_x = -4;
this->data(0x1C + offset_x); // set column start address
this->data(0x5B + offset_x); // set column end address
this->command(SSD1322_SETROWADDRESS); // set row address
this->data(0x00); // set row start address
this->data(0x3F); // set last row
this->command(SSD1322_WRITERAM); // write

That is all - it should works.

Can´t get work external component. Maybe problem is that init.py file missing? ZIP-package only included .cpp and .h files.

It gives me error “init.py not found”

How to create init.py ?

My YAML code:

esphome:
  name: lcd1
  friendly_name: lcd1

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

external_components:
  - source:
      type: local
      path: my_components
    components: [ ssd1322_base, ssd1322_spi ]

ota:
  password: "xxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

spi:
  clk_pin: GPIO5
  mosi_pin: GPIO23

display:
  - platform: ssd1322_spi
    model: "SSD1322 256x64"
    brightness: 10%
    reset_pin: GPIO17
    cs_pin: GPIO22
    dc_pin: GPIO19
    lambda: |-
      it.print(0, 0, id(font1), "Hello World!");

font:
  - file: 'arial.ttf'
    id: font1
    size: 25 

Success! I figured it out myself, sorry for stupid questions.

I downloaded drivers from Github https://github.com/esphome/esphome/tree/dev/esphome/components

Made changes above (spiderjuka post) to ssd1322_base.cpp and then succesfully compiled program.

Display working perfectly now, thank you so much for help :slightly_smiling_face: