lucadentella / SPIFFS_ImageReader

5 stars 5 forks source link

SPIFFS_ImageReader makes I2C keyboard not responsive. #4

Closed OslafEman closed 1 year ago

OslafEman commented 2 years ago

Hello, in my project I use an MH ET LIVE ESP32Minikit connected to a TFT screen and to an I2S keyboard. The microprocessor works as an asynchronous server using the ESPASyncWebServer and AsyncTCP libraries. Also I use the Adafruit_GFX and Adafruit_ST7735 libraries. The keyboard (using the i2ckeypad librery) works properly until the moment I start using the SPIFFS_ImageReader.h library displaying images on the TFT screen with the "Reader.drawBMP ("/File.bmp ", TFT, 0, 0)” command. At that time the keyboard works with great difficulty and becomes very little responsive. I have performed many tests testing other elements and libraries and I am sure now that the problem comes from SPIFFS_ImageReader library.

Oslaf

lucadentella commented 2 years ago

Hi Oslaf

it's very difficult to troubleshoot compatibility issues between libraries... I can tell you that:

Did you notice the same behavior with the "official" Adafruit companion library? https://github.com/adafruit/Adafruit_ImageReader

OslafEman commented 2 years ago

Hello, thanks for the answer.

“SPIFFS_ImageReader` is not async, so when you call the drawBMP method, everything is blocked until the rendering of the image is complete” That's exactly how it is. My device includes, in addition to the ESP32 microprocessor, a screen and a microSD reader, both with SPI connection and an I2C keyboard. When I tried to implement an Asyncronous File Server (ESPAsyncWebServer + AsyncTCP + Adafruit_GFX + Adafruit_ST7735 + SPIFFS_ImageReader) to remove the SD reader using the SPIFFS system I ran into the I2C connection problem. I have tried many alternatives without success, the best has been to create a task (xTaskCreate…) that solves the keyboard problem, but the system has become unstable.

I even tried to render images in hex format without the SPIFFS_ImageReader library, but the result was the same. So now I think that the conflict of the asynchronous server with the I2C connection has to do with the GFX and ST7732 libraries from Adafruit.

“Did you notice the same behavior with the "official" Adafruit companion library?” No, the official library is not a problem as long as it is not implemented on Asyncronous File Server. Originally the device uses a ESP32 web server (ESP32WebServer + Adafruit_GFX + Adafruit_ST7735 + Adafruit_ImageReader) and the keyboard works fine.