Hi all,
for more that a week I am struggling to get the ILI9341 display working with ESP32 DevKit v1 and ESP Home.
The board is connected like this:
MOSI: GPIO 23
MISO: GPIO 19
SCK: GPIO 18
CS: GPIO 15
DC: GPIO 2
RST: GPIO 4
VCC (3.3V): 3.3V pin on ESP32
GND: GND pin on ESP32
LED: 3.3V pin on ESP32
In the Arduino IDE software, I am using the basic code for testing, if the display itself works fine or if it´s faulty. Everything works well, here is the basic code.
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <SPI.h>
#define TFT_DC 2
#define TFT_CS 15
#define TFT_RST 4
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(115200);
tft.begin();
tft.fillScreen(ILI9341_BLUE);
}
void loop() {
// Doing nothing
}
This code works well and the display lights blue after uploafing the code.
I am absolutely not able to do the same in ESP Home.
esphome:
name: esphome-web-786bac
friendly_name: ESPHome TFT display
min_version: 2024.11.0
name_add_mac_suffix: false
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
spi:
clk_pin: GPIO18
mosi_pin: GPIO23
display:
- platform: ili9xxx
model: ILI9341
cs_pin: GPIO15
dc_pin: GPIO2
reset_pin: GPIO4
rotation: 0
invert_colors: false
lambda: |-
it.fill(Color(255, 0, 0));
I have tried this option, but it is not supporting lambda function.
lvgl:
buffer_size: 25%
Tried these options separately, different data rates, also not helping:
data_rate: 20MHz
OR
color_palette: 8BIT
Tried different models, TFT, ILI, nothing working:
model: TFT 2.4
OR
model: ili9341
Wiring is OK as it works in Arduino IDE.
Still gives me errors in the log and I am desperate how to make it to work.
[22:57:49][C][logger:177]: Logger:
[22:57:49][C][logger:178]: Max Level: DEBUG
[22:57:49][C][logger:179]: Initial Level: DEBUG
[22:57:49][C][logger:181]: Log Baud Rate: 115200
[22:57:49][C][logger:182]: Hardware UART: UART0
[22:57:49][C][spi:068]: SPI bus:
[22:57:49][C][spi:069]: CLK Pin: GPIO18
[22:57:49][C][spi:070]: SDI Pin:
[22:57:49][C][spi:071]: SDO Pin: GPIO23
[22:57:49][C][spi:076]: Using HW SPI: SPI2_HOST
[22:57:49][C][ili9xxx:091]: ili9xxx
[22:57:49][C][ili9xxx:091]: Rotations: 0 °
[22:57:49][C][ili9xxx:091]: Dimensions: 240px x 320px
[22:57:49][C][ili9xxx:092]: Width Offset: 0
[22:57:49][C][ili9xxx:093]: Height Offset: 0
[22:57:49][C][ili9xxx:099]: Color mode: 16bit
[22:57:49][C][ili9xxx:108]: Data rate: 40MHz
[22:57:49][C][ili9xxx:110]: Reset Pin: GPIO4
[22:57:49][C][ili9xxx:111]: CS Pin: GPIO15
[22:57:49][C][ili9xxx:112]: DC Pin: GPIO2
[22:57:49][C][ili9xxx:114]: Color order: BGR
[22:57:49][C][ili9xxx:115]: Swap_xy: NO
[22:57:49][C][ili9xxx:116]: Mirror_x: YES
[22:57:49][C][ili9xxx:117]: Mirror_y: NO
[22:57:49][C][ili9xxx:118]: Invert colors: NO
[22:57:49][C][ili9xxx:121]: => Failed to init Memory: YES!
[22:57:49][C][ili9xxx:123]: Update Interval: 1.0s
[22:57:49][E][component:082]: Component display is marked FAILED
[22:57:49][C][mdns:116]: mDNS:
[22:57:49][C][mdns:117]: Hostname: esphome-web-786bac
[22:57:49][C][esphome.ota:073]: Over-The-Air updates:
[22:57:49][C][esphome.ota:074]: Address: esphome-web-786bac.local:3232
[22:57:49][C][esphome.ota:075]: Version: 2
[22:57:49][C][safe_mode:018]: Safe Mode:
[22:57:49][C][safe_mode:019]: Boot considered successful after 60 seconds
[22:57:49][C][safe_mode:021]: Invoke after 10 boot attempts
[22:57:49][C][safe_mode:022]: Remain in safe mode for 300 seconds
[22:57:49][C][api:140]: API Server:
[22:57:49][C][api:141]: Address: esphome-web-786bac.local:6053
[22:57:49][C][api:145]: Using noise encryption: NO
[22:58:43][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[22:58:43][D][esp32.preferences:114]: Saving 1 preferences to flash...
[22:58:43][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
Any ideas, what could be wrong?