Page 1 of 1

TFT st7789 send http

Posted: 28 Apr 2023, 18:50
by marktn
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

Re: TFT st7789 send http

Posted: 28 Apr 2023, 19:17
by Ath
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)

Re: TFT st7789 send http

Posted: 28 Apr 2023, 20:44
by marktn
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.

Re: TFT st7789 send http

Posted: 28 Apr 2023, 21:08
by Ath
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).

Re: TFT st7789 send http

Posted: 28 Apr 2023, 21:25
by marktn
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.

Re: TFT st7789 send http

Posted: 28 Apr 2023, 22:04
by Ath
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.

Re: TFT st7789 send http

Posted: 29 Apr 2023, 11:36
by marktn
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

Re: TFT st7789 send http

Posted: 13 Sep 2023, 19:53
by marktn
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

Re: TFT st7789 send http

Posted: 13 Sep 2023, 20:38
by Ath
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...?

Re: TFT st7789 send http

Posted: 13 Sep 2023, 22:01
by marktn
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.

Re: TFT st7789 send http

Posted: 13 Sep 2023, 22:12
by Ath
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)

Re: TFT st7789 send http

Posted: 13 Sep 2023, 22:41
by marktn
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.