Screen not responding to touch

BTW, due to the need for big fonts, my built firmware is pretty big (2305KB). Not sure if it’s related to this issue.

It turned out if I don’t initialize the xpt2046 driver (still using the same ili9488 display), the error won’t happen. Any thoughts? What else can I investigate?

A few ideas:

  • Are you using the latest version of lv_micropython? Just to make sure you are not hitting some bug that was already resolved. Don’t forget to run git submodule update --recursive to update all submodules.
  • Did you try changing some xpt2046 parameters? For example half_duplex, mhz, etc.
  • Did you try using xpt2046 on a different SPI bus? (esp.VSPI_HOST instead of esp.HSPI_HOST)
  • If you don’t interact with the touch panel at all, does the problem still happen eventually? Or does it happen only if there was some interaction?
  • Try to comment these lines on xpt2046 driver. That would keep it active but prevent it from updating LVGL. With this change the touch would not response, but does the problem still happen eventually?
  • You can try creating a “fake” touch driver that registers as an input device instead of xpt2046. Perhaps the problem arises only after some activity on an input device?

Two previous ideas:

  • Is the problem unique to ili9488? Or does it happen with ili9341+xpt2046 as well?
  • Is it related to lvesp32 module? You can try using uasyncio instead.

git submodule update --recursive and rebuild the firmware seemed to have fixed this issue. Thanks so much for pointing it out!

Where is the lvesp32 located in the repo? I’m still interested in looking into the possibility to use uasyncio.

To use uasyncio you need to:

  • Import uasyncio
  • Import async_utils
  • Initiailize the ili9xxx display
  • Disable lvesp32 by calling lvesp32.deinit()
  • Create async_utils.lv_async() and keep a refence to it
  • Create your LVGL objects, screens, etc.
  • call uasyncio.Loop.run_forever() to start the event loop

Remember that you need to use async and await when you want to block the coroutine execution (for example uasyncio.sleep).

I’m planning to add an example for using uasyncio after making some changes to ili9xxx so it won’t import lvesp32 and we won’t need to disable it as a workaround.

An example for uasyncio will be great! Looking forward to it :heart_eyes_cat:

See:

1 Like