rvdbreemen / OTGW-firmware

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

Add I2C support for OLED/LCD #152

Open STemplar opened 1 year ago

STemplar commented 1 year ago

Add I2C support for LCD 16x2/20x4 and/or OLED Display with I2C Modules as suggested by the OpenTherm Gateway Manual. afbeelding

rvdbreemen commented 1 year ago

@STemplar great idea to add that. Would you build that feature?

STemplar commented 1 year ago

Well, I am not a programmer. But if it's a standard Arduino library, I can take a look and give it a try.

Roos-AID commented 1 year ago

I2C is already used for temperature sensors, so not a big deal to add some function. However, it requires quite some memory for display rendering. They key question here is what you would like to display on the LCD and what benefit would that have over HA ?

STemplar commented 1 year ago

As far as I know the Arduino I2C LCD interface looks very much like a serial interface. No display rendering, so perhaps a simple LCD-displey is more suited than an OLED-display.

More info on Arduino LCD I2C.

Reading the U8G2-library I see it also has an U8x8 mode / text output only, writes directly to the display.

DaveDavenport commented 1 year ago

u8g2 should be doable and add support for some small oled screens. Probably nicest solution. It is a pretty low-overhead library (I had it running in systems with 32kbyte of combined instruction and data memory). I think we have enough space remaining for this.

I can implement this if needed.

However what we should display on the display is a 2nd questions we should answer first.

STemplar commented 1 year ago

Indeed, I would say hardcode some variables first, like Relative Modulation level (17), Boiler flow water temperature (25) and Return water temperature (28). OEM Diagnostic code (115). Maybe later make it configurable via WebUI?

DaveDavenport commented 1 year ago

https://user-images.githubusercontent.com/406245/213925010-9b9dfc65-883a-41fa-a43e-5178c29d524f.mp4

Roos-AID commented 1 year ago

This is indeed nice add-on function, but for me it lower priority than extra sensors. How many gpio pins are extern available on the wemos ? We already need one for onewire temp sensors, one for s0 kwh counter and one is reserved for gpio output. We do need 2 more for the i2c.

DaveDavenport commented 1 year ago

The i2c are already exposed and you can hang a multiple sensors + oled displays on this bus.

Roos-AID commented 1 year ago

Dave, which IO pins are used for SDA and SCL on V2 and V2.8 boards ? I can't find this in the manual

DaveDavenport commented 1 year ago

sda/sdl are connected up to the default i2c pads on the wemos. gpio 5 and gpio 4. (D1 and D2) (atleast on 2.9)