Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected forced version number for TFT_eSPI #4423

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

spiff72
Copy link
Contributor

@spiff72 spiff72 commented Dec 24, 2024

in platformio_override.ini

platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be something like WLED_T-Display for the release name to indicate this is not a vanilla ESP32 build

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just fixed this - thanks!

Revised WLED_RELEASE_NAME to "WLED_T-Display"
Update platformio_override.ini
@@ -87,5 +69,7 @@ xtensa-esp32-elf-g++: fatal error: no input files
```
try building again. Sometimes this happens on the first build attempt and subsequent attempts build correctly.

Once the compilation is done and loaded onto the TTGO T-Display module, you may need to complete the initial setup of WLED via the AP interface, configure the WiFi settings, let it restart and then go to the LED preferences option in the WLED web interface. The Data GPIO pin needs to be set to pin 2 (or whatever pin you used), and then reboot WLED on the device. This should get the display working. I am unable to get the overrides to change the initial pin setting of 16 (which conflicts with the display).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"I am unable to get the overrides to change the initial pin setting of 16 (which conflicts with the display)."

@spiff72 using -D DATA_PINS=2 did not work?
Actually any build_flags for pin assignment will be overwritten by your cfg.json, so you'll need to wipe your device first if you want to test default pins assigned in build_flags.

; PIN defines - uncomment and change, if needed:
; -D DATA_PINS=2
; or use this for multiple outputs
; -D DATA_PINS=1,3
; -D BTNPIN=0
; -D IRPIN=4
; -D RLYPIN=12
; -D RLYMDE=1
; -D RLYODRAIN=0
; -D LED_BUILTIN=2 # GPIO of built-in LED

; -D IRPIN=4
; -D RLYPIN=12
; -D RLYMDE=1
; -D WLED_DISABLE_BROWNOUT_DET
;PIN defines - uncomment and change, if needed:
Copy link
Collaborator

@softhack007 softhack007 Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 27 might be part of the problem you had with default pins - platformIO is very picky about indentations, and a comment starting at column 0 might be enough to "end" the multi-line string prematurely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (hopefully)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that this issue has been fixed, and the data pin is being reassigned correctly.

Copy link
Collaborator

@softhack007 softhack007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In summary, it's still a bit unclear to me where the display driver flags are added.
As the usermod proposes a platformio_override.ini to be used for esp32, the buildenv in this override file should be focussed on what's needed to configure the usermod.

Also I'd like to have all debug outputs use DEBUG_PRINTLN() instead of Serial.println()

tft.print("mA (estimated)");
Serial.println("Print estimated current");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use DEBUG_PRINTLN for all debug outputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -92,10 +96,10 @@ bool displayTurnedOff = false;
void userLoop() {

// Check if we time interval for redrawing passes.
if (millis() - lastUpdate < USER_LOOP_REFRESH_RATE_MS) {
if (millis() - lastUpdate_mod < USER_LOOP_REFRESH_RATE_MS) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does USER_LOOP_REFRESH_RATE_MS come from?
I did not see it defined in the usermod (may I overlooked something)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's defined 5 lines prior (line 94)

#----------
# SAMPLE
#----------
[env:WLED_T-Display]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we define the pins needed by the display driver?
defines in the usermod are commented out, so there should be a different place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pins needed by the display are defined in the TFT_eSPI library when the user_setup_select.h file is modified (as described in the readme.md file).

; -D LED_BUILTIN=2 # GPIO of built-in LED
lib_deps = ${esp32.lib_deps}
#For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line
;TFT_eSPI @ 2.5.33
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any special reason that TFT library is commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the following line is forcing an older version (2.1.4) instead.

monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}

; # additional build flags for audioreactive
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part for audioreactive is outdated - please replace with the proposed flags from platformio_override.sample.ini

; Use Audioreactive usermod and configure I2S microphone
; ${esp32.AR_build_flags} ;; default flags required to properly configure ArduinoFFT
; ;; don't forget to add ArduinoFFT to your libs_deps: ${esp32.AR_lib_deps}
; -D AUDIOPIN=-1
; -D DMTYPE=1 # 0-analog/disabled, 1-I2S generic, 2-ES7243, 3-SPH0645, 4-I2S+mclk, 5-I2S PDM
; -D I2S_SDPIN=36
; -D I2S_WSPIN=23
; -D I2S_CKPIN=19

; ${esp32.AR_lib_deps} ;; needed for USERMOD_AUDIOREACTIVE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected.

@softhack007 softhack007 added the usermod usermod related label Jan 4, 2025
@softhack007
Copy link
Collaborator

@spiff72 another user has proposed some enhancements in

Maybe both PRs should be merged together?

@spiff72
Copy link
Contributor Author

spiff72 commented Jan 5, 2025

I'm sorry, but I'm not sure what to make of this one (or what you are suggesting). I see that the platformi_override_sample.ini for that usermod appears to define a lot of the things needed for the (different) display that board uses, but I think it's better to have the user edit the file in the library as called out in the readme.md file.

@spiff72 spiff72 requested a review from softhack007 January 5, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usermod usermod related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants