OLED I2C
Moderators: grovkillen, Stuntteam, TD-er
Re: OLED I2C
I'd like to see support for this too!
Re: OLED I2C
So do I.
I have a number of those little OLED displays. They are ideal for projects with small footprints.
I have a number of those little OLED displays. They are ideal for projects with small footprints.
Re: OLED I2C
Development release R46 (github) now has basic text support for the I2C SSD1306 128x64 OLED display:


Re: OLED I2C
Hi,
nice, thx a lot.
Is it planend in future to send Messages via http request, like:
??
Would be nice also for the LCD Display.
Or could i send such Messages via json or something else?
best wishes
BerndJ
PS: I found 0,96" and some 1,3" Displays with these controler. Are there greater on the market?
nice, thx a lot.
Is it planend in future to send Messages via http request, like:
Code: Select all
http://<ESP IP address>/control?cmd=OLED,<line nr>,<pos nr>,<Text>
Would be nice also for the LCD Display.
Or could i send such Messages via json or something else?
best wishes
BerndJ
PS: I found 0,96" and some 1,3" Displays with these controler. Are there greater on the market?
Re: OLED I2C
Nice!! I was trying to develop this plugin as I tried out Nathan Chantrell's WiFi MQTT display code (http://nathan.chantrell.net/20141230/wi ... he-esp8266) for the ESP8266. I used the esp_mqtt example from the Cherts Dev Kit (http://www.esp8266.com/viewtopic.php?f=9&t=820).
MQTT to Oled is also interesting. Personally I prefer MQTT over HTTP. It's very lightweight and snappy. MQTT light switch (https://harizanov.com/wiki/wiki-home/th ... tat-board/) is almost realtime. Code is also on Github.
MQTT to Oled is also interesting. Personally I prefer MQTT over HTTP. It's very lightweight and snappy. MQTT light switch (https://harizanov.com/wiki/wiki-home/th ... tat-board/) is almost realtime. Code is also on Github.
Re: OLED I2C
It would be great to have all output methods supported by MQTT (relay/output pin, PWM, displays etc)fluppie wrote:MQTT to Oled is also interesting. Personally I prefer MQTT over HTTP. It's very lightweight and snappy. MQTT light switch (https://harizanov.com/wiki/wiki-home/th ... tat-board/) is almost realtime. Code is also on Github.
- Jan
Jan Chrillesen, Denmark
Re: OLED I2C
Development R47 on github has support for this, both LCD and OLED plugins have been updated.BerndJ wrote:Is it planend in future to send Messages via http request, like:
Would be nice also for the LCD Display.Code: Select all
http://<ESP IP address>/control?cmd=OLED,<line nr>,<pos nr>,<Text>
Re: OLED I2C
It would be great indeed, but looking at the code bits that we have build for MQTT output control it is not so easy as with http control.chrille wrote:It would be great to have all output methods supported by MQTT (relay/output pin, PWM, displays etc)
- Jan
This is actually still in a very rudimentary and experimental state and it supports only simple topics with one "command", one parameter to identify the IO pin and one single numerical value being send by MQTT messages.
Re: OLED I2C
HTTP is already very nice, MQTT will be even better.
Should we implement a "screensaver" function? Is the OLED display sensitive to "burn-in" ??
Should we implement a "screensaver" function? Is the OLED display sensitive to "burn-in" ??
Re: OLED I2C
Somewhere I read, that oleds develop burn-in from luminance degradation of the light-emitting pixels.
I think it must be possible to shut down the display with a command.
I think it must be possible to shut down the display with a command.
Re: OLED I2C
Or maybe blank display during the night an/or a blank display during 5s every minute?
Re: OLED I2C
BertB wrote:Somewhere I read, that oleds develop burn-in from luminance degradation of the light-emitting pixels.
I think it must be possible to shut down the display with a command.
it is possible to set the contrast level.
Just change in file _P023_OLED.ino
(Line 438 ) Plugin_023_sendcommand(0x81); //SETCONTRAST
(Line 439 ) Plugin_023_sendcommand(0x1F); Lower values is less bright.
Re: OLED I2C
@Martinus: Can you build a feature with this in the plugin, so it can be controlled via a Domoticz dimmer device and by pushing a switch on the ESP itself? A push on the switch switches the display on for a while.neuros wrote:BertB wrote:Somewhere I read, that oleds develop burn-in from luminance degradation of the light-emitting pixels.
I think it must be possible to shut down the display with a command.
it is possible to set the contrast level.
Just change in file _P023_OLED.ino
(Line 438 ) Plugin_023_sendcommand(0x81); //SETCONTRAST
(Line 439 ) Plugin_023_sendcommand(0x1F); Lower values is less bright.
Re: OLED I2C
Hello
I connected my oled to ESP12e with last GIThub release R48 and it works ! great !!! thank you for that !
push via url is also working
minor remark: special character éè ... are not working. WE can manage that.
However the ° of °centigrade would be nice to have
other ideas: possibility to dump on screen some ESP system parameter such as ssid, IP address, uptime,...
I connected my oled to ESP12e with last GIThub release R48 and it works ! great !!! thank you for that !
push via url is also working
minor remark: special character éè ... are not working. WE can manage that.
However the ° of °centigrade would be nice to have

other ideas: possibility to dump on screen some ESP system parameter such as ssid, IP address, uptime,...
Re: OLED I2C
I have the wellknown OLED 0.96 inch display with SSD1306 controller.
It has a configurable I2C address with a solderpad at the backside, marked as 78 or 7A with translates to address 3C or 3D. (I2C adresses have to be divided by 2 sometimes as the even address is the listen and the uneven address is the talk address of the same device 78/79=3C and 7A/7B=3D).
As I have another OLED 1.3 inch display already on address 3C i have changed my 0.96inch display to address 3D.
I had to change the ESPEasy sketch in 2 places to make the OLED work again with this different address.
in file: _P023_OLED.ino : line 294 #define OLED_address 0x3d // was 0c3c
and had to add 3 lines in the WebServer.ino after line 1127
case 0x3D:
reply += F("OLED SSD1306 Display");
break;
p.s. i use the 048 release
It has a configurable I2C address with a solderpad at the backside, marked as 78 or 7A with translates to address 3C or 3D. (I2C adresses have to be divided by 2 sometimes as the even address is the listen and the uneven address is the talk address of the same device 78/79=3C and 7A/7B=3D).
As I have another OLED 1.3 inch display already on address 3C i have changed my 0.96inch display to address 3D.
I had to change the ESPEasy sketch in 2 places to make the OLED work again with this different address.
in file: _P023_OLED.ino : line 294 #define OLED_address 0x3d // was 0c3c
and had to add 3 lines in the WebServer.ino after line 1127
case 0x3D:
reply += F("OLED SSD1306 Display");
break;
p.s. i use the 048 release
Re: OLED I2C
How to display analog value from ADC input ?
[Analog#Voltage], not working.
[Analog#Voltage], not working.
Re: OLED I2C
You better start your own topic with this question.retel wrote:How to display analog value from ADC input ?
[Analog#Voltage], not working.
For me it is working: Device=Analog Input, formula=%value%/335 to display in volts the voltage from pin ADC/Tout.
Fill in: ADC [adcDemo#Analog] on the line of the Oled/LCD where adcDemo is the name of the device that you give to it.
Re: OLED I2C
Since OLEDs wear out, it would be nice to have a way to activate them on request.
Is it possible to add another port to the plugin to connect a switch for that purpose?
Is it possible to add another port to the plugin to connect a switch for that purpose?
Re: OLED I2C
I have no idea if an OLED wears out that fast. The small ones are cheap to replace, usually about 5 euro for a 0.96 or 10 euro's for a 1.3 inch.BertB wrote:Since OLEDs wear out, it would be nice to have a way to activate them on request.
Is it possible to add another port to the plugin to connect a switch for that purpose?
But if you want to turn it on/off on command it must be done with these 2 commands:
Plugin_023_sendcommand(0xae); //display off
Plugin_023_sendcommand(0xaf); //display on
So an input on the ESP needs an button that makes the ESP send the 0xAF command to the OLED and after a predetermined time the ESP needs to send the command 0xAE to the OLED to turn it off.
I have been playing with the contrast commands before but for me that did not give much effect. Probably because the OLED was so cheap that contrast is not implemented well.
Re: OLED I2C
Lifespan
The biggest technical problem for OLEDs was the limited lifetime of the organic materials. One 2008 technical report on an OLED TV panel found that "After 1,000 hours the blue luminance degraded by 12%, the red by 7% and the green by 8%."[69] In particular, blue OLEDs historically have had a lifetime of around 14,000 hours to half original brightness (five years at 8 hours a day) when used for flat-panel displays. This is lower than the typical lifetime of LCD, LED or PDP technology. Each currently is rated for about 25,000–40,000 hours to half brightness, depending on manufacturer and model.[70][71] Degradation occurs because of the accumulation of nonradiative recombination centers and luminescence quenchers in the emissive zone. It is said that the chemical breakdown in the semiconductors occurs in four steps: 1) recombination of charge carriers through the absorption of UV light, 2) homolytic dissociation, 3) subsequent radical addition reactions that form π radicals, and 4) disproportionation between two radicals resulting in hydrogen-atom transfer reactions.[72] However, some manufacturers' displays aim to increase the lifespan of OLED displays, pushing their expected life past that of LCD displays by improving light outcoupling, thus achieving the same brightness at a lower drive current.[73][74] In 2007, experimental OLEDs were created which can sustain 400 cd/m2 of luminance for over 198,000 hours for green OLEDs and 62,000 hours for blue OLEDs.[75]
The biggest technical problem for OLEDs was the limited lifetime of the organic materials. One 2008 technical report on an OLED TV panel found that "After 1,000 hours the blue luminance degraded by 12%, the red by 7% and the green by 8%."[69] In particular, blue OLEDs historically have had a lifetime of around 14,000 hours to half original brightness (five years at 8 hours a day) when used for flat-panel displays. This is lower than the typical lifetime of LCD, LED or PDP technology. Each currently is rated for about 25,000–40,000 hours to half brightness, depending on manufacturer and model.[70][71] Degradation occurs because of the accumulation of nonradiative recombination centers and luminescence quenchers in the emissive zone. It is said that the chemical breakdown in the semiconductors occurs in four steps: 1) recombination of charge carriers through the absorption of UV light, 2) homolytic dissociation, 3) subsequent radical addition reactions that form π radicals, and 4) disproportionation between two radicals resulting in hydrogen-atom transfer reactions.[72] However, some manufacturers' displays aim to increase the lifespan of OLED displays, pushing their expected life past that of LCD displays by improving light outcoupling, thus achieving the same brightness at a lower drive current.[73][74] In 2007, experimental OLEDs were created which can sustain 400 cd/m2 of luminance for over 198,000 hours for green OLEDs and 62,000 hours for blue OLEDs.[75]
Re: OLED I2C
@bert,
I think all these articles are about "super high luminance" OLED TV's. I think degradation is influenced by luminance strength being applied.
Do you think that this also applies to these tiny OLED displays? My sample has a brightness that resembles a "glow in the dark" toy...
I think all these articles are about "super high luminance" OLED TV's. I think degradation is influenced by luminance strength being applied.
Do you think that this also applies to these tiny OLED displays? My sample has a brightness that resembles a "glow in the dark" toy...
Re: OLED I2C
My 0,96 " Oled is quite bright, unless I turn back the contrast to 01.
One of my friends is specialized in displays and he confirms the rapid degradation.
One of my friends is specialized in displays and he confirms the rapid degradation.
Re: OLED I2C
If you want the centigrade/degree symbol you have to sacrifice another symbol for that.tparvais wrote:Hello
........
minor remark: special character éè ... are not working. WE can manage that.
However the ° of °centigrade would be nice to have![]()
For instance you can sacrifice the @ symbol and replace it with the ° degree symbol.
You do this:
in file -P023_OLED.ino you have to edit one line.
line 228 which looks like: {0x00, 0x32, 0x49, 0x79, 0x41, 0x3E, 0x00, 0x00},
which is the symbol @
Replace this with:
{0x00,0x00,0x0C,0x12,0x12,0x0C,0x00,0x00},
which is the degrees symbol and you just have to use the '@' to get the degree symbol on your OLED.
Re: OLED I2C
Powerful OLED lib: http://blog.squix.ch/2015/12/esp8266-ol ... lease.html
Code: https://github.com/squix78/esp8266-oled-ssd1306
Then we can play with fonts, flip/rotate the display
.
Code: https://github.com/squix78/esp8266-oled-ssd1306
Then we can play with fonts, flip/rotate the display

