OLED SDD1306 own info in header

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

OLED SDD1306 own info in header

#1 Post by RayPath » 01 May 2023, 10:40

Hi,

Is it possible to add to the OLED Framed SSD1306 the ability to display in the "header" its own value of a variable such as %USER1%.
I would like to display IP address of remote device instead of system %ip% ip address. This IP address is sent via MQTT

Regards

Waldek

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#2 Post by Ath » 01 May 2023, 10:55

Nice suggestion, though currently not possible. I'll see if that can be added.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8755
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: OLED SDD1306 own info in header

#3 Post by TD-er » 01 May 2023, 10:57

How should it be set?
Using a command I assume?

Let's not add system wide variables specific to a plugin.

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#4 Post by RayPath » 05 May 2023, 08:56

In the code :

https://github.com/letscontrolit/ESPEas ... D.ino#L375

here are defined system variables that can be displayed in the header where you should add for example USER1 or more USER2 etc.
In rules, I have got IP address of external device which I am monitoring, and I would like to know its IP on this display

On MQTT#IP=* Do
..... %eventvalue1%
Endon

I understand that there is a problem how to assign %eventvalue1% to %USER1% so that the code in OLED can display this in the header?
If it were possible, it would be very useful to use the header to show your important information.

Regards

Waldek

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#5 Post by RayPath » 11 May 2023, 18:40

Since we sometimes use power on 3.7V batteries for Wemos D1 Mini it would be very useful to be able to display the status of
the battery voltage whether in the form of a value such as 3.4V or an icon in the header as shown on the example OLEDs

Maybe it would be useful to introduce, similar to the system variables, a second type of user variables of the type

UserVar1, UserV2

Or is it possible to display the battery status in the OLED header and I don't know how to do it ?
Attachments
oled.png
oled.png (119.53 KiB) Viewed 1678 times

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#6 Post by Ath » 11 May 2023, 22:21

Battery level isn't regularly available as a variable, as only the (ESP8266) VCC builds can use the analog GPIO pin to measure the voltage, but usually that's just the regulated VCC of ~3.3V to the CPU, not a battery input. To get a real measurement you would have to use another analog input sensor like an ADS1115 or similar.

It would be nice to have a symbol like a battery gauge to show that level, but it is a rather rough indicator, though that may be good enough. Not sure how much effort, and code, that would take. I'll try to implement your initial idea first, but no ETA yet.
/Ton (PayPal.me)

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#7 Post by RayPath » 12 May 2023, 17:32

Thank you for your reply

I use Wemos D1 Mini with Battery shield where I can connect + Battery via 100 kOm resistor to A0 and I read on forum that I can get battery level with use firmware "*_normal_*" where I need add "Analog input - internal". So I suppose I can get level voltage of battery 18650, and I can try display value or percentage in header if it will exist possible display UserVar variables on which I wrote in my first post.

So if you manage to add such functionality to set UserVar1, UservVar2 etc, which could be displayed in the OLED header, it gives great opportunities to display your own data, for example, the value of 18650 battery level (not as graphic bar but as value" for exmaple BL:45% or BL:3.6V) or the IP address of a remote device. Having "header" and "header alternative" options, it will be possible to display two different types of custom data :-)
I would be very grateful for the implementation of this solution, of course, if it is possible

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#8 Post by Ath » 30 Jun 2023, 22:40

I've created PR #4722 to implement this feature. Check out this Actions Run for testing.

Please report any feedback here or (preferrably) in the PR.

(Edit: Removed link to failed GH Actions run)
Last edited by Ath on 01 Jul 2023, 11:22, edited 1 time in total.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#9 Post by Ath » 01 Jul 2023, 11:21

Previous GH Actions run failed because of networking reasons, so not all binaries were available.
Did some code improvements, and started a fresh build in this GH Actions run.

(Edit: Removed link as the code contained a small error, see below)
Last edited by Ath on 02 Jul 2023, 13:15, edited 2 times in total.
/Ton (PayPal.me)

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#10 Post by RayPath » 01 Jul 2023, 19:53

Ok many thanks, I have Wemos d1 mini and at current I see for this platform firmware is not available "Normal ESP8266 ...."

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#11 Post by Ath » 01 Jul 2023, 22:11

AFAICS, it's available:
Screenshot - 01-07-2023 , 22_06_19.png
Screenshot - 01-07-2023 , 22_06_19.png (13.55 KiB) Viewed 1524 times
You'll need to download artifact 'ESPEasy_mega_20230701_ESP82xx_PR#4722_nnnn', that includes ESP8266 builds (ESP8266 binaries also run on ESP8285, but those only have 1MB of flash available).
The 4M1M builds should all run on a Wemos D1 mini board.
Last edited by Ath on 02 Jul 2023, 13:16, edited 2 times in total.
/Ton (PayPal.me)

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#12 Post by RayPath » 02 Jul 2023, 09:12

Thanks, I forgot about this :-)

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#13 Post by RayPath » 02 Jul 2023, 09:59

Ok I tested thi firmware on my Wemos D1 min.

I setup OLED

Header: User defined 1
Header (alternative): User defined 2

and

Interval: 5 sec

I used http send command

curl -s "http://192.168.1.42/control?cmd=oledfra ... Def1,Test1"
curl -s "http://192.168.1.42/control?cmd=oledfra ... Def2,Test2"

Only display "Test1" not display "Test2" in log show that

HTTP:oldeframedcmd,userDef1,Test1
HTTP:oldeframedcmd,userDef2,Test2

I try change

Header: User defined 2
Header (alternative): User defined 1

but never display "Test2" which was send with userDef2

only display userDef1

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#14 Post by Ath » 02 Jul 2023, 10:18

I've spotted a copy/paste error, will fix later today, first some social obligations to attend to ;)
/Ton (PayPal.me)

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#15 Post by RayPath » 02 Jul 2023, 10:39

Ok, today is Sunday time for family and friends :-) have a nice weekend

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#16 Post by Ath » 02 Jul 2023, 13:13

RayPath wrote: 02 Jul 2023, 09:59 but never display "Test2" which was send with userDef2

only display userDef1
I've fixed a small typo to solve that, will be available soon from this GH Actions run
/Ton (PayPal.me)

RayPath
Normal user
Posts: 14
Joined: 01 May 2023, 10:33

Re: OLED SDD1306 own info in header

#17 Post by RayPath » 02 Jul 2023, 15:40

Hi,

Many thanks, now working very well User Def 1 and 2

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: OLED SDD1306 own info in header

#18 Post by Ath » 02 Jul 2023, 16:37

Great :D
Thanks for the quick feedback ;)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 87 guests