spiff72 / WLED-Updates-TTGO

MIT License
2 stars 0 forks source link

blank screen of doom #2

Open Karbonforms opened 3 years ago

Karbonforms commented 3 years ago

Hi,

Is your TTGO usermod still working for you? Been trying for hours but just getting blank screen. Code is running OK, I added a few Serial.printlns to check. Test project with just TFT_eSPI works fine. I can't debug as the TTGO is missing a JTAG pin.

(also tried the u8g2 usermod on a suitable board and it also gives blank display)

PS using main WLED repo, I'm only here to contact yourself.

spiff72 commented 3 years ago

Hello,

Yes, as far as I can tell, it still works for me. Are you just seeing that the screen isn't showing anything, but connected LEDs work? Or are you powering it up and finding nothing on the screen and no LED activity?

I only ask the above because I have seen some issues/comments on the TTGO github page stating that powering the module with the 5v pin on the TTGO module is flakey. MOST of the time I have no issue, but sometimes when I plug mine in, it appears to be completely unreponsive (no LEDs, nothing on display). I can usually replicate it by disconnecting and reconnecting power (and possibly repeating the process a few times until I see the LEDs fire up and the display starts up with the "Loading..." text. I am trying to find that issue right now, but haven't been succesful yet. I will comment again if I find it...

Long story short - how are you powering it? My enclosure design uses a 12V power supply (with a DC barrel connector in the housing), and I run 12V power to a buck regulator that provides 5v power to the TTGO and a level shifter. The 12V power also continues through the enclosure to power my LED strips (I run 12V strips).

spiff72 commented 3 years ago

Also, I have recompiled the WLED main repo fairly recently (I am running V0.12.0 on a module i have behind me right now). I still haven't found the issue thread I mentioned above, but I did stumble on these (which may or not be useful): https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/17 https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/6 https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/27

spiff72 commented 3 years ago

Found the one I was looking for: https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/9

Some seem to have issues and others (including me) do not (at least not all the time).

Karbonforms commented 3 years ago

It's just on USB power. No LEDs attached. Just trying to get display working. Backlight is on. WLED otherwise working, connecting to wifi etc.

spiff72 commented 3 years ago

Ah OK. Did you follow all the instructions in the Readme section for getting it working (see link below)? https://github.com/Aircoookie/WLED/tree/master/usermods/TTGO-T-Display

I do all my work in VS Code, so the instructions may be specific to that environment.

Karbonforms commented 3 years ago

yes, I'm fairly sure I followed everything. copied over usermod.cpp and the pio ini overrides. as I say the usersetup() and userloop() are both called correctly.

Karbonforms commented 3 years ago

I even converted it to WLED usermod V2 system in desperation. same. class funcs called, blank black screen.

spiff72 commented 3 years ago

Hmm - let me try a fresh build here and confirm that it works for me on a "fresh" TTGO module. If it works, maybe I can send you the compiled .bin file to try? Not sure how to best send it if you want to try that path. Maybe send me a direct message with your email?

Karbonforms commented 3 years ago

Worth a try bud. Cheers for help.

I'm totally baffled with this. I was delighted when I discovered the usermod system and your code in WLED. I thought oh this is easy! I'll get this working then do my own stuff... That was yesterday, been baffled and trying all sorts ever since.

spiff72 commented 3 years ago

Well - I am seeing the same thing as you! I will have to do some digging to try to figure out what has changed (either WLED or maybe the TFT_eSPI library). This probably won't be a quick fix, unfortunately.

As you mentioned, it appears to be running. I was able to set up WLED via the AP it creates on first run, and set it up with a static IP, and connected to that new IP with my phone. So this is clearly something I need to fix.

Karbonforms commented 3 years ago

Excellent! Well, not really, but now I know it's not just me missing something!

Karbonforms commented 3 years ago

what was the WLED version when you originally wrote the mod?

spiff72 commented 3 years ago

I am not sure - I would guess it is probably at least 3 versions ago?

spiff72 commented 3 years ago

I found another issue thread on the TFT_eSPI repo where a user described a black scree on the TTGO display. I posted a comment there to fish for ideas.

spiff72 commented 3 years ago

Are you using VS Code as well? And just out of curiosity, are you running on Windows, Mac, or Linux? I just did this test on my relatively new Mac, and is the first time I tried to upload a compiled binary from VS Code on a Mac (previously all in windows or linux).

Karbonforms commented 3 years ago

CLion on windows

spiff72 commented 3 years ago

I have an update, but no solution for why the display isn't working.

I tried several things here with the code, including downloading v0.12.0 (the one i tried earlier grabbed a newer beta version of 0.12.1). My logic here is that I KNOW I have a running version of v0.12.0 in my house and one at work. Still couldn't get it working.

So I went and found a binary I compiled around the beginning of April which used v0.12.0. I flashed that via the manual OTA interface in WLED, and after it rebooted, it didn't look like it helped. Still a black screen. So then I tried unplugging it from the computer and plugging it back in, and I don't think that helped either. Finally I decided to try doing a factory reset (which erases the EEPROM of all the configuration), and after it rebooted from this, still nothing. But then I unplugged it again and plugged it back in and I had a functional display once again.

It seems like the factory reset was the trick (and either an unplug/replug afterward, or a reset with the side button on the board seems to work too).

Based on the above, I thought I would try recompiling again with the LATEST code, flashed it, connected to the AP and did the factory reset, but this didn't work. Uploaded the same older BIN file and factory reset, and back to a functioning screen.

I am going to try attaching this older v0.12.0 binary to this post to see if you want to give this a shot too. At least you can see that the code worked at one point! ;-)