Re: OLED I2C
Not sure why I have yellow text in lines 7 and 8?Re: OLED I2C
You have a bi color Oled.
There are several version available.
http://www.ebay.nl/itm/5Pcs-0-96-Inch-4 ... SwYaFWb0Oi
Paco
There are several version available.
http://www.ebay.nl/itm/5Pcs-0-96-Inch-4 ... SwYaFWb0Oi
Paco
Re: OLED I2C
There is a specific internal SSD1306 command to set the direction how the display draws its pixels.hamster wrote: ....
Not sure why I have yellow text in lines 7 and 8?
bought this http://www.ebay.co.uk/itm/321927689593
Works great.. bicolor looks cool.
If you have a bicolor oled ESPEasy will draw line 7 & 8 in the second color.
If the rotate screen command is used first you will find that line 1 & 2 are in the second color. (Like the picture on Ebay shows the display)
You have to live with the fact that ESPEasy does it this way or else you have to dig deep in the plugin sourcecode to add the extra command for screen rotation.
Re: OLED I2C
thanks for the reply.. appreciated.. I can live with the yellow font on lines ..7 & 8 .. I think it looks cool.. 

Re: OLED I2C
I changed the OLED plugin a bit, so that I can switch on and off the display with a switch, created in Domoticz, with the on and off actions:
http://192.168.0.67/control?cmd=OLED,0,0,!on
http://192.168.0.67/control?cmd=OLED,0,0,!off
The commands are arbitrary, but as long as you do not use that specific sequence in normal messages, it seems to work just fine.
The update of the display continues even when the display is off.
@Martinus, can something like this be built in the official plugin?
http://192.168.0.67/control?cmd=OLED,0,0,!on
http://192.168.0.67/control?cmd=OLED,0,0,!off
The commands are arbitrary, but as long as you do not use that specific sequence in normal messages, it seems to work just fine.
The update of the display continues even when the display is off.
@Martinus, can something like this be built in the official plugin?
Code: Select all
case PLUGIN_WRITE:
{
String tmpString = string;
int argIndex = tmpString.indexOf(',');
if (argIndex)
tmpString = tmpString.substring(0, argIndex);
if (tmpString.equalsIgnoreCase("OLED"))
{
success = true;
argIndex = string.lastIndexOf(',');
tmpString = string.substring(argIndex+1);
============
Serial.print(tmpString);
if (tmpString.equalsIgnoreCase("!off"))
{
Plugin_023_displayOff();
}
else if (tmpString.equalsIgnoreCase("!on"))
{
Plugin_023_displayOn();
}
else
{
Plugin_023_sendStrXY(tmpString.c_str(), event->Par1 - 1, event->Par2 - 1);
}
============
}
break;
}
}
return success;
}
Re: OLED I2C
@BertB this is good stuff!
thank you.
anyone know of a better way to clear the oled screen? I'm sending 16x %20 to clear the line but it makes for a slower refresh.
thank you.
anyone know of a better way to clear the oled screen? I'm sending 16x %20 to clear the line but it makes for a slower refresh.
Re: OLED I2C
Should not be too hard to built it too.
Re: OLED I2C
Maybe better to have an extra command like OLEDCMD?BertB wrote:I changed the OLED plugin a bit, so that I can switch on and off the display with a switch, created in Domoticz, with the on and off actions:
http://192.168.0.67/control?cmd=OLED,0,0,!on
http://192.168.0.67/control?cmd=OLED,0,0,!off
The commands are arbitrary, but as long as you do not use that specific sequence in normal messages, it seems to work just fine.
The update of the display continues even when the display is off.
@Martinus, can something like this be built in the official plugin?
Code: Select all
case PLUGIN_WRITE: { String tmpString = string; int argIndex = tmpString.indexOf(','); if (argIndex) tmpString = tmpString.substring(0, argIndex); if (tmpString.equalsIgnoreCase("OLED")) { success = true; argIndex = string.lastIndexOf(','); tmpString = string.substring(argIndex+1); ============ Serial.print(tmpString); if (tmpString.equalsIgnoreCase("!off")) { Plugin_023_displayOff(); } else if (tmpString.equalsIgnoreCase("!on")) { Plugin_023_displayOn(); } else { Plugin_023_sendStrXY(tmpString.c_str(), event->Par1 - 1, event->Par2 - 1); } ============ } break; } } return success; }
then you would get
OLEDCMD,ON
OLEDCMD,OFF
-
- Normal user
- Posts: 25
- Joined: 07 Jan 2016, 17:18
Re: OLED I2C
Hallo from Austria
I will display my Thermostat from domoticz on the display
Is there any way to diplay the thermostat Temperature?
Best regard
I will display my Thermostat from domoticz on the display
Is there any way to diplay the thermostat Temperature?
Best regard
-
- New user
- Posts: 4
- Joined: 26 Jan 2016, 15:05
Re: OLED I2C
HI guys. I am using SSD1306 128x64 display by TinySine. I am using easyesp r48 on nodemcu v1(also tried it on adafruit huzzah feather, same sh^t) This is the image i get on the screen. Can you give me any suggestions why is the screen displaying this?
PS: The display works with Raspberry Pi
PS: The display works with Raspberry Pi
- Attachments
-
- Oled display
- 12584156_10205606850559551_1278406140_n.jpg (132.81 KiB) Viewed 35336 times
Re: OLED I2C
Hi,
The OLED has to be reset first, as a simple power on often leaves it in a uncertain state.
Try to connect the reset of the OLED to the reset of the NodeMCU. That worked for me.
The OLED has to be reset first, as a simple power on often leaves it in a uncertain state.
Try to connect the reset of the OLED to the reset of the NodeMCU. That worked for me.
-
- New user
- Posts: 4
- Joined: 26 Jan 2016, 15:05
Re: OLED I2C
hm... Thank you it works now. But in the wiki, it says to connect just the 4 pins, why is that?
Re: OLED I2C
We will improve the wiki. Sorry for the confusion.
Re: OLED I2C
So how should the Local Button for the OLED display be wired? The timer certainly works, but I tried 2 different pins pulled to ground or 3.3 V but neither triggered the display. For this I am using a Node MCU and R80. There could be some other problem as well, it likes to reboot a lot too, but that could be the wonderful USB port on my laptop, or the breadboard.
Re: OLED I2C
If you use a breadboard and external devices (with respect to NodeMCU) it is important to add extra capacitors across the power lines.
I also found that the diode in series with the USB port and the regulator sometimes takes too much tension across it, leaving hardly any space for the dropout voltage. I shorted all diodes on my NodeMCU's and had no spurious reboots anymore. But be careful here not to blow up the USB power supply, your pc or the NodeMCU.
I connected the OLED button to ground and to GPIO02. That works fine for my, but on other ports you may need to use a pull up resistor.
a short pulse on the button turns the OLED on, until the timer turns it off again.
I also found that the diode in series with the USB port and the regulator sometimes takes too much tension across it, leaving hardly any space for the dropout voltage. I shorted all diodes on my NodeMCU's and had no spurious reboots anymore. But be careful here not to blow up the USB power supply, your pc or the NodeMCU.
I connected the OLED button to ground and to GPIO02. That works fine for my, but on other ports you may need to use a pull up resistor.
a short pulse on the button turns the OLED on, until the timer turns it off again.
Re: OLED I2C
Ah, I've had stability problems when using the oled. Also using a nodemcu board. Had assumed that since the usb port i'm using provides 1A that would be enough...Drum wrote:So how should the Local Button for the OLED display be wired? The timer certainly works, but I tried 2 different pins pulled to ground or 3.3 V but neither triggered the display. For this I am using a Node MCU and R80. There could be some other problem as well, it likes to reboot a lot too, but that could be the wonderful USB port on my laptop, or the breadboard.
Re: OLED I2C
If you use a long USB cable and it has tiny wires you will have much loss in the cable.cherowley wrote: Ah, I've had stability problems when using the oled. Also using a nodemcu board. Had assumed that since the usb port i'm using provides 1A that would be enough...
Voltage will have dropped already as it reaches the usb connector of nodemcu board. There a diode gives another voltage drop before it reaches finally the 3.3v regulator. When voltage at the input of the regulator is low, the regulator will have difficulties to function during WiFi transmission.
This voltage drop during transmission will make the board unstable and unexplainable resets can occur.
This voltagedrop also influences the oled , making it flicker and maybe even freeze it.
Often it helps to use some extra capacitors on the 3.3v lines. The nodemcu has three 3.3v connections. You can use an extra capacitor on the 3.3v point positioned between EN_pin and GND, this helps stabilize the setup.
Who is online
Users browsing this forum: No registered users and 13 guests