ESP32-GifPlayer icon indicating copy to clipboard operation
ESP32-GifPlayer copied to clipboard

is the wifi nessasary

Open YosefGoodman opened this issue 2 years ago • 5 comments

hi i am having trouble getting this to work on my screen, is the wifi necessary to make the gifs play?

YosefGoodman avatar May 09 '23 16:05 YosefGoodman

hi,

it will not try to fetch files from the network if a /gif folder exist on the sd card and contains gif files

     totalFiles = getGifInventory( "/gif" ); // scan the SD card GIF folder
     if( totalFiles == 0 ) {
         // fetch files via WiFi
     }

tobozo avatar May 09 '23 16:05 tobozo

awesome, is this compatible for an esp32 over an ili9431? do I need to change any parts of the code?

YosefGoodman avatar May 09 '23 20:05 YosefGoodman

yes you need to adjust parts in the code, probably uncomment //#define LGFX_ONLY to expose the display config and edit the pins in the setup:

https://github.com/tobozo/ESP32-GifPlayer/blob/master/ESP32-GifPlayer.ino#L337

tobozo avatar May 09 '23 21:05 tobozo

does this look right to you?

#define LGFX_ONLY // enable this for custom board profiles
//#define USE_SPIFFS // requires "Large SPIFFS" partition !!

#if defined LGFX_ONLY
  #include <LGFX_TFT_eSPI.hpp>
  #include <SD.h>
  #define TFCARD_CS_PIN 4 // CS pin for SD Card
  //static lgfx::Touch_XPT2046 touch;
  static lgfx::Panel_ILI9341 panel;
  //static lgfx::Panel_ILI9342 panel;
  static LGFX tft;
  //#define HAS_TOUCH
 and 
 #if defined LGFX_ONLY
    Serial.begin(115200);
    
    auto p = new lgfx::Panel_ILI9341();
    p->spi_3wire = false;
    p->spi_cs    = TFT_CS;  // 14
    p->spi_dc    = TFT_DC;  // 27
    p->gpio_rst  = TFT_RST; // 33
    p->gpio_bl   = TFT_LED; // 32
    p->pwm_ch_bl = 7;

    tft.setPanel(p);
/*
    auto t = new lgfx::Touch_XPT2046(); // sharing SPI with TFT
    t->spi_mosi = MOSI; // 23
    t->spi_miso = MISO; // 19
    t->spi_sclk = SCK;  // 18
    t->spi_cs   = TOUCH_CS; // TOUCH_CS may be custom build spefific ?
    t->spi_host = VSPI_HOST;
    t->bus_shared = true;
    t->freq     = 1600000;

    tft.touch(t);
    

    auto p = new lgfx::Panel_ILI9342;
    p->reverse_invert = true;
    p->spi_3wire = true;
    p->spi_cs =  5;
    p->spi_dc = 15;
    p->rotation = 1;
    p->offset_rotation = 3;

    tft.setPanel(p);
    */
    tft.init();
    //tft.begin();

and where are these named?

    p->spi_cs    = TFT_CS;  // 14
    p->spi_dc    = TFT_DC;  // 27
    p->gpio_rst  = TFT_RST; // 33
    p->gpio_bl   = TFT_LED; // 32
    p->pwm_ch_bl = 7;

is it in a seperate file? or should i remove the "//" to define the pins

YosefGoodman avatar May 10 '23 18:05 YosefGoodman

and where are these named?

 p->spi_cs    = TFT_CS;  // 14
 p->spi_dc    = TFT_DC;  // 27
 p->gpio_rst  = TFT_RST; // 33
 p->gpio_bl   = TFT_LED; // 32
 p->pwm_ch_bl = 7;

nowhere, it's up to you to set the pin values depending on your configuration

There are more extended configuration examples on LovyanGFX repository.

tobozo avatar May 10 '23 19:05 tobozo