esp32dev.bin.zip EEA34153-103F-4869-81A6-1BCF7A1C8FDE_1_105_c

spiff72 commented 3 years ago

The binary file can likely be uploaded with the espflash tool, but I was too lazy to find that for this new Mac.

Karbonforms commented 3 years ago

Yep, that .bin works. Damn it, I wish I knew where to start looking on this one.

Karbonforms commented 3 years ago

Tried with WLED 0.11.1 and TFT_eSPI 2.3.4. (nearest version at around 27th Dec 2020) Works. Though it's the older version of your mod. Also, I had to disable a bunch of crap in wled.h to get flash size below 100%. Not sure what that's all about.

Karbonforms commented 3 years ago

Tried with WLED 0.11.1 and up to date TFT_eSPI 2.3.70... Works.

spiff72 commented 3 years ago

Wait - so you compiled successfully using both the latest WLED and latest TFT_eSPI?

I am an amatuer coder, so not sure exactly how to do it with older versions (mixed), but was this also with the latest version of my usermod?

spiff72 commented 3 years ago

As far as I can tell, I used the latest WLED and latest TFT_eSPI when i first tried to compile yesterday, so not sure how you got it to work.

I also have never had to disable anything in WLED to get it to fit into flash - so that is odd too.

spiff72 commented 3 years ago

I have some other stuff to do this afternoon/evening, but I will take another look sometime over the weekend. I did merge some "dependabot" code yesterday into this repo, but I haven't done anything with the one that forked originally (I think that one is pretty outdated), so I think the last changes I made were adding the milliamp usage to the display...

Karbonforms commented 3 years ago

I deleted that post. User error. I'd switched to 12.1 by mistake and forgot to empty the build cache.

So...

Tried with WLED 0.12.0-b4 and latest TFT_eSPI... Works.

Karbonforms commented 3 years ago

Tried with WLED 0.12.0-b5 and latest TFT_eSPI... Works.

Right, so, in theory, next one should NOT work...

Karbonforms commented 3 years ago

My mistake, I missed one...

Tried with WLED 0.12.0 and latest TFT_eSPI... Works.

Karbonforms commented 3 years ago

0.12.1-b1 works as well. I'm officially confused. Lemme double check...

Karbonforms commented 3 years ago

Yep. A clean checkout of everything now decides that it works. Don't know what to think!

spiff72 commented 3 years ago

