Closed lucasmontec closed 1 year ago
Sorry, there is not enough information, please use the Issue template and fill in the required fields
Please provide the smallest, buildable, code that can reproduce the phenomenon. Code with only the configuration part will not allow me to test under the same conditions.
And, if possible, try to get it from the develop branch. Issues that are not resolved in the release version may be resolved in the develop branch.
Touch is not working with the GT911 module. Using the user setup example I cannot get the touch to read anything and calibration doesn't sense no touches.
Touch working.
Clicking the screen doesn't do anything.
Upload code to the board, try clicking anywhere.
The wiring is from the factory as follows:
(https://gist.github.com/lucasmontec/0a29ce962ee3bac458b191ec16b4266f)
@lucasmontec Thanks for the detailed information.
I got this information about ESP32-3248SO35 from an acquaintance, please try the following. When CPU is 240MHz, INT GPIO21 does not function properly, so specify -1 for INT. If you set CPU 160MHz, INT GPIO21 works.
I'll try it as soon as possible and answer here. Just needed to add that I was able to work with LVGL and the TAMC GT911, so that GPIO21 should be working just fine.
Hi Lucas,
I do have the same board and have pin 21 set to -1. I got it working and quickly, as a test adapted the Tetris game from the examples: https://github.com/rzeldent/ESP32-3248S035-Tetris. In this version, the pin21 is set to -1 and it "works". Little detail, it works after a hard reset. If it has been uploaded it does not work.
However, I also made an integration with lvgl and here I really cannot get the GT911 using LovyanGFX @ ^0.4.18 to work, Even with the INT pin set to -1. See the code below; the getTouch function never returns a value >0. It looks like the GT911 implementation is not very stable/timing?
void lvgl_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
{
uint16_t touchX, touchY;
// Ignore multi-touch
if (tft.getTouch(&touchX, &touchY))
{
log_d("Touch: (%d,%d)", touchX, touchY);
data->state = LV_INDEV_STATE_PR;
data->point.x = touchX;
data->point.y = touchY;
}
else
data->state = LV_INDEV_STATE_REL;
}
I have it working the TAMC GT911 driver and TFT_eSPI and this is working with lvgl. I ordered some resistive touch boards to see it this works.
Please let me know if you make any progress because this is also an impediment for me. Also, some more information about this board can be found at: https://macsbug.wordpress.com/2022/10/02/esp32-3248s035
Yeahh! I actually did the same thing! I'm using TAMC GT911 and LVGL for this. The issue is, Lovyan is faster and has a better API than LVGL... I think the resistive touch probably works.
I hope the resistive touch works better, most of the examples are with the 3238S036R (R = probably resistive) with the XPT2046. A few with the GT911 but code seems a bit hacked in the examples for the board. However, I'd prefer capacitive. Also, using LovyanGFX is interetsing because it looks less heavy and seems to perform better. The best option would, to use only the drivers. LVGL contains all the drawing stuff/fonts etc and is this is not needed from Lovyan or TFT_eSPI. I tried https://github.com/lvgl/lvgl_esp32_drivers but this is not up to date for lvgl 8 and did not get it to work... Maybe you did? What now?
Im working with the latest lvgl and TAMC GT911 with success. I don't think this thread is the correct place to talk about other libraries so feel free to add me on discord Zumbi#2535 or drop me an email lucas.mcarvalhaes@gmail.com
@lovyan03 Hello and thank you for all your hard work!
I'll gladly create a separate issue if this is what's best but seeing how it's the same panel and driver i thought there's no need.
I have the same issue using the pre-defined user settings from the develop branch https://github.com/lovyan03/LovyanGFX/blob/develop/src/lgfx_user/LGFX_ESP32S3_RGB_ESP32-8048S043.h
I'm actually using the 4.3" IPS(800x480) screen this header is targeting and if i flash the provided calibration example including the above header i just end up seeing the drawing screen without being able to draw as no touch, the calibration phase is skipped which tells me it doesn't seem to detect any touch panel ? I know the work on that header is in progress still but not sure whether in your tests it works and doesn't in mine ?
@Zer0-bit those predefined user settings are templates, have you tried to import the code into your sketch and use a different pinout?
@lucasmontec feel free to create a discussion in the Q&A section
@Zer0-bit those predefined user settings are templates, have you tried to import the code into your sketch and use a different pinout?
But the pinout is exactly the same as specified there, i mean i'm using the exact model the template was created for unless i'm missing smth reading that ofc?
@Zer0-bit do you mean you're also using an ESP32-8048S043? Have you tried the suggested workarounds? Looks like you're expecting some kind of commercial support, but this is a community site :wink:
Please make your own research and provide the results before asking for support from the community.
@Zer0-bit do you mean you're also using an ESP32-8048S043? Have you tried the suggested workarounds? Looks like you're expecting some kind of commercial support, but this is a community site 😉
Please make your own research and provide the results before asking for support from the community.
Lol i mean i've not been trying to be perceived as trying to get commercial level support tbh not even sure what in my sentence sparked this thought, i was just trying to understand whether the screen's touch has been working at all in testing since is saw a template in the user settings that was targeting this exact model ( yes i have ESP32-8048S043 ). I'm atm on my 4th day of trying to get this thing working so did quite a bit of research and tried all the workarounds i was able to find(including in this thread) prior to posting, i mean i'm running my own OOS project so i know how absurd some issues or requests can get, pls hold fire lol.
Btw this is the header i've been using, if anyone has any idea pls kindly let me know i'm kinda out of ideas for now :(
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
class LGFX : public lgfx::LGFX_Device{
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_GT911 _touch_instance;
public:LGFX(void){
auto cfg = _bus_instance.config();
cfg.panel = &_panel_instance;
cfg.pin_d0 = 8; // B0
cfg.pin_d1 = 3; // B1
cfg.pin_d2 = 46; // B2
cfg.pin_d3 = 9; // B3
cfg.pin_d4 = 1; // B4
cfg.pin_d5 = 5; // G0
cfg.pin_d6 = 6; // G1
cfg.pin_d7 = 7; // G2
cfg.pin_d8 = 15; // G3
cfg.pin_d9 = 16; // G4
cfg.pin_d10 = 4; // G5
cfg.pin_d11 = 45; // R0
cfg.pin_d12 = 48; // R1
cfg.pin_d13 = 47; // R2
cfg.pin_d14 = 21; // R3
cfg.pin_d15 = 14; // R4
cfg.pin_henable = 40;
cfg.pin_vsync = 41;
cfg.pin_hsync = 39;
cfg.pin_pclk = 42;
cfg.freq_write = 16000000;
cfg.hsync_polarity = 0;
cfg.hsync_front_porch = 8;
cfg.hsync_pulse_width = 4;
cfg.hsync_back_porch = 16;
cfg.vsync_polarity = 0;
cfg.vsync_front_porch = 4;
cfg.vsync_pulse_width = 4;
cfg.vsync_back_porch = 4;
cfg.pclk_idle_high = 1;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
{ auto cfg = _panel_instance.config();
cfg.memory_width = 800;
cfg.memory_height = 480;
cfg.panel_width = 800;
cfg.panel_height = 480;
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
{ auto cfg = _panel_instance.config_detail();
cfg.use_psram = 1;
_panel_instance.config_detail(cfg);
}
{ auto cfg = _light_instance.config();
cfg.pin_bl = 2;
_light_instance.config(cfg);
}
_panel_instance.light(&_light_instance);
{ auto cfg = _touch_instance.config();
cfg.x_min = 0; // タッチスクリーンから得られる最小のX値(生の値)
cfg.x_max = 800; // タッチスクリーンから得られる最大のX値(生の値)
cfg.y_min = 0; // タッチスクリーンから得られる最小のY値(生の値)
cfg.y_max = 480; // タッチスクリーンから得られる最大のY値(生の値)
cfg.pin_int = 18; // INTが接続されているピン番号 18
cfg.bus_shared = false; // 画面と共通のバスを使用している場合 trueを設定
cfg.offset_rotation = 0; // 表示とタッチの向きの調整 0~7の値で設定
// I2C接続
cfg.i2c_port = 1; // 使用するI2Cを選択 (0 or 1)
cfg.pin_sda = 19; // SDAが接続されているピン番号
cfg.pin_scl = 20; // SCLが接続されているピン番号
cfg.freq = 400000; // I2Cクロックを設定
cfg.i2c_addr = 0x14; // I2Cデバイスアドレス番号 or 0x5D , 0x14
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);//タッチスクリーンをパネルにセット
}
setPanel(&_panel_instance); // 使用するパネルをセットします。
}
};
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.
Hi Simone,
Thanks for reviving this thread. I had lots of trouble getting it to work with Lovyan so started a github repo just for these boards for LVGL. Besides the display it also covers the led, light sensor etc... esp32-smartdisplay Maybe this works also for you...
{ // Set the touch screen control.
auto cfg = _touch_instance.config();
cfg.x_min = 0;
cfg.x_max = 320;
cfg.y_min = 0;
cfg.y_max = 480;
cfg.pin_int = -1;
cfg.pin_rst = 25;
cfg.bus_shared = false;
cfg.offset_rotation = 0;
cfg.i2c_port = 0;
cfg.i2c_addr = 0x5D;
cfg.pin_sda = 33;
cfg.pin_scl = 32;
cfg.freq = 1000000;
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
This works for me with LoryvanGFX
Hey! I hope you can help, I already spent 4h+ on this. Recently I bought this ESP32 module. This is using a TFT hooked on the hardware SPI and a capacitive touch panel controlled by a GT911. I'm trying to hook up your library and cannot ever get the touch controller to work.
The hardware connections are:
I'm using this setup:
I even looked into your code and got this to spit a 'true':
This line:
_inited = lgfx::i2c::init(_cfg.i2c_port, _cfg.pin_sda, _cfg.pin_scl).has_value() && _writeBytes(gt911cmd_getdata, 3);
The_writeBytes(gt911cmd_getdata, 3);
part returns 0 or it seems to return 0.