which built for tft display ST7789
Moderators: grovkillen, Stuntteam, TD-er
which built for tft display ST7789
Hi, I've read old threats about the use of a tft 1.54 display ST7789. These are for me a bit difficult to understand.
Is there a pre-flashed built which can be used to 'control' this tft screen?
Thanks, Bart
Is there a pre-flashed built which can be used to 'control' this tft screen?
Thanks, Bart
Re: which built for tft display ST7789
thanks Ad, just founf it in DISPLAY built.
Has MAX advantages?
Has MAX advantages?
Re: which built for tft display ST7789
MAX requires an ESP32 with 8 or 16 MB Flash, and includes all plugins (supported by ESP32) and has nearly all features enabled (only a few large fonts are excluded for use with the displays)
/Ton (PayPal.me)
Re: which built for tft display ST7789
I I used built: ESP_Easy_mega_20240822_display_ESP8266_4M1M Aug 22 2024
Display is 1.54tft-SPI-ST7789
display has next connections:
Gnd connected on esp gnd >> this is OK
Vcc 3V3 >> this is OK
SCL CLK D5 (as mentioned per spi-interface)
SDA MOSI D7 (as mentioned per spi-interface)
RST not used
DC ???
CS ???
BL backlight D4 >> this is OK
SPI has been enabled in hardware settings
As SPI needs at least 3 wires I got stuck now
Do I also have to do other settings in hardware part
and what's MISO
data from spi-interface
Note: CLK=GPIO-14 (D5), MISO=GPIO-12 (D6), MOSI=GPIO-13 (D7)
Note: Chip Select (CS) config must be done in the plugin
any help (as usual )appreciated
Display is 1.54tft-SPI-ST7789
display has next connections:
Gnd connected on esp gnd >> this is OK
Vcc 3V3 >> this is OK
SCL CLK D5 (as mentioned per spi-interface)
SDA MOSI D7 (as mentioned per spi-interface)
RST not used
DC ???
CS ???
BL backlight D4 >> this is OK
SPI has been enabled in hardware settings
As SPI needs at least 3 wires I got stuck now
Do I also have to do other settings in hardware part
and what's MISO
data from spi-interface
Note: CLK=GPIO-14 (D5), MISO=GPIO-12 (D6), MOSI=GPIO-13 (D7)
Note: Chip Select (CS) config must be done in the plugin
any help (as usual )appreciated
- Attachments
-
- forum2.jpg (23.81 KiB) Viewed 3848 times
-
- forum1.jpg (86 KiB) Viewed 3848 times
Re: which built for tft display ST7789
You also have to select an available GPIO for the CS and DC connections for the display in the Device configuration (and connect those to the display, of course).
DC = Data/Command, to select the data or command mode when controlling the display.
You can also, optionally, select a GPIO for RES (Reset) and connect that to the RST (Reset) pin of the display.
When not using the CS connection in configuration (it's optional), you must connect the display-CS pin to GND, but you won't be able to parallel-connect other SPI devices, as the display will always be selected. Best is to configure and connect CS.
The Backlight percentage can probably be lowered a bit (start with 50% and adjust as needed), to reduce display brightness and power use.
The display button should be configured and connected when configuring the Display time-out, as after this time in seconds the display will be turned off, and can be re-enabled via the button. You can also use an IR-sensor to turn the display back on when you approach the device.
MOSI = Master Out Slave In (sends the data from ESP to display, as the ESP is the SPI master, and the display is the slave)
MISO = Master In Slave Out (not used for most displays, but can be used for a Touch panel and/or SD-card reader, when mounted on the display)
Unfortunately you can't use the MISO pin for another purpose when connecting the display, it might interfere when something else is using that pin.
You have set the background color the same as the foreground color, but that'll just make the background transparent, causing previous text/images to be visible when data is drawn. 99% of the time, that's not what you'll want. (Though you could use it to put text/lines on a pre-loaded image bitmap.)
DC = Data/Command, to select the data or command mode when controlling the display.
You can also, optionally, select a GPIO for RES (Reset) and connect that to the RST (Reset) pin of the display.
When not using the CS connection in configuration (it's optional), you must connect the display-CS pin to GND, but you won't be able to parallel-connect other SPI devices, as the display will always be selected. Best is to configure and connect CS.
The Backlight percentage can probably be lowered a bit (start with 50% and adjust as needed), to reduce display brightness and power use.
The display button should be configured and connected when configuring the Display time-out, as after this time in seconds the display will be turned off, and can be re-enabled via the button. You can also use an IR-sensor to turn the display back on when you approach the device.
MOSI = Master Out Slave In (sends the data from ESP to display, as the ESP is the SPI master, and the display is the slave)
MISO = Master In Slave Out (not used for most displays, but can be used for a Touch panel and/or SD-card reader, when mounted on the display)
Unfortunately you can't use the MISO pin for another purpose when connecting the display, it might interfere when something else is using that pin.
You have set the background color the same as the foreground color, but that'll just make the background transparent, causing previous text/images to be visible when data is drawn. 99% of the time, that's not what you'll want. (Though you could use it to put text/lines on a pre-loaded image bitmap.)
/Ton (PayPal.me)
Re: which built for tft display ST7789
Ton,
I updated according your advice but no luck. What might be wrong. Hereunder the settings I did.
BTW, I noticed the LED at the ESP keeps on.
Once I start the log I see something new (although for me).
The log starts with the info of all other ESP's which are online. Hardwaresettings: I only activated the SPI, no more further settings
Then the tasks settings: TFT reset I did not connect.
Sometimrs the ESP don't startup. It does after I disconnect the backlight. So not a big deal, this can be fixed in the rules.
I can see backlight is on but nothing to see on the display. Any suggestion?
Bart
I updated according your advice but no luck. What might be wrong. Hereunder the settings I did.
BTW, I noticed the LED at the ESP keeps on.
Once I start the log I see something new (although for me).
The log starts with the info of all other ESP's which are online. Hardwaresettings: I only activated the SPI, no more further settings
Then the tasks settings: TFT reset I did not connect.
Sometimrs the ESP don't startup. It does after I disconnect the backlight. So not a big deal, this can be fixed in the rules.
I can see backlight is on but nothing to see on the display. Any suggestion?
Bart
Re: which built for tft display ST7789
GPIO-2 on an ESP8266 does need to be in a specific state, or else the ESP will not boot.
That's why there is a warning symbol next to the GPIO description.
See: https://espeasy.readthedocs.io/en/lates ... on-esp8266
That's why there is a warning symbol next to the GPIO description.
See: https://espeasy.readthedocs.io/en/lates ... on-esp8266
Re: which built for tft display ST7789
That's a new feature, introduced a few months ago, so you can detect from rules if a specific ESP is available in the P2P network.
I've started an ESP8266 with exactly the display you configured, but I have my GPIOs set a bit differently. And disabled I2C (both GPIOs set to -none-) to use those pins for the display like this:
This works as intended.
Wiring can be a bit tricky, bad connections can easily cause it not to work at all.
/Ton (PayPal.me)
Re: which built for tft display ST7789
nope....
I noticed after reboot a load of 99.61 after a while it drops down to 3.53
to be sure:
- should the tekst appear on the display after a reboot without doing else?
- you wired all 8 connections of the display towards ESP?
- nothing else set in hardware others then setting the I2C to none?
- in this config the LED at ESP is off
to be sure no bad connections I pulled the esp from it's socket and used for the 8 connections new wires with dupont connectors
I noticed after reboot a load of 99.61 after a while it drops down to 3.53
to be sure:
- should the tekst appear on the display after a reboot without doing else?
- you wired all 8 connections of the display towards ESP?
- nothing else set in hardware others then setting the I2C to none?
- in this config the LED at ESP is off
to be sure no bad connections I pulled the esp from it's socket and used for the 8 connections new wires with dupont connectors
Re: which built for tft display ST7789
After startup the load is usually quite high for a couple of seconds (up to a minute, usually), that's normal.
Text should display on startup if the plugin is enabled. You can re-display it either by setting an Interval > 0 or sending a "taskrun,test" command (the task is named test in your screenshot)
Yes, I wired all 8 pins of the display to the ESP.
The display VCC should be connected to 3.3V, not to 5V!
I2C GPIOs have to be freed (disabled) so you can select them for use in a plugin.
The LED on many ESP8266 boards (at least the Wemos D1 mini clones) is wired to GPIO-2 (D4), but I don't have that configured, so it shouldn't light up now. You had that configured to (also) be used for the backlight, and as the plugin uses PWM to enable that backlight to 20%, the LED would also light up
NB: I've assumed your display is actually a ST7789 with 240x240 resolution, as you've set that in the configuration. Is that the actual chip and display resolution? Different chips and resolutions require different initialization so setting that incorrect may cause it not to work.
Text should display on startup if the plugin is enabled. You can re-display it either by setting an Interval > 0 or sending a "taskrun,test" command (the task is named test in your screenshot)
Yes, I wired all 8 pins of the display to the ESP.
The display VCC should be connected to 3.3V, not to 5V!
I2C GPIOs have to be freed (disabled) so you can select them for use in a plugin.
The LED on many ESP8266 boards (at least the Wemos D1 mini clones) is wired to GPIO-2 (D4), but I don't have that configured, so it shouldn't light up now. You had that configured to (also) be used for the backlight, and as the plugin uses PWM to enable that backlight to 20%, the LED would also light up
NB: I've assumed your display is actually a ST7789 with 240x240 resolution, as you've set that in the configuration. Is that the actual chip and display resolution? Different chips and resolutions require different initialization so setting that incorrect may cause it not to work.
/Ton (PayPal.me)
Re: which built for tft display ST7789
thanks Ton. Yes it's ST7789.
I will order some more to exclude the possibility that J damaged thecTFT while tryjng marters
I will order some more to exclude the possibility that J damaged thecTFT while tryjng marters
Re: which built for tft display ST7789
Hm, I've not been very careful with the displays I tested, so they seem quite robust, but it's electronics, so it can be easily damaged.
/Ton (PayPal.me)
Re: which built for tft display ST7789
Also with this winter-weather we're having now, you might get more static charges on your body.
So it isn't unthinkable things may have been zapped.
So it isn't unthinkable things may have been zapped.
Re: which built for tft display ST7789
continuing story...
took another nodemcu and did a fresh flash.
did all the hardware and tasksettings as adviced latest
connected the 8 wires as per photo's.
During boot of esp only a short flash on display but nothing on the display
i ordered 3 new ones. just to confirm wiring is ok I added the photo's not brilliant but fit for use I would say... for info about flashed firmware
took another nodemcu and did a fresh flash.
did all the hardware and tasksettings as adviced latest
connected the 8 wires as per photo's.
During boot of esp only a short flash on display but nothing on the display
i ordered 3 new ones. just to confirm wiring is ok I added the photo's not brilliant but fit for use I would say... for info about flashed firmware
Last edited by BartSr on 22 Nov 2024, 15:49, edited 3 times in total.
Re: which built for tft display ST7789
The VCC connection on the ESP side, (red wire) is that on 3.3V or 5V? As it should be 3.3V. (maybe the pin next to D4?)
/Ton (PayPal.me)
Re: which built for tft display ST7789
on the device it says 3.3V
To be sure I redid voltage next to D4
same result
Is it normal that pin state buffer only displays built data?
To be sure I redid voltage next to D4
same result
Is it normal that pin state buffer only displays built data?
Re: which built for tft display ST7789
UPDATE:
Today new displays arrived
Connected it same as former display : nothing differs
Now I tried just some settings.
Although the displays says ST7789 I tried ST7796
a miracle happened: the displays shows the text. but...... it's mirrored
Also the selected foreground and backgroundcolor did not match
But as the displays shows something I'm optimistic
Is there a suggestion how to proceed?
-Bart
Today new displays arrived
Connected it same as former display : nothing differs
Now I tried just some settings.
Although the displays says ST7789 I tried ST7796
a miracle happened: the displays shows the text. but...... it's mirrored
Also the selected foreground and backgroundcolor did not match
But as the displays shows something I'm optimistic
Is there a suggestion how to proceed?
-Bart
Re: which built for tft display ST7789
Can you provide a link to the exact display(s) you ordered? Maybe there's something specific to them.
You can also try P095 (the ILI9xxx displays), as these displays all are quite closely related.
You can also try P095 (the ILI9xxx displays), as these displays all are quite closely related.
/Ton (PayPal.me)
Re: which built for tft display ST7789
middle right is the bought on
just search on ali for st7789 and this pops up
which gpio do you advice while using esp32-wroom-1
- Attachments
-
- Screenshot_20241202_225706_AliExpress.jpg (840.17 KiB) Viewed 2527 times
Re: which built for tft display ST7789
Please don't expect your search results to match mine, Aliexpress has algorithms to provide each customer the "best experience", and as that's based on our history, there's little chance we see the same.
It's also very important to select the exact desired device when ordering on Ali, and then they still manage to get the wrong stuff in your package
Displays with a resistive touchscreen (including a plastic pen) are mostly installed on ILI9xxx displays using TN technology, the ST77xx displays usually come with capacitive touchscreens (when they have that), and mostly use IPS displays.
Just use available pins, that are conveniently placed next to each other, avoiding any pins often used for specific purposes, that can be found here
/Ton (PayPal.me)
Re: which built for tft display ST7789
OK, ILI9341 240x320px and rotation 270 gives a result
colors are wrong but that's not a big deal
Q: somewhere (can't recall where) it was mentioned how to put text on display via HTTP.
Any suggestion where to find some info about this?
-Bart
colors are wrong but that's not a big deal
Q: somewhere (can't recall where) it was mentioned how to put text on display via HTTP.
Any suggestion where to find some info about this?
-Bart
Re: which built for tft display ST7789
That could be fixed by selecting the ILI9342 device, as that's a (M5Stack specific) controller using inverted colors.
The commands are documented here: https://espeasy.readthedocs.io/en/lates ... -available
Just prefix them with "http://<esp-ip-address>/control?cmd=" to control the display from remote. You can test the commands from the Tools page, to see what arguments need to be url-encoded (the %xx values added by your browser), and you will need to wrap texts containing comma's and spaces in quotes, as documented here: https://espeasy.readthedocs.io/en/lates ... er-parsing
/Ton (PayPal.me)
Re: which built for tft display ST7789
Thanks Ton, this makes sense.
I am trying to sent several http commands in sequence from a domoticz script. That fails. Only first command is executed. I think there must be an commit from a http command before a second and more are accepted.
Is there a way to sent in one http command a clearscreen and then the command for sending text to all lines?
I am trying to sent several http commands in sequence from a domoticz script. That fails. Only first command is executed. I think there must be an commit from a http command before a second and more are accepted.
Is there a way to sent in one http command a clearscreen and then the command for sending text to all lines?
Re: which built for tft display ST7789
Each command is processed immediately when sent, commands can not be combined into a single long command-line, but have to be sent separately.
/Ton (PayPal.me)
Re: which built for tft display ST7789
can de http commands to control de tft screen sent from domoticz be to fast after each other and therefore esp ignores the last received command?
Re: which built for tft display ST7789
That's possible.
You could also wrap more data in an 'event' command.
This way you can use multiple arguments and handle in rules what to do with them.
Or hand it over as 'asyncevent', so the commands will then be queued and dealt with later.
This way ESPEasy may be ready much more quickly as it doesn't have to do anything with the hardware yet.
You could also wrap more data in an 'event' command.
This way you can use multiple arguments and handle in rules what to do with them.
Or hand it over as 'asyncevent', so the commands will then be queued and dealt with later.
This way ESPEasy may be ready much more quickly as it doesn't have to do anything with the hardware yet.
Re: which built for tft display ST7789
Not sure how Domoticz sends these commands, but if they are sent in parallel, then it will fail, as the ESP handles only 1 thread, not multiple in parallel.
I've sent many commands sequentially from a python script on an RPi to an ESP TFT display (using P095), and that worked as expected (drawing a PV monitor graph), but I'm quite sure those commands are sent one after the other.
I've sent many commands sequentially from a python script on an RPi to an ESP TFT display (using P095), and that worked as expected (drawing a PV monitor graph), but I'm quite sure those commands are sent one after the other.
/Ton (PayPal.me)
Re: which built for tft display ST7789
just to show the dz (test)script
dz is acting single threaded
dz is acting single threaded
Code: Select all
return {
on = {
devices = {1665},
},
execute = function(dz)
dz.openURL({ url = "http://192.168.2.230/control?cmd=tftcmd,clear" })
dz.openURL({ url = "http://192.168.2.230/control?cmd=tft,txz,10,10,hello world" })
end
}
Who is online
Users browsing this forum: Bing [Bot] and 1 guest