TFT ili9341 again

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

TFT ili9341 again

#1 Post by Dick60 » 27 Jan 2023, 15:45

I've loaded from the latest release (24 dec 2022) on my ESP8266. I made a custom version because I wanted a combi of NEOPIXEL(Basic) and the TFT display. Connected the ili 9341 according the the plugin095 (SPI active CLK=GPIO-14 (D5), MISO=GPIO-12 (D6), MOSI=GPIO-13 (D7)) . After trying to get some text on my display, I tried the text tft,txtfull,10,50,HelloWorld in Command line on the TOOLS page resulting in an OK on the Command output, but nothing on my display. I notised that the X Y coordinates were changed. After modifying the command line input into tft,txtfull,70,0,HelloWorld the coordinates changed as well so there is some communication from and to the display dut no text.
Replaced the cables already for a new set to rule oud broken cables. Any idea what could cause this problem?

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

Re: TFT ili9341 again

#2 Post by Ath » 27 Jan 2023, 16:24

Do you have the backlight powered? Without backlight you can hardly see the pixels (maybe if looking from a very short distance and having enough environment-light). BL can be connected to VCC without issues, for a quick test, and you can also configure a GPIO for it in the plugin so it will be controlled via PWM to the percentage set there.
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#3 Post by Dick60 » 27 Jan 2023, 17:19

I had to mention that, I have a backlight and a good view on my screen but probably it is better to make connect it as you mentioned so I can PWM dim the backlight.

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#4 Post by Dick60 » 27 Jan 2023, 18:14

The result of PWM the backlight: dimming is working perfect but no charcters on the screen. After sending the TXT, you see a kind of flikkering on the screen but no text

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

Re: TFT ili9341 again

#5 Post by Ath » 27 Jan 2023, 19:06

What pin is used for CS?

NB: the x/y coordinates are set from the plugin, not read from the display hardware. That doesn't report that type of data.
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#6 Post by Dick60 » 27 Jan 2023, 19:19

it is pin GPIO 0 (D3)

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

Re: TFT ili9341 again

#7 Post by Ath » 27 Jan 2023, 19:58

Should I ask for the DC and Reset pins? These are also important.
Can you share a screenshot of that part of the plugin settings to show it?
You can also try a different controller model, like the ILI9342, that only uses a somewhat different color mapping config from the ILI9341.

What exact board do you use? Have a link to it?
Does it have a XPT2048 touch screen attached? (but that should work completely independent of the display)

