rvdbreemen / OTGW-firmware

A ESP8266 devkit firmware for the Nodoshop version of the Opentherm Gateway (OTGW)
MIT License
147 stars 34 forks source link

Add I2C display #179

Open rvdbreemen opened 1 year ago

rvdbreemen commented 1 year ago

Display for basic information on the print using I2C display. On display : Date/Time, Uptime, IP address, last error? Boiler modulation?

DaveDavenport commented 1 year ago

image image

We need to decide what to display. This can be tested on the branch I made. The code should be isolated enough so others can easily tweak it.

tjfsteele commented 1 year ago

The PCB is designed to make adding a 4 pin i2c oled easy to do. Does need software!

Tim

On Sun, 29 Jan 2023, 11:09 Robert van den Breemen, @.***> wrote:

Display for basic information on the print using I2C display. On display : Date/Time, Uptime, IP address, last error? Boiler modulation?

— Reply to this email directly, view it on GitHub https://github.com/rvdbreemen/OTGW-firmware/issues/179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3CV4D2QNO4LAYYDDBL3UDWUZFW5ANCNFSM6AAAAAAUKF37SM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DaveDavenport commented 1 year ago

Code is there now for a small 1.3" oled directly to the header.

tjfsteele commented 1 year ago

Unfortunately some displays come with the pins in the correct order and some don't!

Tim

On Sun, 29 Jan 2023, 19:28 Dave Davenport, @.***> wrote:

Code is there now for a small 1.3" oled directly to the header.

— Reply to this email directly, view it on GitHub https://github.com/rvdbreemen/OTGW-firmware/issues/179#issuecomment-1407749500, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3CV4E3CFZNGQOW6MAUPBLWU3AGTANCNFSM6AAAAAAUKF37SM . You are receiving this because you commented.Message ID: @.***>

DaveDavenport commented 1 year ago

yes, that is annoying yes.. what is worse.. some have an SSD13xx controller, some an SH1106. They live on the same i2c adress , but behave slightly different. So you get a distorted display if they don't match.

tjfsteele commented 1 year ago

Is there a way to sense that in software?

On Sun, 29 Jan 2023, 19:34 Dave Davenport, @.***> wrote:

yes, that is annoying yes.. what is worse.. some have an SSD13xx controller, some an SH1106. They live on the same i2c adress , but behave slightly different. So you get a distorted display if they don't match.

— Reply to this email directly, view it on GitHub https://github.com/rvdbreemen/OTGW-firmware/issues/179#issuecomment-1407750837, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3CV4A7W6VFKR5Q3UP6YYDWU3A3VANCNFSM6AAAAAAUKF37SM . You are receiving this because you commented.Message ID: @.***>

DaveDavenport commented 1 year ago

Not that I know off. In general I found that the 0.96" have the ssd13xx drivers and the 1.3" have the sh1106 ones. These are compatible: https://www.tinytronics.nl/shop/en/displays/oled/1.3-inch-oled-display-128*64-pixels-white-i2c

DaveDavenport commented 1 year ago

bar on right is for icons, showing flame/etc. But I need somebody to make the icon.

image

image image image

tjfsteele commented 1 year ago

It would be useful to find out if the oled displays sold by the nodo shop are compatible.

Robert has a good flame icon..

Tim

On Sun, 29 Jan 2023, 20:07 Dave Davenport, @.***> wrote:

bar on right is for icons, showing flame/etc. But I need somebody to make the icon.

[image: image] https://user-images.githubusercontent.com/406245/215352903-ee8e6dd8-2b4e-4caf-b406-39bd016ea4e3.png

[image: image] https://user-images.githubusercontent.com/406245/215352916-fe31e00f-2ade-4121-8ccb-1c95acc11be6.png [image: image] https://user-images.githubusercontent.com/406245/215352975-50192d67-2ec0-4cde-a057-1e899b6eeeab.png [image: image] https://user-images.githubusercontent.com/406245/215352989-fe458c37-72a4-4f58-ae2e-2e28654eb5d0.png

— Reply to this email directly, view it on GitHub https://github.com/rvdbreemen/OTGW-firmware/issues/179#issuecomment-1407757945, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3CV4CS5V6JGVWCO4WXQSTWU3EXLANCNFSM6AAAAAAUKF37SM . You are receiving this because you commented.Message ID: @.***>

DaveDavenport commented 1 year ago

hard to say from the page, it looks like the 0.96" version.

DaveDavenport commented 1 year ago

https://github.com/rvdbreemen/OTGW-firmware/pull/178/ if anybody wants to test.

DaveDavenport commented 1 year ago

image would probably look like this..

tjfsteele commented 1 year ago

You could ask him to send one?

On Sun, 29 Jan 2023, 20:13 Dave Davenport, @.***> wrote:

hard to say from the page, it looks like the 0.96" version.

— Reply to this email directly, view it on GitHub https://github.com/rvdbreemen/OTGW-firmware/issues/179#issuecomment-1407759208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3CV4HYHRKY6DJEYZMZCETWU3FM7ANCNFSM6AAAAAAUKF37SM . You are receiving this because you commented.Message ID: @.***>

rvdbreemen commented 1 year ago

The icon space is very small, a 'normal' icon is 16x16 or 32x32...

DaveDavenport commented 1 year ago

10x10 pixels should fit in there. it is 18 pixels wide. (it can always be enlarged, this was mostly just for testing).

rvdbreemen commented 1 year ago

The workflow to create an icon for displays, do the following steps:

  1. Open Gimp (install first: https://www.gimp.org/downloads/)
  2. Find an icon on a site like (flaticon), download it, and open it in Gimp
  3. Selecteer Image-->Mode-->Indexed-->Use black and white (1 bit) palette
  4. Scale to correct size (16x16 of 32x32 etc.)
  5. If the icon needs improvement, after scaling. Then touchup the icon.

Touch up icon:

  1. Select the 'perceel brush'
  2. Left to the brush (links), select the 1 pixel brush
  3. Change the size to the 1 pixel
  4. Touch up your icon to your liking

Remove Alpha Transpancy Layer:

  1. Remove transparency layer (Layer --> Transpancy --> Remove Alpha Layer)

Exporteer icon to XBM format

  1. File --> Export as (CTRL-E)
  2. Enter a new name, ending in '.xbm'
  3. Open the result in notepad, then you can find:

Code example in xmb format

#define flame_16x16_width 16
#define flame_16x16_height 16
static unsigned char flame_16x16_bits[] = {
   0x80, 0x00, 0x80, 0x00, 0x80, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x03,
   0xe0, 0x0b, 0xf0, 0x0f, 0x70, 0x1f, 0x78, 0x1e, 0x38, 0x1e, 0x38, 0x1c,
   0x18, 0x1c, 0x18, 0x1c, 0x30, 0x0e, 0x20, 0x07 };

Then goto this repo to see how to integrate the icons: https://github.com/JDJelectronics/u8g2_Android_icons/blob/main/Statusbar_icons_android_U8G2/Statusbar_icons_android_U8G2.ino

Shout out to @JDJelectronics

DaveDavenport commented 1 year ago

I know how to add icons, I just refuse to pick/draw icons as I always spend tons of time doing this, to then be told its wrong and then suddenly others can pick icons. So apparently I am not good at it and want to avoid the first step.

Find an icon on a site like (flaticon), download it, and open it in Gimp

You need to make sure the license is correct. We also need pixel icons as we have 1 bit colors on small size.

rvdbreemen commented 1 year ago

I will try to find some this week 😇 Don't worry about it.