ImpulseAdventure / GUIslice-Builder

Cross-platform drag & drop GUI builder for GUIslice
Other
163 stars 34 forks source link

ESP32 with TFT_eSPI Compile Errors #200

Closed GeorgeIoak closed 2 years ago

GeorgeIoak commented 2 years ago

Describe the bug When compiling a newly created project from the builder there are errors

To Reproduce Steps to reproduce the behavior:

  1. Create new project with the builder
  2. Edit --> Options --> General --> Target Platform --> set to tft_espi
  3. Make similar changes to code in Ide like described in https://github.com/ImpulseAdventure/GUIslice/wiki/Builder-_-Walkthrough
  4. Compile

Version

Additional context The first error I got was

"Config: GSLC_FEATURE_COMPOUND required for this program but not enabled. Please see: https://github.com/ImpulseAdventure/GUIslice/wiki/Configuring-GUIslice"

but I went into GUIslice esp-tftespi-default-ft6206.h and made the following changes:

  #define GSLC_FEATURE_COMPOUND       1   // Compound elements (eg. XSelNum)
  #define GSLC_FEATURE_XTEXTBOX_EMBED 1   // XTextbox control with embedded color
  #define GSLC_FEATURE_INPUT          1   // Keyboard / GPIO input control

even though I didn't find any instructions that say you need to do that. That did eliminate the first compile error.

The next error is this:

In file included from C:\Users\george\OneDrive\Documents\Arduino\GUIslice_Test\GUIslice_Test.ino:15:
GUIslice_Test_GSLC.h:39:4: error: #error Project tab->Target Platform should be tft_espi
   #error Project tab->Target Platform should be tft_espi
    ^~~~~
In file included from C:\Users\george\OneDrive\Documents\Arduino\GUIslice_Test\GUIslice_Test.ino:15:
GUIslice_Test_GSLC.h:42:10: fatal error: Fonts/NotoMono14pt7b.h: No such file or directory
 #include "Fonts/NotoMono14pt7b.h"

which I'm not sure if it's related to me using the NotoMono font in the builder or something else.

Hopefully this is something easy that I've overlooked.

Pconti31 commented 2 years ago

@GeorgeIoak changing user prefs won't change an existing project and the default is Arduino. When you first enter builder a new project is created as Arduino not tfte_spi. All future projects will be created targeting tfte_spi copying user prefs into project options.

I do need to first check new empty projects for user prefs changes and copy them to the project in the future so I'll mark this as a bug since you are not the first person to fall into this problem.

Anyway open your test project again and select the project tab that is beside the main page tab. Set target to tfte_spi save do another code generation.

It works this way so you can support multiple projects with different targets and when you reopen them the builder is using your project specific options. This way user prefs are used as a template when creating a new project but won't harm any previously created projects. Paul--

Pconti31 commented 2 years ago

One more thing roll back your changes to your config file for feature input to 0. As it tells GUIslice you want input by actual buttons not touch interface, The Xtextbox embed also isn't needed.

GeorgeIoak commented 2 years ago

@Pconti31 Good Morning, or at least it's morning here. I like the ability to change the project target but it wasn't clear where you change it for your current project but that's abundantly clear now. I think just adding that to your example walk through would help new users immensely.

I was pleasantly surprised when I saw that the builder had a few font options to choose from so I chose NotoMono and that's the next build error I'm coming across. I found that it will try to pull from Adafruit GFX Font directory but NotoMono isn't one of the fonts in their package. I can't seem to locate any information on the best practice for using some of the fonts listed in the Builder but I would have thought that anything listed would be added to your project.

What have I missed now?

GeorgeIoak commented 2 years ago

OK, a little more digging and at the end of the User Guide I found that I have to copy the font headers from the GUIslicer-Builder installation directory back into the Arduino library directories. I'm curious why those headers could not just be added to the project automatically? If you add them into the Arduino library directories then every time that library gets updated (which for TFT_eSPI happens a lot) those fonts will be lost, right? Another thought is maybe during the installation of GUIslice-Builder those fonts get added to the library folder or better yet when the code is generated and that way only the fonts you're using are copied. It would be best (if possible) to just keep them with the project though since it will be easy to that they're added.

The good news is that I was able to compile and upload to my board so that's progress. Unfortunately the touch is way off for my CTP but that's another issue I'm trying to work out with @ImpulseAdventure and a different issue.

I'll leave this open for right now in case "we" want to discuss the handling of the fonts a bit.

Pconti31 commented 2 years ago

@GeorgeIoak If you want to discuss fonts open a new issue here or a new discussion in GUslice discussions to get get Calvin involved. I don't like multiple topics in an issue that has for instance the title of ESP32 with TFT_eSPI Compile Errors it makes it hard for me to track things. Also note this is an open source project and you are welcome to help code the builder either by cloning and making a pull request or contacting me (my public email address is in my profile) and I would be happy to guide anyone into adding new and improved features.

I will close this issue myself when I do a repair that prevents what you experienced. Paul--

GeorgeIoak commented 2 years ago

@Pconti31 I completely understand about mixing issues and the fonts is a separate issue although I mentioned it because unless you figure out that you need to manually copy the font headers your compile will still fail if you selected a font that isn't part of the GFX or TFT_eSPI library.

Trust me, I'm almost the last person you want writing code for others to use, I've got just enough knowledge to do some serious damage!

Pconti31 commented 2 years ago

@GeorgeIoak Fixed in Release 0.17.b11. I did some experiments with creating a sub folder inside a project folder called Fonts and copied font headers used by the project there. Worked fine for Arduino IDE using Adafruit_GFX, TFT_eSPI, M5Stack and Teensy. However, I have no way to test PIO at the moment so that feature is not in this release. If you are still interested in this feature you can open a new discussion in GUIslice API Discussions and I will bump it up in priority. Paul--