I have my Aliexpress-sourced ILI9341 board connected to an ESP32, and while the wire connections are a bit 'fragile' (I've used extra connectors & wires to also have the touchscreen connected), after moving the contacts a bit it works fine every time I use it for testing an ESPEasy release or plugin fix.
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#8 Post by Dick60 » 27 Jan 2023, 20:10

Here the screesshot of the Ali display ILI9341.
Attachments
ili.jpg
ili.jpg (211.37 KiB) Viewed 3617 times

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#9 Post by Dick60 » 27 Jan 2023, 20:20

the screenshot of my ESP8266 settings
Attachments
ili1.jpg
ili1.jpg (164.69 KiB) Viewed 3615 times

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#10 Post by Dick60 » 27 Jan 2023, 20:24

tested another type of screen from the dropdown in the plugin. No result.

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

Re: TFT ili9341 again

#11 Post by Ath » 27 Jan 2023, 21:16

There's at least one blocking conflict, both the CS and the Backlight use GPIO-0, that will certainly not work as intended. One of those has to be reconfigured, and is most likely the reason the display is not working. The CS signal is crucial in addressing/enabling the commands to reach the display.
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#12 Post by Dick60 » 27 Jan 2023, 21:45

my mistake, that is the problem with a tunnel view. I'm gone experiment with this display. I see some characters :D

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

Re: TFT ili9341 again

#13 Post by Ath » 27 Jan 2023, 22:17

Yay! :D
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#14 Post by Dick60 » 29 Jan 2023, 11:21

Testing the TFT device and try to send a HTTP message from Domoticz to the device but tha is not working for me. The message is simple, if a switch is turned on send the message <myIP>/?cmd=tft,txtfull,100,40,HelloWWWWorld.
Also I try to get a <space> between Hello and World. I tried the following characters where the space is in between The % %, ' ', " ". they all did not work any ideas?

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

Re: TFT ili9341 again

#15 Post by TD-er » 29 Jan 2023, 12:46

As a simple test to see how the data you try to send should be URL-encoded, you can try the command on the tools page.
After entering the command, the page quickly reloads and you can see the URL-encoded call in your browser url field.
There you can see how special characters are encoded.
For example a space (ASCII code 32, hex: 0x20) will be changed into %20

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

Re: TFT ili9341 again

#16 Post by Ath » 29 Jan 2023, 13:06

Having spaces or commas in the text to display on the screen, that part of the command has to be quoted, as explained here

So sending Hello world would be like: tft,txtfull,100,40,"Hello world"
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#17 Post by Dick60 » 29 Jan 2023, 14:00

that works now for me, Good tip. But the second thing is that I try to send an HTTP message from Domoticz to my dislat. I tried <MY IP>/?cmd=tft,txtfull,0,0,"Hello World" also tried the ftfcmd option but that did not work as well. Nothing is seen on my 8266 receiving device log

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

Re: TFT ili9341 again

#18 Post by Ath » 29 Jan 2023, 14:33

I think that should be like:

Code: Select all

http://ip.ad.dr.ess/control?cmd=tft,txtfull,0,0,"Hello world"
and optionally using %20 instead of the space
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#19 Post by Dick60 » 29 Jan 2023, 16:46

Took some time but the result is <My IP>/tft,txtfull,120,120,"Hello%20World". It looks great for now. I continue for the touch part of the display. Hope it will not be struggle :D

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#20 Post by Dick60 » 30 Jan 2023, 19:50

I started the touchsreen part of my project. Documentation about XPT2046 is quit strait forward. Everything connected and try to Callibrate according the procedure discribed. I see nothingin my logging at the time I touch the screen. stese are the connections I made for this test . Do I mis something?
Attachments
capture.png
capture.png (7.75 KiB) Viewed 3364 times

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

Re: TFT ili9341 again

#21 Post by TD-er » 30 Jan 2023, 19:53

Do you share the CS pin with anything else?

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

Re: TFT ili9341 again

#22 Post by Ath » 30 Jan 2023, 20:01

The resistive touchscreen XPT2046 isn't as sensitive as the touchscreen on a smartphone, we've all become accustomed to. Best 'effect' is to be had when applying some pressure and using the (plastic) pen that should accompany the touchscreen, but touching/tapping with a fingernail also works quite ok, though it may be less accurate.
For logging to work, the setting for calibration-log has to be enabled, but I assume you've got that checked (and, it's on by default ;)).
Last edited by Ath on 30 Jan 2023, 20:51, edited 1 time in total.
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#23 Post by Dick60 » 30 Jan 2023, 20:18

I use the Hard Plastic pen for the touch but no result. Also no conflicts with other pins used in my project
Attachments
Touchpng.png
Touchpng.png (22.99 KiB) Viewed 3353 times

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

Re: TFT ili9341 again

#24 Post by Ath » 30 Jan 2023, 21:23

Dick60 wrote: 29 Jan 2023, 16:46 Hope it will not be struggle :D
You've jinxed it... :shock:
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#25 Post by Dick60 » 30 Jan 2023, 21:29

No it is still a pain in the .... I bought this screen and the only thing left is perhaps a monday morning screen. Perhaps not working, red the documentation again I followed all the instructions.

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

Re: TFT ili9341 again

#26 Post by Ath » 30 Jan 2023, 21:35

Just for fun I powered up my ESP32 with the ILI9341/XPT2046 touch-display combo, and updated to latest mega branch. Still works like a charm (after wiggling the wires a bit to get it going 8-))
This is some calibration log, without Events enabled, tapping with my fingernail randomly on the screen:

