-
I've been discussing my issue with xp2046 touch using esp32s2 with @sfromis in the display channel of discord. I've since done a bit of investigation and putting my results here so this issue can be discussed in an async way. I'm willing to do whatever to resolve this but I do need some help being pointed in directions and even compile my own firmware as necessary. Thx. investigation of failed touch input with lolin 2.4tft (xp2046) using esp32s2 d1 mini. hardware:https://www.wemos.cc/en/latest/d1_mini_shield/tft_2_4.html I have checked the connections from the boards esp header to the xp2046 chip and I can confirm that the spi clock,miso,mosi are connected to both to tft and xp2046 per the schematic. This is my understanding that the touch and tft share these three and then each has their own CS which again I checked and the TS-CS is going from D3/18 to the xp2046. The bottom line is that it seems everything is "connnected" as it should be and the corresponding tasmota template has correct pin assignments. Firmwareper lvgl binary defines at https://github.com/arendst/Tasmota/blob/development/tasmota/include/tasmota_configurations_ESP32.h#L308-L514 Testing (CALIBRATION)So assuming all is fine with the firmware compile per above I loaded the DisplayCalibrate.tapp and edited the display.ini to add
https://github.com/tasmota/docs/blob/master/docs/Displays.md CONCLUSIONSIf I had to guess I would say this is NOT a hardware issue but a firmware issue. And if I was to point a finger I would guess that the compile switch ESP32 was not set and therefore the SPI gpio pin assignments are unknown to the touch code and thus it fails. This might be because the esp32s2 compilation is maybe not same as the regular esp32 code. Which might explain why XP2026 might be working for others but not for me (as I am using the s2 chip variant). So first where is Instance INFOfirmware and hardware as reported in UI, I installed tasmota32s2-lvgl.factory.bin |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 11 replies
-
Your speculation about lacking define of The build process is a lot more involved than expecting all #define symbols to come from the source code files. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
So the defines/headers are no way any different for regular wrover vs s2 variant. regardless of the chip variant that same header and touch ino file is used. ok then running out of ideas. given
@sfromis since you actually have the exact same hardware (lolin tft, esps2 mini) can you help at least with a way I can "debug" the firmware. At this point I have no specific way of knowing if the touch.ino code is running correctly. |
Beta Was this translation helpful? Give feedback.
-
btw the weblog now shows this line during boot |
Beta Was this translation helpful? Give feedback.
-
seems the final calculation for the :M has a bug. From the log these were coordinates of each calibration tap. with rotate 2
|
Beta Was this translation helpful? Give feedback.
-
Ok going to need some more suggestions. I ran the displaycalibrate tapp and picked these values from the logs (as the calculation of :M is flawed)
I then hand edited :M in display.ini thus with rotation zero the default (which is the 320 pixels vertically)
for troubleshooting I wrote a simple pages.jsonl and started haspmota
With this running the three buttons appear vertically more or less centered. If I tap left to right about the vertical center I can fire off events for all three buttons in order so touch is working BUT! the registration (where you tap to actuate the button vs where the button is displayed is definitely 90 degrees rotated (and maybe the "vertical" registration is scaled down). So why is this and how can I fix it? If I swap the order of values in :M that does NOT fix it and mostly makes it worse or it doesn't function at all. I'm thinking the issue is with display .ini for the UDD. I am looking at the settings for display.ini wondering what needs to change. Maybe since it's a rotation problem I need to set :R but to what?
here is :R for (https://github.com/arendst/Tasmota/blob/development/tasmota/displaydesc/ILI9488_XPT2046_display.ini)
|
Beta Was this translation helpful? Give feedback.
-
THIS WORKS FOR TASMOTA PRE 14. See below for update to this answer for 14+ I have a resolution to this touch issue! Yeah! Lolin TFT Display with D1 Mini ESP32s2
FIRMWAREhttps://github.com/tasmota/install/releases
using esptool to load (could not get web installer to work)
Tasmota Template
ENABLEto enable touch for the xp2046 chip with the UDD use this line
CALIBRATION/REGISTRATIONFrom an lvgl post about the same TFT using a similar driver it was pointed out that no calibration was needed. Just use 0,4095 for min/max of both x and y. That got me started in the right directioin. These values for :M seem to be fine across different TFTs (I tested 3)
SWAP/ROTATION/FLIP@sfromis was able to articulate the touch codes for so with a bit of testing I came up with this for
BUTThat lines up great for rotations FYI if you notice there is a black strip on one edge of the TFT where data lines are connected. In rotations FILESthis zip archive has landscape and portrait versions of HELPIf you have any issue with the same hardware given the files I have provided post a reply here and maybe I can help you resolve them. |
Beta Was this translation helpful? Give feedback.
THIS WORKS FOR TASMOTA PRE 14. See below for update to this answer for 14+
I have a resolution to this touch issue! Yeah!
Lolin TFT Display with D1 Mini ESP32s2
FIRMWARE
https://github.com/tasmota/install/releases
tasmota32s2-lvgl.factory.bin
using esptool to load (could not get web installer to work)
To get into flash mode is finiky. Pushing both buttons start the script then release RST button followed by gpio 0 button in order to get into "flash" mode