add new SSD1306 OLED Display Size

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
derpunkt
Normal user
Posts: 7
Joined: 08 Oct 2017, 22:29

add new SSD1306 OLED Display Size

#1 Post by derpunkt » 08 Oct 2017, 22:35

Hi,

i just added an OLED Display via I2C to my ESP-01S (1MB flash).
My problem actually is, that i only have the choice of size 64x48 or 128x64.

My small display is of size 128x32 (a tiny little 4 liner).

Did someone already change/modify the plugin for die SSD1306 OLED Plugin so that there is a possibility to change the size to 128x32?

I looked at the source code of the plugin - but at this point my programming skills seems to end.
Or has anyone a hint what i should have to change to get this display size working?

thank you all for your answers!

Michael

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: add new SSD1306 OLED Display Size

#2 Post by vader » 08 Oct 2017, 22:47

I have this display in use. I kicked some stuff like the top line, the indicator and limited to 2 lines. Works good for me now. :mrgreen:

derpunkt
Normal user
Posts: 7
Joined: 08 Oct 2017, 22:29

Re: add new SSD1306 OLED Display Size

#3 Post by derpunkt » 08 Oct 2017, 23:06

did you change the _P023_OLED.ino?

Or where have you made your changes?
Can you list your changes here or send me your _P023_OLED.ino via email? :)

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: add new SSD1306 OLED Display Size

#4 Post by vader » 09 Oct 2017, 09:41

No, I changed only the _P036_FrameOLED.ino. The result looks now like this...
Attachments
20171009095726475.jpg
20171009095726475.jpg (8.21 KiB) Viewed 6125 times

TD-er
Core team member
Posts: 1806
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add new SSD1306 OLED Display Size

#5 Post by TD-er » 09 Oct 2017, 11:54

The "problem" with these small displays is they are using only every other line.
For example only the odd or even line numbers (did not check yet which are being used)

So it may help if you change the used font.
I was already looking into that myself, so likely they will be added for 2.1, when also my pull request for the new version of the library is being merged.

derpunkt
Normal user
Posts: 7
Joined: 08 Oct 2017, 22:29

Re: add new SSD1306 OLED Display Size

#6 Post by derpunkt » 09 Oct 2017, 20:56

vader wrote:
09 Oct 2017, 09:41
No, I changed only the _P036_FrameOLED.ino. The result looks now like this...
would you post your Version of _P036_FrameOLED.ino or the changes you made?
With this Information i could experiment a little bit if i could be able to change it too or if i could change the normal _P023_OLED.ino...

Thx in advance
Michael

derpunkt
Normal user
Posts: 7
Joined: 08 Oct 2017, 22:29

Re: add new SSD1306 OLED Display Size

#7 Post by derpunkt » 15 Oct 2017, 22:05

so - after searching a few days and spending some time with Platformio i found the solution for the Problem with the 128x32 OLED Displays.
It is correct that the 128x32 displays shows only every other line.

My first idea was to change the whole font data and insert some blank lines in the font arrays.

That "solution" made me almost crazy - and after a while i discarded this idea because for me that made no sense.

After a while of googling i found the solution:

In the init section only two values have to be changed - then the 128x32 OLED works fine.

These values are:

For 128x64:

Plugin_023_sendcommand(0xA8); //SSD1306_SETMULTIPLEX
Plugin_023_sendcommand(0x3F); //0x1F if 128x32, 0x3F if others (e.g. 128x64)
.
.
.
Plugin_023_sendcommand(0xDA); //COMPINS
Plugin_023_sendcommand(0x12); //0x02 if 128x32, 0x12 if others (e.g. 128x64)


For 128x32:

Plugin_023_sendcommand(0xA8); //SSD1306_SETMULTIPLEX
Plugin_023_sendcommand(0x1F); //0x1F if 128x32, 0x3F if others (e.g. 128x64)
.
.
.
Plugin_023_sendcommand(0xDA); //COMPINS
Plugin_023_sendcommand(0x02); //0x02 if 128x32, 0x12 if others (e.g. 128x64)

so i spend a little bit more of time to integrate this into _P023_OLED.ino so users can select this 128x32 display in Configuration frontend:
Auswahl_003.png
Auswahl_003.png (31.07 KiB) Viewed 5980 times
additionally i made another change:
The font in this plugin is with fixed width - so characters like "l" or "i" take a lot of space that they normally don't need.