Code: Select all

49927 : Info   : Touch calibration rx= 1570, ry= 1521; z= 173, x= 1570, y= 1521
52729 : Info   : Touch calibration rx= 2081, ry= 2934; z= 212, x= 2081, y= 2934
53329 : Info   : Touch calibration rx= 1378, ry= 3403; z= 38, x= 1378, y= 3403
53829 : Info   : Touch calibration rx= 1586, ry= 3223; z= 122, x= 1586, y= 3223
55029 : Info   : Touch calibration rx= 1333, ry= 3182; z= 114, x= 1333, y= 3182
55530 : Info   : Touch calibration rx= 2552, ry= 3396; z= 74, x= 2552, y= 3396
Minimum touch sensitivity is set to 15, not sure what you have set there, when set too low it will trigger a touch when a fly flies by, when set too high, even when hitting it with a hammer you won't see a touch...
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#27 Post by Dick60 » 30 Jan 2023, 21:47

I think,only to be be sure, I rewire the ESP and look what happens otherwise I order another so I can compare one with another. Will start with it tomorrow😀

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#28 Post by Dick60 » 31 Jan 2023, 16:31

I reinstalled all the wires, activated the callibration screen (as discribed) and start testing. I Assumed and expected to see something in my logfile, am I right? If no logging is available for my touch activities,I can assume that the touch part of my ili screen is broken. Can you confirm this conclusion?

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

Re: TFT ili9341 again

#29 Post by Ath » 31 Jan 2023, 16:39

Assuming that you also checked if the wires are not broken in some way (I've had my fair share of broken/disconnected wires & connectors, over time), that sounds like a fair conclusion.
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#30 Post by Dick60 » 31 Jan 2023, 17:37

I soldered them on a rack so the wired must be good for now. I order a new screen and hope to continue in a few weeks. Thanks for the support.

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#31 Post by Dick60 » 31 Jan 2023, 19:13

Now I found another display, the 9481 but the connections are not the same as the ili 9341. Do you have any idea I must use for my testing the screen and the touch part?
Attachments
IMG_20230131_185557.jpg
IMG_20230131_185557.jpg (3.6 MiB) Viewed 3218 times

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

Re: TFT ili9341 again

#32 Post by Ath » 31 Jan 2023, 19:54

If it has a touch-screen it should be a XPT2046, AFAIK, so you could hook that up and test, but as the display is supposed to be 320x480 pixels, and possibly the touch screen is also configured like that, and that touch resolution is untested.

The ILI9481 LCD display is untested, as I couldn't find any that actually had the SPI interface, or it is rather undocumented how to connect or configure to use 3/4 wire SPI. You seem to have one available, though :D.
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#33 Post by Dick60 » 31 Jan 2023, 20:21

Haha, unieke. I am still searching and if any news, I share it 😬

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

Re: TFT ili9341 again

#34 Post by Ath » 31 Jan 2023, 20:58

For what I could find, the pinout should be connected like this:

Code: Select all

Display  - ESPEasy
LCD_RST  - RST
LCD_CS   - CS
LCD_RS   - n/a
LCD_WR   - MOSI
LCD_RD   - CLK
Only the GND and 3.3V should be used.
The LCD_D0..LCD_D7 pins can be ignored.

Edit:
This may be helpful: https://github.com/Bodmer/TFT_eSPI/issues/968
/Ton (PayPal.me)

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#35 Post by Dick60 » 31 Jan 2023, 22:27

I found an overview and will test it tomorrow morning.
Attachments
IMG_20230131_222638.jpg
IMG_20230131_222638.jpg (2.1 MiB) Viewed 3195 times

Dick60
Normal user
Posts: 242
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: TFT ili9341 again

#36 Post by Dick60 » 01 Feb 2023, 17:43

Unfortunately no succes in my testing. Tested all 948x types available in the drop-down but no reaction on the screen. Will order a new 9341 because that is a tested one.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 24 guests