Page 1 of 1

Plugin 095 - TFT

Posted: 06 Oct 2020, 00:48
by Bastler1195
Hello,
is it possible to send commands via rules and output sensor values?

I managed to compile the system myself, plugin P_095 TFT was included. I've found the right connections and --cdt-- is displayed in position 1. Sending commands via http also works. Now I'm not getting any further. I have a temperature sensor and would like to output the value locally on the display. Thank you for your help! best regards HG

Re: Plugin 095 - TFT

Posted: 06 Oct 2020, 07:54
by iron

Re: Plugin 095 - TFT

Posted: 06 Oct 2020, 09:21
by Bastler1195
> Did you try any of this ? :

Yes. Thanks.
Of course i have read this reference. The commands also work if I use them e.g. send to my device with a browser. That's not my problem. The question is: How can I use the local commands? How do I get a local sensor value than on the display?

Thank you for your help. Best regards HG

Re: Plugin 095 - TFT

Posted: 06 Oct 2020, 13:16
by Ath
You can issue 'tft' commands from the rules, assuming you know what locations of the screen the values need to go you can just put them there from the 'on sensor#value do' event, using %eventvalue% or [sensor#value]

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 08:14
by Bastler1195
Very dear thanks!
Do it as the forum says - it works :-) I had already tried this and it didn't work. Maybe the command misspelled ... It works now.

The plugin is really "testing". Fonts are missing in the Mega Branch. I am currently trying to incorporate original Adafruit fonts with more or less success.
I noticed a problem: if the output sensor value changes in my test, the new value is written "above", i.e. it is not deleted beforehand. As a solution, I try to clear the entire display, but that is too slow and the display sequences are unsightly. I'll try to use the display on an Arduino with the original library and see if the effect is there too. I'll get back.
Until then, many thanks to everyone who helped me!
Best regards HG

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 09:52
by Ath
Bastler1195 wrote: 07 Oct 2020, 08:14 I noticed a problem: if the output sensor value changes in my test, the new value is written "above", i.e. it is not deleted beforehand. As a solution, I try to clear the entire display, but that is too slow and the display sequences are unsightly.
You can use the background color when updating a value, that'll properly overwrite the previous value (I had exactly the same issue ;))

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 10:20
by TD-er
Which fonts are missing in the repository?
And how are you building it? Using PlatformIO?

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 14:00
by Ath
The fonts are not included when LIMIT_BUILD_SIZE is defined, and that is defined for the TEST builds, the only build where this plugin is included, AFAICS...

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 14:38
by TD-er
So we should make a separate build for it?

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 17:37
by Bastler1195
Hello everybody,

OK, I was / am a bit confused. I'll try to summarize.

1. I bought the following display

https://www.amazon.de/gp/product/B081S6 ... UTF8&psc=1

2. I'm loading from github

https://github.com/letscontrolit/ESPEas ... a-20200929

- according to the clues I should use: ESPEasy_mega-xxxxxxxx_test_ESP8266_4M.bin

- (my NodeMCU has 4M Flash)

- i load: ESPEasy_ESP82xx_mega-20200929.zip

- but in this file I only find: ESP_Easy_mega_20200929_test_beta_ESP8266_4M1M.bin

- There is no TFT (P_095) device selectable if the file is loaded on the system

OK – no Problem..

- I load: Source code (zip) and open it on VisualStudioCode with Platformio, activate the plugin P_095 via Custom.h and compile it.

- in “_P095_ILI9341.ino” in lines 122 -126 only 3 fonts are included

- in “src/src/Static/Fonts” I can only find 2 font files (Seven_Segment[xx]pt7b.h)

- I'm trying to add more FreeFonts from https://rop.nl/truetype2gfx/

I'm not the great programmer, my knowledge is rather small - learn by doing…

Best regards HG

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 18:51
by Ath
Ah, currently, the P095 plugin only supports the 3 fonts that you already found, but has no provision for adding fonts easily. You are welcome to make a PR for that, of course. Please keep them in the same #ifdef for the current fonts, so they will be excluded for memory-challenged builds.