I implemented an additional feature so that users now can select if they want to have all characters with the same size or if the plugin should optimize width:
Auswahl_004.png
Auswahl_004.png (29.78 KiB) Viewed 5980 times
....and so it looks in my example: :-)
20171015_215639.jpg
20171015_215639.jpg (217.3 KiB) Viewed 5980 times
Now i am looking what i have to do to commit these changes so they can get into the master branch or the next release so every user can use these new features.


Greets
Michael

edit: typo
Last edited by derpunkt on 15 Oct 2017, 23:32, edited 1 time in total.

derpunkt
Normal user
Posts: 7
Joined: 08 Oct 2017, 22:29

Re: add new SSD1306 OLED Display Size

#8 Post by derpunkt » 15 Oct 2017, 22:55

so i created a new pull request for this change:

https://github.com/letscontrolit/ESPEasy/pull/545

User avatar
grovkillen
Core team member
Posts: 3302
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: add new SSD1306 OLED Display Size

#9 Post by grovkillen » 16 Oct 2017, 16:32

Great job! Thanks!
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

QcVictor
Normal user
Posts: 46
Joined: 23 Feb 2016, 00:47

Re: add new SSD1306 OLED Display Size

#10 Post by QcVictor » 07 Feb 2018, 22:45

Thanks for the plugin, why in the latest firmware update the plugin updated look like not merged <2018010.

TD-er
Core team member
Posts: 1806
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add new SSD1306 OLED Display Size

#11 Post by TD-er » 07 Feb 2018, 23:45

QcVictor wrote:
07 Feb 2018, 22:45
Thanks for the plugin, why in the latest firmware update the plugin updated look like not merged <2018010.
What version of the firmware did you test?
The pull request was merged into the Mega branch, not the v2.0

And there are two plugins for these displays. The OLED (where this topic is about) and the Framed OLED, which was updated in the last build.

QcVictor
Normal user
Posts: 46
Joined: 23 Feb 2016, 00:47

Re: add new SSD1306 OLED Display Size

#12 Post by QcVictor » 08 Feb 2018, 00:43

With the latest 20180206 and yes this one the P023_OLED.ino

TD-er
Core team member
Posts: 1806
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add new SSD1306 OLED Display Size

#13 Post by TD-er » 08 Feb 2018, 08:39

Then I guess I don't understand your question.

derpunkt
Normal user
Posts: 7
Joined: 08 Oct 2017, 22:29

Re: add new SSD1306 OLED Display Size

#14 Post by derpunkt » 08 Feb 2018, 10:49

i didn't understand your question.

I looked at the actual branch - and there the latest version of P023_OLD.ino is integrated.
The last - and latest - update of this plugin was merged with pull request #545.

...so i don't understand what you mean with "in the latest firmware update the plugin updated look like not merged <2018010"...sorry...

QcVictor
Normal user
Posts: 46
Joined: 23 Feb 2016, 00:47

Re: add new SSD1306 OLED Display Size

#15 Post by QcVictor » 08 Feb 2018, 15:11

When I update the firmware in ota with the latest release from here https://github.com/letscontrolit/ESPEasy/releases the plugin as not been updated, the source show the older one

derpunkt
Normal user
Posts: 7
Joined: 08 Oct 2017, 22:29

Re: add new SSD1306 OLED Display Size

#16 Post by derpunkt » 08 Feb 2018, 16:14

ok, now i understand.

You must download the mega-Release.
This is one entry below...

Release mega-20180206

QcVictor
Normal user
Posts: 46
Joined: 23 Feb 2016, 00:47

Re: add new SSD1306 OLED Display Size

#17 Post by QcVictor » 08 Feb 2018, 19:58

derpunkt wrote:
08 Feb 2018, 16:14
ok, now i understand.

You must download the mega-Release.
This is one entry below...

Release mega-20180206
Thank you so much derpunkt, I never see difference between mega and v2.xxx, but now ..... make sens :lol:

mattlward
Normal user
Posts: 69
Joined: 24 Jan 2018, 15:20

Re: add new SSD1306 OLED Display Size

#18 Post by mattlward » 09 Feb 2018, 22:58

Will this change get pushed to the 1306framed display?

TD-er
Core team member
Posts: 1806
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add new SSD1306 OLED Display Size

#19 Post by TD-er » 09 Feb 2018, 23:13

mattlward wrote:
09 Feb 2018, 22:58
Will this change get pushed to the 1306framed display?
Not this change, but there will be support for other display sizes in the OLED framed plugin.
About a week ago, I updated a lot in the code for the framed plugin and one of the things was in preparation of other display sizes.

No estimate yet on when it will happen, but for sure that it will happen :)

7keys
Normal user
Posts: 16
Joined: 23 Feb 2018, 13:30

Re: add new SSD1306 OLED Display Size

#20 Post by 7keys » 25 Feb 2018, 20:35

will it be possible to add other fonts?

(I used "mqtt import" but after waking up (sleep mode) but he did not download data...)
Attachments
oled 128x32.jpeg
oled 128x32.jpeg (146.41 KiB) Viewed 5155 times

TD-er
Core team member
Posts: 1806
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add new SSD1306 OLED Display Size

#21 Post by TD-er » 26 Feb 2018, 21:41

You can add fonts yourself, uing the online font generator: http://oleddisplay.squix.ch/#/home
You have to replace some font names in the code and the font file and then recompile.

User avatar
grovkillen
Core team member
Posts: 3302
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: add new SSD1306 OLED Display Size

#22 Post by grovkillen » 26 Feb 2018, 22:18

I've used agency as a font for the wiki templates with logo. Might consider specifying the official font?

https://www.letscontrolit.com/wiki/inde ... late_Files

Just a suggestion :ugeek:
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 1806
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add new SSD1306 OLED Display Size

#23 Post by TD-er » 26 Feb 2018, 22:41

Not sure if that font will look nice when rendered on a low res display without anti aliasing pixels.

Will have to try and render letters like "a", "m", "n", "r" and "p"
The upper case letters should not be a problem I guess.

But if there's a better looking font, which also includes the euro sign and all the other supported characters, I am all open for suggestions.
N.B. the current included font does not support the euro sign.

You have to use the v3 font generator.

7keys
Normal user
Posts: 16
Joined: 23 Feb 2018, 13:30

Re: add new SSD1306 OLED Display Size

#24 Post by 7keys » 27 Feb 2018, 22:37

TD-er wrote:
26 Feb 2018, 21:41
You can add fonts yourself, uing the online font generator: http://oleddisplay.squix.ch/#/home
You have to replace some font names in the code and the font file and then recompile.
so.. there is no chance to use it https://github.com/olikraus/u8glib/wiki/fontsize

User avatar
grovkillen
Core team member
Posts: 3302
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: add new SSD1306 OLED Display Size

#25 Post by grovkillen » 27 Feb 2018, 22:42

I think it would cost too much in memory size.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

7keys
Normal user
Posts: 16
Joined: 23 Feb 2018, 13:30

Re: add new SSD1306 OLED Display Size

#26 Post by 7keys » 27 Feb 2018, 23:05

grovkillen wrote:
27 Feb 2018, 22:42
I think it would cost too much in memory size.
I added only two on the previous photo (nodemcu + lua)
a nice feature would be the option to add a font (two different ...) - no need for compilation :) It's stupid:)
Maybe the possibility of resizing ? 2x 3x ? for each row..

TD-er
Core team member
Posts: 1806
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add new SSD1306 OLED Display Size

#27 Post by TD-er » 01 Mar 2018, 21:20

7keys wrote:
27 Feb 2018, 22:37
TD-er wrote:
26 Feb 2018, 21:41
You can add fonts yourself, uing the online font generator: http://oleddisplay.squix.ch/#/home
You have to replace some font names in the code and the font file and then recompile.
so.. there is no chance to use it https://github.com/olikraus/u8glib/wiki/fontsize
Those look nice, but I am not sure it is easy to convert these to the font usable by the OLED display.

The added size may be a bit of a concern, since it will probably add to the flash size, which is already reaching practical limits for OTA flashes.
It is possible to add other fonts, but we're kind of limited to the font generator I already linked.
Dynamically adding fonts would involve quite a lot of effort. Compiling them in the current code isn't that hard.
But then there are probably many other fonts people like.
So maybe we could make it easier for people to add it themselves. I will think about it.

whatsupskip
Normal user
Posts: 96
Joined: 28 Feb 2018, 07:40

Re: add new SSD1306 OLED Display Size

#28 Post by whatsupskip » 17 Mar 2018, 11:31

7keys wrote:
27 Feb 2018, 23:05
Maybe the possibility of resizing ? 2x 3x ? for each row..
I think this is the critical part. Currently the 128x32 display is not very useful with the available font.

Is it possible to change the title of the thread to include 128x32?

YKnot
Normal user
Posts: 6
Joined: 31 Jul 2018, 01:21

Re: add new SSD1306 OLED Display Size

#29 Post by YKnot » 12 Nov 2018, 00:54

How can I make the font size bigger? I have 2 lines of text so can I make 1 line of text take up 2 rows so its bigger font?

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests