OLED SDD1306 own info in header
Moderators: grovkillen, Stuntteam, TD-er
OLED SDD1306 own info in header
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
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
Re: OLED SDD1306 own info in header
Nice suggestion, though currently not possible. I'll see if that can be added.
/Ton (PayPal.me)
Re: OLED SDD1306 own info in header
How should it be set?
Using a command I assume?
Let's not add system wide variables specific to a plugin.
Using a command I assume?
Let's not add system wide variables specific to a plugin.
Re: OLED SDD1306 own info in header
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
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
Re: OLED SDD1306 own info in header
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 ?
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 (119.53 KiB) Viewed 3524 times
Re: OLED SDD1306 own info in header
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.
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)
Re: OLED SDD1306 own info in header
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
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
Re: OLED SDD1306 own info in header
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)
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)
Re: OLED SDD1306 own info in header
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)
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)
Re: OLED SDD1306 own info in header
Ok many thanks, I have Wemos d1 mini and at current I see for this platform firmware is not available "Normal ESP8266 ...."
Re: OLED SDD1306 own info in header
AFAICS, it's available:
The 4M1M builds should all run on a Wemos D1 mini board.
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)
Re: OLED SDD1306 own info in header
Thanks, I forgot about this 

Re: OLED SDD1306 own info in header
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
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
Re: OLED SDD1306 own info in header
I've spotted a copy/paste error, will fix later today, first some social obligations to attend to 

/Ton (PayPal.me)
Re: OLED SDD1306 own info in header
Ok, today is Sunday time for family and friends
have a nice weekend

Re: OLED SDD1306 own info in header
I've fixed a small typo to solve that, will be available soon from this GH Actions run
/Ton (PayPal.me)
Re: OLED SDD1306 own info in header
Hi,
Many thanks, now working very well User Def 1 and 2
Many thanks, now working very well User Def 1 and 2
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 17 guests