TFT st7789 send http

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

TFT st7789 send http

#1 Post by marktn » 28 Apr 2023, 18:50

Hi,

This is working,
http://192.168.1.82/control?cmd=st7789cmd,on
http://192.168.1.82/control?cmd=st7789cmd,off
http://192.168.1.82/control?cmd=st7789cmd,clear


But this is not working? I did read the wiki, but can't find the answer...
http://192.168.1.82/control?cmd=st7789cmd,txt,test

I Want to send text to the tft screen

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

Re: TFT st7789 send http

#2 Post by Ath » 28 Apr 2023, 19:17

Close but no cigar ;)

For the 'regular' commands, provided via the AdafruitGFX_Helper extension, the commands are not postfixed with cmd, so the command to display text on the display would be st7789,txt,text or st7789,txt,"text containing spaces, and/or commas".
You might consider using st7789,txz,x,y,"test to display at a specific position", where you have fine control over the exact position the text is displayed.

Full command documentation for the ST77xx plugin is found here (you can scroll up for the complete plugin documentation)
/Ton (PayPal.me)

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: TFT st7789 send http

#3 Post by marktn » 28 Apr 2023, 20:44

Ath wrote: 28 Apr 2023, 19:17 Close but no cigar ;)

For the 'regular' commands, provided via the AdafruitGFX_Helper extension, the commands are not postfixed with cmd, so the command to display text on the display would be st7789,txt,text or st7789,txt,"text containing spaces, and/or commas".
You might consider using st7789,txz,x,y,"test to display at a specific position", where you have fine control over the exact position the text is displayed.

Full command documentation for the ST77xx plugin is found here (you can scroll up for the complete plugin documentation)
Thanks!! That worked.

192.168.1.82/control?cmd=st7789,txl,3,"TEST TEXT"

Is it also possible to make the background of a txl in the color red? I see color settings, but how to use it in a line.

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

Re: TFT st7789 send http

#4 Post by Ath » 28 Apr 2023, 21:08

marktn wrote: 28 Apr 2023, 20:44 Is it also possible to make the background of a txl in the color red? I see color settings, but how to use it in a line.
Have a look at the txtfull command that has a lot of parameters including foreground and background colors, or the txc command that allows to change the standard colors (foreground and background).
/Ton (PayPal.me)

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: TFT st7789 send http

#5 Post by marktn » 28 Apr 2023, 21:25

Ath wrote: 28 Apr 2023, 21:08
marktn wrote: 28 Apr 2023, 20:44 Is it also possible to make the background of a txl in the color red? I see color settings, but how to use it in a line.
Have a look at the txtfull command that has a lot of parameters including foreground and background colors, or the txc command that allows to change the standard colors (foreground and background).
I have seen that, but i can get it in a line, txl
It looks like it is only possible with pixel position, not in a line height.

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

Re: TFT st7789 send http

#6 Post by Ath » 28 Apr 2023, 22:04

marktn wrote: 28 Apr 2023, 21:25 I have seen that, but i can get it in a line, txl
It looks like it is only possible with pixel position, not in a line height.
That depends on the 'Text Coordinates in col/row' setting in the Device Configuration page, txl always uses the row/col setting, instead of pixels, by design.

Edit:
txl was added on request for P141 Nokia 5110 display, so send the (few only) lines that can be displayed on that display.
You can send a txc command, setting the desired color, then the txl command to display the text, and restore the colors using a new txc command. That can not be combined in a single command.
/Ton (PayPal.me)

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: TFT st7789 send http

#7 Post by marktn » 29 Apr 2023, 11:36

Thanks for your support! It is working.

I have another question for the TFT st7789, i will make a new topic for that.
viewtopic.php?t=9631

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: TFT st7789 send http

#8 Post by marktn » 13 Sep 2023, 19:53

Hi,

192.168.1.xx/control?cmd=st7789,txtfull,1,5,3,<foreColor=current>,blue, <textPrintMode=current>,<maxTextWidthPixels=0>," Tekst "
With this http rule i have backgroud color, and text. Works fine.

Is there also a rule to clear this rule with text and colour? Not the complete screen.

Mark

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

Re: TFT st7789 send http

#9 Post by Ath » 13 Sep 2023, 20:38

marktn wrote: 13 Sep 2023, 19:53 Is there also a rule to clear this rule with text and colour? Not the complete screen.
Instead of the text you could write a series of spaces...?
/Ton (PayPal.me)

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: TFT st7789 send http

#10 Post by marktn » 13 Sep 2023, 22:01

Ath wrote: 13 Sep 2023, 20:38
marktn wrote: 13 Sep 2023, 19:53 Is there also a rule to clear this rule with text and colour? Not the complete screen.
Instead of the text you could write a series of spaces...?
That is possible. But then will not remove the color. And there is no color that is the same as the screen is.

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

Re: TFT st7789 send http

#11 Post by Ath » 13 Sep 2023, 22:12

marktn wrote: 13 Sep 2023, 22:01 That is possible. But then will not remove the color. And there is no color that is the same as the screen is.
Normally, using the same background color as the foreground color, it should result in 'transparent', though I haven't tested that using spaces. The default background color is black (you can use color names, as documented)
/Ton (PayPal.me)

marktn
Normal user
Posts: 62
Joined: 06 Nov 2015, 19:43

Re: TFT st7789 send http

#12 Post by marktn » 13 Sep 2023, 22:41

Ath wrote: 13 Sep 2023, 22:12
marktn wrote: 13 Sep 2023, 22:01 That is possible. But then will not remove the color. And there is no color that is the same as the screen is.
Normally, using the same background color as the foreground color, it should result in 'transparent', though I haven't tested that using spaces. The default background color is black (you can use color names, as documented)
I did test that. But black is white. It looks like that the colors do not match the colors in the http rule.
The background is black.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 34 guests