Well I am still stumped. I just cloned the current WLED repo through VS Code, made the necessary changes, and still get black screen.

One odd quirk about VS Code is that I have to edit the platformio.ini file (which includes uncommenting the depenency for the TFT_eSPI library), and save it. I think in the README file I stated that the act of saving this file should cause VS Code to download the necessary dependencies, but it doesn't seem to be doing that correctly anymore. So I have to then compile, let it fail, and then the dependent TFT_eSPI library will be there and I can make the adjustment to the user_select_setup file. It appears to be grabbing the 2.3.70 version (which is the latest).

When I looked at the github for that library, I see that a change was recently made (March 13) to adress a bug for the TTGO T-Display. "Bug occured when TFT_MISO is not defined (pin not used for TTGO T-Display)". Maybe that is related. I haven't gotten any comment from the dev on my comment where someone claimed they were getting the black screen.

spiff72 commented 3 years ago

I might have to switch to one of my windows PCs to see if that makes any difference - maybe the install of VS Code on the mac has issues.

Karbonforms commented 3 years ago

In CLion, the platformio plugin menu provides a "re-init" function which calls "pio project init", which parses platformio.ini and does all the downloading libs etc. The other day when using vscode, I was stumped trying to find the equivalent.

Here's a binary to try.
esp32dev.zip

spiff72 commented 3 years ago

Thanks - I tried that binary and I get the same blank screen behavior. I can still access the WLED interface though, and see that it is 0.12.1-b1. So strange. Am am actually wondering if this is a hardware glitch of some kind. I even tried the factory reset from the WLED interface and that didn't get the screen working either.

spiff72 commented 3 years ago

One more comment - I tried using the esptool.py for flashing bin files, and I still can't get your BIN to work. I even loaded the bootloader from WLED 0.9.1 and tried again. Still black screen (with the backlight on). I then flashed the BIN file I posted earlier and that one works fine... ugh.

yashmulgaonkar commented 2 years ago

Can confirm the blank screen with backlight on. Fresh download of WLED and TFT_eSPI.

Rambooka commented 10 months ago

I have an update, but no solution for why the display isn't working.

I tried several things here with the code, including downloading v0.12.0 (the one i tried earlier grabbed a newer beta version of 0.12.1). My logic here is that I KNOW I have a running version of v0.12.0 in my house and one at work. Still couldn't get it working.

So I went and found a binary I compiled around the beginning of April which used v0.12.0. I flashed that via the manual OTA interface in WLED, and after it rebooted, it didn't look like it helped. Still a black screen. So then I tried unplugging it from the computer and plugging it back in, and I don't think that helped either. Finally I decided to try doing a factory reset (which erases the EEPROM of all the configuration), and after it rebooted from this, still nothing. But then I unplugged it again and plugged it back in and I had a functional display once again.

It seems like the factory reset was the trick (and either an unplug/replug afterward, or a reset with the side button on the board seems to work too).

Based on the above, I thought I would try recompiling again with the LATEST code, flashed it, connected to the AP and did the factory reset, but this didn't work. Uploaded the same older BIN file and factory reset, and back to a functioning screen.

I am going to try attaching this older v0.12.0 binary to this post to see if you want to give this a shot too. At least you can see that the code worked at one point! ;-)

esp32dev.bin.zip EEA34153-103F-4869-81A6-1BCF7A1C8FDE_1_105_c

The code attached to this comment above is also working correctly on my TTGO board

When I compile the WLED with the user mod for the TTGO display, the TTGO board does nothing when powered up

I am using the TFT_eSPI "main" branch... I uncommented display 25 as shown

What version of the TFT_eSPI did you compile the attached firmware with ?

Rambooka commented 10 months ago

I just spent all afternoon trying to get WLED and the TTGO usermod working on my TTGO board...

Using WLED version 0.14.0-b4 and TFT_eSPI v2.5.0 Black Screen - not working (Latest of everything) Using WLED version 0.14.0-b4 and TFT_eSPI v2.2.0 Black Screen - not working Using WLED version 0.14.0-b4 and TFT_eSPI v2.1.4 Success

I dont have the time to investigate what has changed....

I am not sure of the official way to change the repos present in the WLED.pio\libdeps\esp32dev\ folder, as they dont come up in git extensions as submodules... So I just cloned the git repo for TFT_eSPI elsewhere and switched to version 2.1.4 and then copied the files overtop of the files in WLED.pio\libdeps\esp32dev\TFT_eSPI folder. Then cleaned the WLED project. Then compiled and uploaded the project to my TTGO

Maybe my efforts will help the author of the usermod to get it working with the latest TFT_eSPI ???

spiff72 commented 10 months ago

Give me a couple days to investigate. I haven't touched this code in a few years so I may be rusty!

I will post again when/if I find anything useful.

spiff72 commented 10 months ago

Quick update...

I just cloned the current WLED from Github and applied my changed usermod files (including all of the changes described in the Readme.md file). After uploading I am getting nothing either - nothing on screen, no lights, etc.

I just did some tests, loading the factory config file and test sketch via Ardino IDE and everything works there (display works). I then erased flash, and loaded WLED on it with the web installation tool, and once I changed the GPIO to pin 2 the LEDs are working.

So I have a bit more work to do here to figure out what changed (either in WLED or in the TFT_eSPI library) that is causing the issues).

For those of you having issues, did WLED work at all (just no display), or is it completely non-functional?

spiff72 commented 10 months ago

I believe that there is a way to force an older version of the TFT_eSPI library - let me check into that.

I just spent all afternoon trying to get WLED and the TTGO usermod working on my TTGO board...

Using WLED version 0.14.0-b4 and TFT_eSPI v2.5.0 Black Screen - not working (Latest of everything) Using WLED version 0.14.0-b4 and TFT_eSPI v2.2.0 Black Screen - not working Using WLED version 0.14.0-b4 and TFT_eSPI v2.1.4 Success

I dont have the time to investigate what has changed....

I am not sure of the official way to change the repos present in the _WLED.pio\libdeps\esp32dev_ folder, as they dont come up in git extensions as submodules... So I just cloned the git repo for TFT_eSPI elsewhere and switched to version 2.1.4 and then copied the files overtop of the files in WLED.pio\libdeps\esp32dev\TFT_eSPI folder. Then cleaned the WLED project. Then compiled and uploaded the project to my TTGO

Maybe my efforts will help the author of the usermod to get it working with the latest TFT_eSPI ???

spiff72 commented 10 months ago

OK - here's a workaround:

Follow all the directions in the usermod Readme.md file, but do the following in the platformio.ini file:

replace the commented line under lib_deps containing the TFT_eSPI requirement as shown below:

  #For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line
    https://github.com/Bodmer/TFT_eSPI/archive/refs/tags/2.1.4.zip

Instead of:

  #For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line
    TFT_eSPI
spiff72 commented 10 months ago

The above will force Platformio to install the older version of the TFT_eSPI library automatically.

You will still need to comment and uncomment the lines described in the usermod Readme.md file in the files within this library (just like you had to before).

spiff72 commented 10 months ago

In hindsight, I wish I had backed up all my presets, since I lost them during this troubleshooting process!

spiff72 commented 10 months ago

New Discovery: It appears that the default data pin for the LED strip is 16, which is used by the TTGO T-Display screen. My usermod mentions that I used pin 2 for my builds. I am digging around now trying to figure out if I can change the default data pin for the LEDs to be pin 2 via the usermod or the platformio.ini file...

I'm thinking if I can change this for the usermod, the latest TFT_eSPI might work.

spiff72 commented 10 months ago

More info:

#ifndef WLED_WATCHDOG_TIMEOUT
  // 3 seconds should be enough to detect a lockup
  // define WLED_WATCHDOG_TIMEOUT=0 to disable watchdog, default
  #define WLED_WATCHDOG_TIMEOUT 0
#endif

...and change the zero to a 3: #define WLED_WATCHDOG_TIMEOUT 3

Rambooka commented 10 months ago

Dammmm watchdog has caught me out lots of times on other projects !!