@TD-er, yes, having a specific 'display-oriented' build would be nice, also including P096 (eInk) and the, to-be-merged, P099 (touchscreen) plugins (and plugins for ST7735 tft and Nokia 5110 lcd I'm still working on).
It might be worth the effort to put some (more) energy into the user-defined build system, discussed before, then a special build wouldn't be needed.

Re: Plugin 095 - TFT

Posted: 07 Oct 2020, 23:25
by TD-er
That last line is clearly becoming more important by the day.

Re: Plugin 095 - TFT

Posted: 08 Oct 2020, 10:40
by iron
Something similar (if not identical) to this :

https://nodemcu-build.com/

Would be a definite plus to the ESPEasy

-D

Re: Plugin 095 - TFT

Posted: 08 Oct 2020, 21:25
by Ath
iron wrote: 08 Oct 2020, 10:40 Something similar (if not identical) to this :

https://nodemcu-build.com/

Would be a definite plus to the ESPEasy
That kind of 'developer-UI' is what I could have 'designed' :D :D :D
But it does give a suggestion for what would be usable :idea:

Re: Plugin 095 - TFT

Posted: 08 Oct 2020, 21:43
by TD-er
It is also very very similar to what I had in mind.

Re: Plugin 095 - TFT

Posted: 04 Feb 2021, 16:27
by Quart
Can anyone help sendning outputs to my screen.
I got the screen working.
But how do I put like a mqtt_import value on the screen ?

Re: Plugin 095 - TFT

Posted: 04 Feb 2021, 16:47
by Ath
You will have to use rules to draw lines, write text, etc. Read all about it in the Read the docs link: https://espeasy.readthedocs.io/en/lates ... /P095.html
These commands can also be sent from an external source using http url's.

Re: Plugin 095 - TFT

Posted: 04 Feb 2021, 18:21
by Quart
Ath wrote: 04 Feb 2021, 16:47 You will have to use rules to draw lines, write text, etc. Read all about it in the Read the docs link: https://espeasy.readthedocs.io/en/lates ... /P095.html
These commands can also be sent from an external source using http url's.
Thanks I will test it out.
But it looks to advanced for me.
Is there any plans easier display setting later on?
I have 3 or 4 Wemos with SSD1306 displayer and those can easy be changed from the GUI.

Re: Plugin 095 - TFT

Posted: 19 Feb 2024, 14:42
by Sminter4
Ath wrote: 07 Oct 2020, 18:51 Ah, currently, the P095 plugin only supports the 3 fonts that you already found, but has no provision for adding fonts easily. You are welcome to make a PR for that, of course. Please keep them in the same #ifdef for the current fonts, so they will be excluded for memory-challenged builds.

@TD-er, yes, having a specific 'display-oriented' build would be nice, also including P096 (eInk) and the, to-be-merged, P099 (touchscreen) plugins (and plugins for ST7735 tft and Nokia 5110 lcd I'm still working on).
It might be worth the effort to put some (more) energy into the user-defined build system, discussed before, then a special build wouldn't be needed.
Hello,
I would like to build a CO2 detector with an ST7735 (P116). Unfortunately, the ESP8266 version can currently only support one font.
How can I unlock the other 3 via a custom build?

Re: Plugin 095 - TFT

Posted: 19 Feb 2024, 20:10
by Ath
If all you need is a larger font, then you can just change the fontsize by using the commands, documented with f.e. the P116 plugin, and common to all AdafruitGFX_helper-based plugins (P095, P116, P131, P141), they usually have a different (and configurable) command trigger, to make it easier to use them side-by-side.

For building a custom ESPEasy build, there are instructions on the PlatformIO page. Start with the Prerequisites, and the instructions on building a Custom build, follow in the next paragraphs, including how to use git commands to get the latest sources.

For adding differernt fonts, you can have a look at these and also these defines, that have to be enabled in either your Custom.h, or added to the pre_custom_xxx.py file, to enable them. Don't add too many in an ESP8266 build, as that won't fit.
(In a still pending pull request there is a more fine-grained control over the fonts to be added, but that's not yet available)

Re: Plugin 095 - TFT

Posted: 22 Feb 2024, 13:21
by Sminter4
Thanks for your AW. The point about adjusting the files "AdafruitGFX_helper.." helped me. 👍

Allow me to ask one more question. I would like to show different world times on the display.

The function like %sunset-1h% doesn't seem to work with %systm_hm-1h%. Do you have a way for me to calculate other times from the current time?

Re: Plugin 095 - TFT

Posted: 22 Feb 2024, 13:39
by TD-er
On the sysvars page there are some conversion examples at the bottom.

For example %c_m2hcm%(482) (minutes to hh:mm)
You can use %syssec_d% to get the number of seconds of today (takes DST and timezone into account)

Code: Select all

let,1,%syssec_d%/60 // Convert to minutes
let,1,[int#1]+60    // Add +1 hour offset
let,1,[int#1]%1440  // Modulo 1440 minutes
logEntry,"current time +60m: %c_m2hcm%([int#1])"

Re: Plugin 095 - TFT

Posted: 24 Feb 2024, 22:32
by Sminter4
Thank you, that worked great! I wouldn't have come up with that on my own. Now I can continue with my project... 👌