Page 1 of 1

OLED I2C

Posted: 06 Oct 2015, 14:54
by mawi
Ist der Support von einen SSD1306 OLED Display auch geplant ?

Re: OLED I2C

Posted: 01 Nov 2015, 21:03
by spants
I'd like to see support for this too!

Re: OLED I2C

Posted: 02 Nov 2015, 08:07
by BertB
So do I.
I have a number of those little OLED displays. They are ideal for projects with small footprints.

Re: OLED I2C

Posted: 28 Nov 2015, 13:07
by Martinus
Development release R46 (github) now has basic text support for the I2C SSD1306 128x64 OLED display:

Image

Re: OLED I2C

Posted: 28 Nov 2015, 13:21
by BerndJ
Hi,

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

Posted: 28 Nov 2015, 16:31
by fluppie
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.

Re: OLED I2C

Posted: 28 Nov 2015, 20:32
by chrille
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.
It would be great to have all output methods supported by MQTT (relay/output pin, PWM, displays etc)

- Jan

Re: OLED I2C

Posted: 28 Nov 2015, 21:10
by fluppie
Working :)!!
IMG_6397.JPG
IMG_6397.JPG (105.82 KiB) Viewed 34571 times

Re: OLED I2C

Posted: 29 Nov 2015, 13:44
by Martinus
BerndJ wrote: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.
Development R47 on github has support for this, both LCD and OLED plugins have been updated.

Re: OLED I2C

Posted: 29 Nov 2015, 13:51
by Martinus
chrille wrote:It would be great to have all output methods supported by MQTT (relay/output pin, PWM, displays etc)
- Jan
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.
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

Posted: 29 Nov 2015, 19:57
by fluppie
HTTP is already very nice, MQTT will be even better.
Should we implement a "screensaver" function? Is the OLED display sensitive to "burn-in" ??

Re: OLED I2C

Posted: 29 Nov 2015, 20:48
by BertB
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.

Re: OLED I2C

Posted: 01 Dec 2015, 09:21
by fluppie
Or maybe blank display during the night an/or a blank display during 5s every minute?

Re: OLED I2C

Posted: 01 Dec 2015, 20:47
by neuros
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

Posted: 02 Dec 2015, 17:58
by BertB
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.
@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.

Re: OLED I2C

Posted: 02 Dec 2015, 23:14
by tparvais
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,...

Re: OLED I2C

Posted: 07 Dec 2015, 17:16
by costo
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

Re: OLED I2C

Posted: 07 Dec 2015, 19:30
by retel
How to display analog value from ADC input ?
[Analog#Voltage], not working.

Re: OLED I2C

Posted: 07 Dec 2015, 19:39
by costo
retel wrote:How to display analog value from ADC input ?
[Analog#Voltage], not working.
You better start your own topic with this question.

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

Posted: 08 Dec 2015, 18:06
by BertB
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?

Re: OLED I2C

Posted: 08 Dec 2015, 19:55
by costo
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?
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.

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

Posted: 10 Dec 2015, 17:05
by BertB
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]

Re: OLED I2C

Posted: 10 Dec 2015, 19:14
by Martinus
@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...

Re: OLED I2C

Posted: 10 Dec 2015, 23:12
by BertB
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.

Re: OLED I2C

Posted: 11 Dec 2015, 00:06
by costo
tparvais wrote:Hello
........
minor remark: special character éè ... are not working. WE can manage that.

However the ° of °centigrade would be nice to have :-)
If you want the centigrade/degree symbol you have to sacrifice another symbol for that.
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

Posted: 14 Dec 2015, 00:04
by fluppie
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 :).

Re: OLED I2C

Posted: 15 Dec 2015, 21:30
by hamster
2015-12-15 19.45.55.jpg
2015-12-15 19.45.55.jpg (116.98 KiB) Viewed 35657 times
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. :D

Re: OLED I2C

Posted: 15 Dec 2015, 22:39
by Backbone
You have a bi color Oled.
There are several version available.
http://www.ebay.nl/itm/5Pcs-0-96-Inch-4 ... SwYaFWb0Oi

Paco

Re: OLED I2C

Posted: 15 Dec 2015, 23:24
by costo
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. :D
There is a specific internal SSD1306 command to set the direction how the display draws its pixels.
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

Posted: 15 Dec 2015, 23:55
by hamster
thanks for the reply.. appreciated.. I can live with the yellow font on lines ..7 & 8 .. I think it looks cool.. :D

Re: OLED I2C

Posted: 17 Dec 2015, 23:44
by BertB
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;
}

Re: OLED I2C

Posted: 18 Dec 2015, 12:49
by mrb
@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.

Re: OLED I2C

Posted: 18 Dec 2015, 14:49
by BertB
Should not be too hard to built it too.

Re: OLED I2C

Posted: 20 Dec 2015, 10:18
by Martinus
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;
}
Maybe better to have an extra command like OLEDCMD?

then you would get

OLEDCMD,ON
OLEDCMD,OFF

Re: OLED I2C

Posted: 20 Dec 2015, 11:23
by BertB
That is even beter.

Re: OLED I2C

Posted: 19 Jan 2016, 09:38
by Mihadongle
Hallo from Austria
I will display my Thermostat from domoticz on the display
Is there any way to diplay the thermostat Temperature?
Best regard

Re: OLED I2C

Posted: 26 Jan 2016, 15:17
by miroslav.petrov
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

Re: OLED I2C

Posted: 26 Jan 2016, 16:23
by BertB
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.

Re: OLED I2C

Posted: 26 Jan 2016, 16:40
by miroslav.petrov
hm... Thank you it works now. But in the wiki, it says to connect just the 4 pins, why is that?

Re: OLED I2C

Posted: 26 Jan 2016, 17:31
by BertB
We will improve the wiki. Sorry for the confusion.

Re: OLED I2C

Posted: 21 Feb 2016, 00:24
by Drum
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

Posted: 21 Feb 2016, 11:54
by BertB
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.

Re: OLED I2C

Posted: 23 Feb 2016, 10:38
by cherowley
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.
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...

Re: OLED I2C

Posted: 23 Feb 2016, 15:28
by costo
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...
If you use a long USB cable and it has tiny wires you will have much loss in the cable.
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.