il9341 with xpt2046 #21227
-
I am trying to get Haspmota working on my esp32 connected to a il9341 with xpt2046 module. I have previously used the same setup with openhasp and now trying out haspmota. The same setup I'm using worked with both display and touch with openhasp I am using the display module referenced here on the openhasp page: https://www.openhasp.com/0.6.3/displays/MSPxxxx/ Module configuration in tasmota: I am using the ILI9341_xpt_display.ini with the following added below I have the display working but I am unable to get touch working. I have uploaded the DisplayCalibrate.tapp and the calibration process starts and asks me to touch the top left cross. But my display is not registering any touch events and does not respond. Can you please guide me in what maybe happening here? Are the pin connections wrong or the display.ini that I am using wrong? Any help would be appreciated. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 8 replies
-
We have migrated to Universal Touch driver (uTouch), see https://tasmota.github.io/docs/Universal-Display-Driver/#migrating-to-utouch You need to remove
You also need to set:
Only after this you need to run DisplayCalibrate |
Beta Was this translation helpful? Give feedback.
-
So after getting the display calibration completed I am having trouble reacting to a single test button I have the following loaded into the file system in addition to the display.ini. with the added :M,2091,2120,2065,2047 automatically generated after the calibration test. autoexec.be import haspmota pages.jsonl {"page":0,"comment":"---------- Upper stat line ----------"} {"id":11,"obj":"label","x":0,"y":0,"w":320,"pad_right":90,"h":22,"bg_color":"#D00000","bg_opa":255,"radius":0,"border_side":0,"text":"Tasmota","text_font":"montserrat-20"} {"id":15,"obj":"lv_wifi_arcs","x":291,"y":0,"w":29,"h":22,"radius":0,"border_side":0,"bg_color":"#000000","line_color":"#FFFFFF"} {"page":1,"comment":"---------- Page 1 ----------"} {"berry_run":"tasmota.add_rule('hasp#p1b1#event=up', def () print('Button p1b1 pressed') end)"} I expect to see a message "Button p1b1 pressed" displayed in the berry console when I click on the button but nothing happens. This is the startup message from tasmota console 00:00:00.001 HDW: ESP32-D0WDQ6 v1.0 What am I doing wrong? Where does the code for button event reactions go? Thank you for the help. |
Beta Was this translation helpful? Give feedback.
-
Setting the loglevel to 4 on seriallog does report touch events and their coordinates and raw coordinates. the calibration data obtained from displaycalibrate does not seem to be accurate :M,2054,2022,2054,2020 This calibration makes touches on the screen mapped to x=0 or 240 and y= 0 or 320 with moving just a few pixels. I can see the raw x and y values changing with more precision but the x and y values seem to be flipped. My display is oriented vertically when set to displayrotate 0. THe display is 240 w and 320 h in this orientation. The mapping of the raw x/y values to screen x/y values seem to off and flipped. Here's what I get now if the click the 4 corners of the screen after running displaycalibrate Clicking on the top left corner Top right Bottom Left Bottom Right How can I correct this? appreciate your help. |
Beta Was this translation helpful? Give feedback.
-
I am quite frustrated trying to get this display and touch to work. I have tried to play around with the pseudo opcodes to try to flip and swap x and y but not getting the result I want. The below orientation and x,y coordinates are what I am trying to achieve for touch. With the default rotation opcode and :M line :R,36 :M,3764,376,373,3699 I get the following result for x,y coordinate for the four corners So it seem I need to swap x and y axes. The tamota documentation for rotation opcodes mentions bit 7 for swaping x and y which I assumes means in binary 0100 0000 which is 20 in hex. So making the change to the rotation opcode above results in with last value changed to 20 for rotation 0 :R,36 :M,3764,376,373,3699 But this gives me the exact same values as above for the four corners. Am I doing something wrong? Please help as I am at my wits end trying to get the touch to work accurately. Thank you |
Beta Was this translation helpful? Give feedback.
-
Bit numbering starts at 0 for 2^0 |
Beta Was this translation helpful? Give feedback.
-
Oh finally got touch working accurately!!! Thank you. |
Beta Was this translation helpful? Give feedback.
We have migrated to Universal Touch driver (uTouch), see https://tasmota.github.io/docs/Universal-Display-Driver/#migrating-to-utouch
You need to remove
:TS
and replace with:You also need to set:
TS SPI CS
Only after this you need to run DisplayCalibrate