Plugin 095 - TFT

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Bastler1195
New user
Posts: 7
Joined: 08 Dec 2018, 13:20
Location: Berlin, Germany

Plugin 095 - TFT

#1 Post by Bastler1195 » 06 Oct 2020, 00:48

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

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Plugin 095 - TFT

#2 Post by iron » 06 Oct 2020, 07:54

-D

Bastler1195
New user
Posts: 7
Joined: 08 Dec 2018, 13:20
Location: Berlin, Germany

Re: Plugin 095 - TFT

#3 Post by Bastler1195 » 06 Oct 2020, 09:21

> 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

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

Re: Plugin 095 - TFT

#4 Post by Ath » 06 Oct 2020, 13:16

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]
/Ton (PayPal.me)

Bastler1195
New user
Posts: 7
Joined: 08 Dec 2018, 13:20
Location: Berlin, Germany

Re: Plugin 095 - TFT

#5 Post by Bastler1195 » 07 Oct 2020, 08:14

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

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

Re: Plugin 095 - TFT

#6 Post by Ath » 07 Oct 2020, 09:52

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 ;))
/Ton (PayPal.me)

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

Re: Plugin 095 - TFT

#7 Post by TD-er » 07 Oct 2020, 10:20

Which fonts are missing in the repository?
And how are you building it? Using PlatformIO?

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

Re: Plugin 095 - TFT

#8 Post by Ath » 07 Oct 2020, 14:00

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...
/Ton (PayPal.me)

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

Re: Plugin 095 - TFT

#9 Post by TD-er » 07 Oct 2020, 14:38

So we should make a separate build for it?

Bastler1195
New user
Posts: 7
Joined: 08 Dec 2018, 13:20
Location: Berlin, Germany

Re: Plugin 095 - TFT

#10 Post by Bastler1195 » 07 Oct 2020, 17:37

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

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

Re: Plugin 095 - TFT

#11 Post by Ath » 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.
/Ton (PayPal.me)

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

Re: Plugin 095 - TFT

#12 Post by TD-er » 07 Oct 2020, 23:25

That last line is clearly becoming more important by the day.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Plugin 095 - TFT

#13 Post by iron » 08 Oct 2020, 10:40

Something similar (if not identical) to this :

https://nodemcu-build.com/

Would be a definite plus to the ESPEasy

-D
-D

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

Re: Plugin 095 - TFT

#14 Post by Ath » 08 Oct 2020, 21:25

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:
/Ton (PayPal.me)

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

Re: Plugin 095 - TFT

#15 Post by TD-er » 08 Oct 2020, 21:43

It is also very very similar to what I had in mind.

Quart
Normal user
Posts: 45
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: Plugin 095 - TFT

#16 Post by Quart » 04 Feb 2021, 16:27

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 ?

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

Re: Plugin 095 - TFT

#17 Post by Ath » 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.
/Ton (PayPal.me)

Quart
Normal user
Posts: 45
Joined: 16 Jul 2019, 10:08
Location: Sweden
Contact:

Re: Plugin 095 - TFT

#18 Post by Quart » 04 Feb 2021, 18:21

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.

Sminter4
Normal user
Posts: 18
Joined: 04 Aug 2021, 23:25

Re: Plugin 095 - TFT

#19 Post by Sminter4 » 19 Feb 2024, 14:42

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?

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

Re: Plugin 095 - TFT

#20 Post by Ath » 19 Feb 2024, 20:10

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)
/Ton (PayPal.me)

Sminter4
Normal user
Posts: 18
Joined: 04 Aug 2021, 23:25

Re: Plugin 095 - TFT

#21 Post by Sminter4 » 22 Feb 2024, 13:21

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?

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

Re: Plugin 095 - TFT

#22 Post by TD-er » 22 Feb 2024, 13:39

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])"

Sminter4
Normal user
Posts: 18
Joined: 04 Aug 2021, 23:25

Re: Plugin 095 - TFT

#23 Post by Sminter4 » 24 Feb 2024, 22:32

Thank you, that worked great! I wouldn't have come up with that on my own. Now I can continue with my project... 👌

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests