Launching belanaDash on a non-standard TFT screen (some success)

Hello Gurus,
I bought a cheap TFT 480x320 touchscreen from eBay advertised for use with Raspberry Pi 4. Understanding that there are some challenges there, I did make great progress and I’ll cover that. Challenge: I can’t seem to get past the balena logo being shown on the screen to show a web page specified in LAUNCH_URL environment variable. The logs say it’s showing, it’s just showing the logo (but hey, it’s showing something!).

To start, I was able to install my app, then manually copy over my overlay files to /mnt/boot/overlays as described in this post, from this repository.

./LCD-show/usr/tft35a-overlay.dtb /mnt/boot/overlays/tft35a-overlay.dtb (not sure if this was used)
./LCD-show/usr/tft35a-overlay.dtb /mnt/boot/overlays/tft35a.dtbo (or this, one of these)

Looking at the install script, I set these settings in the dashboard for the fleet (of one device, for now):


(these last ones where there by default I think)

Then, I was able to setup a Dockerfile to successfully show a picture of my cats (yeah!!) based on the same post mentioned above:

# minimum working test:
FROM balenalib/%%BALENA_MACHINE_NAME%%-node
RUN install_packages build-essential fbi
WORKDIR /usr/src
COPY gizmo-and-widget.jpg gizmo-and-widget.jpg
# thanks: https://forums.balena.io/t/unable-to-use-tft-ili9341-with-pi-and-resin/487/4
CMD fbi -d /dev/fb1 -T 1 --noverbose gizmo-and-widget.jpg && \
    while : ; do echo "idling..."; sleep 600; done

Result:


:smiley_cat: :smiley_cat:

I wasn’t able to configure some items from that reference install script e.g. it didn’t like the arm64 when attempting to install armf trouch screen script (will address and experiment separately, just trying to get things to show for now). It also required manual copy of the display overlay into the disk (is there a way around this?). Otherwise, success.

After that, I installed belanaDash and added LAUNCH_URL environment variable of https://unsplash.com/t/nature. I can see in the logs that the page was set via the kiosk. The screen remains as a logo.

Note: I did have the “rainbow launch screen” enabled at first (the logo shows, where’s the rainbow I love rainbows…), then disabled and rebooted with same results.

Any ideas on how to troubleshoot? The good news is that I have a running screen. Thanks for taking a look in advance! :slight_smile:

Hi there!
Sounds great that you’ve managed to get to the first screen and have it working!
I’ve used the exact same screen type and I’ve faced this problem as well. What is missing is setting an environmental variable and you can read about [using a PiTFT here] (https://github.com/balenalabs/balena-dash#using-a-pitft)
Since you are using BalenaDash you are also able to create a brand new image by using our Deploy to Balena button.
Please let me know how it works for you.
P.S. I also love rainbows

1 Like

Hello @georgiats,
Thanks for the quick response. I think I’m getting closer now based on your advise, still not quite there just yet. Here’s where I’m at:

I started a new app with the quick link found in the belana-dash repository. This really cleaned up any environment variables I had set on another app previously. Referencing this overlay var for PiTFT:

pitft35-resistive,rotate=90,speed=32000000,fps=60

I revised for my 3.5" display (after copying over tft35a.dtbo in /overlays folder):

tft35a,rotate=90,speed=32000000,fps=60

The result is that I see the green box splash screen (cool), followed by the belana-dash blue box with green border screen (also cool, guess that means the app started). However, it just stays on that screen and I don’t see anything else loaded e.g. the belana fleet default YouTube video.

The logs show that the YouTube video is loaded:

 photos  
 photos  > album-slideshow@1.0.0 start /usr/src/app
 photos  > node server.js
 photos  
 photos  GALLERY_URL not set, stopping express server.
 scheduler  crond[15]: crond (busybox 1.31.1) started, log level 8
 scheduler  crond[15]: time disparity of 67352 minutes detected
 kiosk  setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
 kiosk  Disabling config mode
 kiosk  Using default chromium flags
 kiosk  Using fullscreen: 480,320
 kiosk  2020/05/11 15:08:40 Command is '/home/chromium/launch.sh'
 kiosk  2020/05/11 15:08:40 Starting listening on port 8080
 kiosk  2020/05/11 15:08:48 Launch page with desiredURL = 'https://www.yout-ube.com/watch?v=08lH_hxug28'. Slack: false
 kiosk  2020/05/11 15:08:48 Redirecting to home page
 kiosk  2020/05/11 15:08:48 Running '/home/chromium/launch.sh https://www.yout-ube.com/watch?v=08lH_hxug28'
 kiosk  2020/05/11 15:08:48 Responded with home page

I wonder if Responded with home page has anything to do with this?

Thanks again for taking a look! I appreciate the feedback.

UPDATE: I’m getting the same results with a Raspberry Pi 3B+ (consistency is good!)

Hi there, great to hear that its almost working! If you modify the LAUNCH_URL variable to a different URL, does the same thing happen? After changing this variable make sure to restart the app too.

1 Like

Hello @rcooke-warwick,

I went ahead and set/overrode the LAUNCH_URL for the device. Then, I fully rebooted. So far I have the same result of the green/blue box. Here are the logs:

 scheduler  crond[15]: crond (busybox 1.31.1) started, log level 8
 kiosk  setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
 kiosk  Disabling config mode
 kiosk  Using default chromium flags
 kiosk  Using fullscreen: 720,480
 kiosk  2020/05/11 19:14:57 Command is '/home/chromium/launch.sh'
 kiosk  2020/05/11 19:14:57 Starting listening on port 8080
 scheduler  crond[15]: USER root pid  16 cmd run-parts /etc/periodic/15min
 photos  
 photos  > album-slideshow@1.0.0 start /usr/src/app
 photos  > node server.js
 photos  
 kiosk  2020/05/11 19:15:05 Launch page with desiredURL = 'https://github.com/'. Slack: false
 kiosk  2020/05/11 19:15:05 Redirecting to home page
 kiosk  2020/05/11 19:15:05 Running '/home/chromium/launch.sh https://github.com/'
 kiosk  2020/05/11 19:15:05 Responded with home page
 photos  GALLERY_URL not set, stopping express server.

Maybe I should try to create a photo gallery and see if that behaves differently? If I could get this to work, it would be ideal for upcoming creative experiments. Let me know what I can do to help troubleshoot further. I could go as far as device access and maybe some kind of video feed to see the screen?

Thanks again for taking a look.

Hi,

I believe I, too, have a similar 480x320 screen and got it to work with the BALENA_HOST_CONFIG_dtoverlay Custom Configuration Variable set to piscreen,speed=32000000,rotate=90. My balenaDash does not have the “Define DT overlays” set in the main Device Configuration settings in the dashboard (yours is set to tft35a:rotate=90). You seem to have plenty of memory committed to GPU (512), where my version running on an RPi3 is set to 396, so I’m thinking your close-but-yet-so-far may be related to the screen type.

Do you have a model ID on the TFT screen we could look into?

John

1 Like

Hello @jtonello,

Thanks for the note. Sure thing. Here’s the eBay link:

On the back of the hat:

3.5" RPI Display
480x320 Pixel 16bit
XPT2046 Touch Controller

Instructions say to go here:

and run this install script:

which copies over this file among other things:
https://github.com/goodtft/LCD-show/blob/master/usr/tft35a-overlay.dtb

If I switch from “Define DT overlays” to use BALENA_HOST_CONFIG_dtoverlay, I get the same results. Interestingly, if I swap tft35a for piscreen (piscreen,speed=32000000,rotate=90), I ALSO get the same results. That’s a good clue.

Thanks again!

Hi,

Did you try changing the amount of GPU, or has it always been 512?

You might also look into the specific service log(s), which you can view by going to the Application view in the dashboard, clicking on Releases, click on the top-most Succeeded deployment, and in the Build Logs panel select the service from the list. You can also add an environmental variable, DEBUG = 1 to get more detailed logs.

John

1 Like

@jtonello,

Good call. In the switch from “from scratch” and the quick setup link for belana-dash, I had not upgraded GPU from the default 128. I’ve updated to 512 (also tried 396 just in case). No success thus far.

I checked out the Releases section and build for kiosk looked great. Nothing concerning with the DEBUG option set so far.

I tried setting a Google photo gallery. I can access it remotely and it seems to work fine, with same display results (no change there). I can also access the PI via another computer to update the displayed URL with no change there.

Currently I’m playing with balena-wpe directly to see if there’s a difference. This is pending. I can post an update shortly. :slight_smile: I’m also looking into XPT2046 in general and will get back.

Update!

This is testing with balena-wpe (a portion of balena-dash):

Instructions here required me to set several other environment variables.

Granted, there’s lots of banding issues, I’m guessing something to do with my dtoverlay settings. It still needs tweaked. Progress though! I’ll keep digging and am open to thoughts.

UPDATE: Banding was due to UART and/or DT parameters not enabled (when switching to a new app).

Additional good reads:

https://www.raspberrypi.org/forums/viewtopic.php?t=143581

Hi Chris - nice work! Is everything work for you now?

1 Like

Let’s call this “good”. While I haven’t been able to get balena-dash up and running just yet, I do see a website! This is also such an edge case and there’s a way forward.

Thanks for all the feedback!