Oled display does not change

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
trumee
Normal user
Posts: 19
Joined: 01 Sep 2017, 02:22

Oled display does not change

#1 Post by trumee » 29 Jul 2018, 02:53

Hello,

I have this OLED display which is called 0.91 inch 12832 oled. I would like to show an MQTT state and have the following devices,

Image

The MQTT variable is working correctly. The OLED is setup as follows:
Image

with a rule,

Code: Select all

on motor#ONOFFSTATE do

  if [motor#ONOFFSTATE]>0
     OLED,1,1,Motor ON
  else
     OLED,1,1,Motor OFF
  endif
OLEDCMD, clear
OLEDCMD, on
 endon
When ESP is turned on it displays "Motor Off". When the motor#ONOFFSTATE changes to 1, the display is not updated. How can i get the display to update on variable value change?

The log shows that the motor#ONOFFSTATE is indeed changing:

Code: Select all

620655: ACT : OLED,1,1,Motor OFF
620702: ACT : OLEDCMD, clear
620705: ACT : OLEDCMD, on
623038: IMPT : [motor#ONOFFSTATE] : 0.00
623039: EVENT: motor#ONOFFSTATE=0.00
623054: ACT : OLED,1,1,Motor OFF
623077: ACT : OLEDCMD, clear
623080: ACT : OLEDCMD, on
625839: IMPT : [motor#ONOFFSTATE] : 1.00
625840: EVENT: motor#ONOFFSTATE=1.00
625855: ACT : OLED,1,1,Motor OFF
625877: ACT : OLEDCMD, clear
625879: ACT : OLEDCMD, on
The device is running GIT version mega-20180723, binary ESP_Easy_mega-20180723_normal_ESP8266_4096.bin

trumee
Normal user
Posts: 19
Joined: 01 Sep 2017, 02:22

Re: Oled display does not change

#2 Post by trumee » 29 Jul 2018, 04:10

I have some improvement on this. With the following rule:

on motor#ONOFFSTATE do

Code: Select all

  if [motor#ONOFFSTATE]>0
     OLED,3,1,Motor ON
  else
     OLED,3,1,Motor OFF
  endif
endon
the "Motor ON" and "Motor OFF" messages on OLED do follow the MQTT message. However, there are two problems:

1. The "ESP Easy" message stays put and is not cleared.
2. The screen times out after some time, after which the messages are no longer showed even when MQTT message is shown. I suspect this is related to "Display Timeout" and "Interval". I want the screen not to go blank since i am doing testing but "Display Timeout of 0" doesnt help.

trumee
Normal user
Posts: 19
Joined: 01 Sep 2017, 02:22

Re: Oled display does not change

#3 Post by trumee » 29 Jul 2018, 04:24

After setting Pin mode 16 (D0) to "Output high", the issues seems to have gone away.

The following works,

Code: Select all

On System#Boot do    //When the ESP boots, do
OLEDCMD,clear
endon

on motor#ONOFFSTATE do
OLEDCMD,on
  if [motor#ONOFFSTATE]>0
     OLED,1,1,Motor ON
  else
     OLED,1,1,Motor OFF
  endif
endon

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest