OLED Framed, Setting Text by Command or MQTT

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mcdroemmel
New user
Posts: 6
Joined: 11 Mar 2017, 10:41

OLED Framed, Setting Text by Command or MQTT

#1 Post by mcdroemmel » 22 Mar 2017, 09:50

Hello Folks,

i yesterday put an nodemcu and attached a rfid-reader (pn532) and an oled display (oled ssd1306) by i2c and configured the two devices in espeasy.
I used espeasy dev 2.0.0, dev7, test-plugins enabled.

I can read rfid-tags, send the Tag-Ids with MQTT to openhab. this works.
Openhab now verifies the rfid-Tags and sends an MQTT-Message to my nodemcu, telling it, which person the tag belongs to and what action the user takes (entering or leaving home).
The oled now shell display the name, timestamp and action (users enters or leaves the house) getting by MQTT.
Receiving this information also works,
So far so good.

For displaying the message i use the oled-framed plugin, because it uses larger fonts than the normal oled-plugin, so that the user can better read the information.
And the oled works fine with the configured fixed text-lines from the device-configuration in espeasy.

But when i send a text via HTTP-Command or MQTT-Command (or even with a command from the EspEasy Tool-Page), the text is put on the screen on the wrong destination, on the active scrolling page in small font. After next scrolling my text is gone and the oled is only showing the configured values again.

Because it is difficult to describe, i made a video and put it to youtube. For this test i send the command "http:/<ip>/control?cmd=OLED,2,ABCDEFGH" (where OLED is the device or task name in espeasy device config).
https://www.youtube.com/watch?v=50lw7iWnnIE

Any ideas?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: OLED Framed, Setting Text by Command or MQTT

#2 Post by toffel969 » 22 Mar 2017, 18:05

try to use a dummy. Set the dummy by MQTT/HTTP and then in the OLED plugin, display that dummy
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

mcdroemmel
New user
Posts: 6
Joined: 11 Mar 2017, 10:41

Re: OLED Framed, Setting Text by Command or MQTT

#3 Post by mcdroemmel » 24 Mar 2017, 08:11

Hello toffel969,

Thanks for that hint. That could work. But i didnt find the commands to set a value for a dummy device. do you have a hint for this?

I made a little bit research and found out in coding, that the oled-framed plugin does not support commands for setting the text directly (in build 2.0.0-dev7).
In PlugInPlayground there is a new version of the plugin, which has commands supporting to set text by commands. Unfortunatly copying the code do the 2.0.0-dev7 source results in an compile error.
MQTTImport could be the solution but is at lease not an option because it only supports numerical values and i want to set texts (such as Welcome <name>, or Good By <name>, after rfid-identification of the person).

So maybe using the dummy-device could be a solution if it is possible to set text values by using commands send by mqtt. But i don't now the commands so far. I addtionaly will have a look in the coding of the dummy-device.

regards
McD

starfish
Normal user
Posts: 46
Joined: 16 Feb 2017, 23:46

Re: OLED Framed, Setting Text by Command or MQTT

#4 Post by starfish » 15 May 2017, 20:45

as far as I understood in espeasy mega the framed oled mqtt (and html) cmd function is deactivated. Apparently there is a flash memory lifetime problem when sending text updates too often. I am still using version R148 with updates every 30 minutes since 5 months now and the flash is still alive. Version R148 works as expected. But I also found that giving the device a name "oled" produces the problem you described : small characters at the wrong place - appending the text after the header line. Simply change the device name to something else.
Maybe that helps.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: OLED Framed, Setting Text by Command or MQTT

#5 Post by Shardan » 15 May 2017, 20:56

starfish wrote: 15 May 2017, 20:45 as far as I understood in espeasy mega the framed oled mqtt (and html) cmd function is deactivated. Apparently there is a flash memory lifetime problem when sending text updates too often. I am still using version R148 with updates every 30 minutes since 5 months now and the flash is still alive. Version R148 works as expected. But I also found that giving the device a name "oled" produces the problem you described : small characters at the wrong place - appending the text after the header line. Simply change the device name to something else.
Maybe that helps.
This is correct.
The original "framed OLED" wrote every data set received into flash. According to the datasheets
the flash chip has a somewhat limited number of write cycles so this will wear out the flash chip.
Due to this reason it was disabled until a dev takes the time to get it back running without flash storing.

Regards
Shardan
Regards
Shardan

starfish
Normal user
Posts: 46
Joined: 16 Feb 2017, 23:46

Re: OLED Framed, Setting Text by Command or MQTT

#6 Post by starfish » 16 May 2017, 13:25

@Shardan - maybe there exist better flash chips than these crap chinese ones? at least replacing them on the pcb is possible, I did it already on an old ESP-01 and some sonoff devices to increase memory size. The basic OLED device in espeasy displays way too small characters otherwise I wouldn´t stick to the framed version. I mean scrolling looks nice but thats not the reason I am using this plugin.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: OLED Framed, Setting Text by Command or MQTT

#7 Post by Shardan » 16 May 2017, 13:46

Sure there are quality differences between these chips - as there are price differences :)

Anyways: Every flash wears out sooner or later, even on SD-Cards or SSD's.
SSD's use a special algorithm called "wear leveling" to spread write access
equally over all cells to avoid writing some areas again and again.
(Which says the ssd flash lasts longer and then all cells fail at same time :) )
SD-Cards... i've already ruined two SD-Cards with my FHEM Raspberry and now
use a USB stick for the massively written parts like logfiles and configs.
USB sticks use flash too, i know.. but they are easier to change ;)
Regards
Shardan

starfish
Normal user
Posts: 46
Joined: 16 Feb 2017, 23:46

Re: OLED Framed, Setting Text by Command or MQTT

#8 Post by starfish » 16 May 2017, 21:37

yes I know about wear leveling - and read different articles concerning lifetime with very different results ... (ssd) so the solution would be pluggable flash chips on esp - modules :lol:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest