SS1306 / 0.9" OLD Display Module - variable number of lines

Situation

I am working on a project which adds environmental control for dry filament storage boxes to klipper and I have created a board that uses such a 128x32 0.9” I2C OLED module (example only) to display the sensor values on the storage box. And I want to control it with klippy firmware.

Problem

using the SS1306 or better the sh1106 subvariant of the display in klipper configuration displays the values but the firmware assumes that the OLED is high enough for 4 lines of text. Which results in very small characters, almost unreadable. (see attached image)

Idea/Request

Can we add control logic to the display component that allows to set the number of lines on the display and adjusts the size of the font. If necessary or more suitable it could also work if the size (in pixels) of the display and the font size can be configured and the number of lines are calculated from that.

I will start investigating this on my own and keep you updated on this post. If someone is working on a similar change or if this is already available, please let me know in the comments.

Thx
Christian

2 Likes

Welcome chof747,
good idea.

clone. branch. hack. test←→hack. cleanup. pull request. (or similar) is likely the way to go about this here. probably posting to the developers forum would be good.

1 Like

I am on it. Rough idea is to introduce a display_font configuration element that can read bdf font files (or other formats, I will keep this flexible) and then assign it to a display which draws it in the same way as the built in font.

Built in font will stay the default.