Anthias icon indicating copy to clipboard operation
Anthias copied to clipboard

Assets are not loading, screen keeps black

Open HOEMichelR opened this issue 2 years ago • 50 comments

Overview of the Issue

Screenly fresh installed on Raspberry Pi 4 B - Assets are not showing up Screenly is starting with the Splash screen, I can load Screenly web interface, can add assets, but the screen still keeps black

Reproduction Steps

  • Installed the latest Raspbian Buster Image
  • Installed developer branch from Screenly: $ bash <(curl -sL https://www.screenly.io/install-ose.sh)
  • Considered all hints from #1389 especially @ealmonte32

Environment

  • Raspberry Pi Hardware Version: 4 B
  • Raspberry Pi Network Setup: LAN

WhatsApp Image 2022-02-22 at 09 32 22

I hope, someone can help me? Thanks in advance

HOEMichelR avatar Feb 22 '22 08:02 HOEMichelR

Is the time set correctly?

vpetersson avatar Feb 22 '22 08:02 vpetersson

Yes: Date

HOEMichelR avatar Feb 22 '22 09:02 HOEMichelR

@HOEMichelR Can you show us some of the logs right after you restart the system? please use pastebin or a text file and attach it rather than pasting all of the logs into the github comment window.

ealmonte32 avatar Feb 22 '22 15:02 ealmonte32

Here is an actual log file created with journalctl: LogFile.txt

Does Screenly have an own logfile itself?

HOEMichelR avatar Feb 23 '22 06:02 HOEMichelR

Update: I've tried the same installation routine with another Raspi 4B, but Rev. 1.1 -> it's working there, but with an older buster image (2021-01-11-raspios-buster-armhf-lite)

My Raspi with the problems is a 4B is Rev. 1.2 - on this one, the old buster image does not load: Raspi

So I took the latest one, but with this image I have above-mentioned problems.

HOEMichelR avatar Feb 23 '22 19:02 HOEMichelR

@HOEMichelR Ok, I see..

Well, I tested with the last buster version and end result worked. During initial installation, the following packages were not installed and are required, which you can manually install even before running the install script: python-backports.ssl-match-hostname python-backports.shutil-get-terminal-size

I also noticed docker-compose was missing so installed that too.

So flash the SD card with the version below and install these packages and then re-run of the installation which should be fast until it gets to the part that needs to build the containers, but it's a Pi4 so shouldn't be too bad.

So, again, download the latest buster version directly: 2021-05-07 raspios buster 64-bit lite Then follow the instructions above. If your Revision 1.2 Pi4B only functions with newer bootloader, we can even copy and paste the start*.elf files from the newer bullseye onto a buster SD card, but lets not do that type of workaround just yet, I also need to figure out why Bullseye is not installing properly and see if it's just installing the specific legacy packages that it needs and setting python2 as default interpreter.

ealmonte32 avatar Feb 24 '22 04:02 ealmonte32

Forgot to mention, if you do get it to load assets and everything but still have a black screen, you need to show the specific containers logs, not the one you sent me. To get the container logs type: docker container logs screenly_srly-ose-viewer_1

and send a screenshot of the results or text. since your web server is running and allowing you to add assets, etc, that means the server container is working so no need to get those logs unless the reason why it is black is because you are putting some pictures that might throw an error.

Does the screen show the default assets? Turn them on and test them to make sure that we isolate the problem.

Screen Shot 2022-02-23 at 11 28 00 PM

when you get the logs also give the logs for the server just in case, even though I think is the viewer which will show us the reason for black screen: docker container logs screenly_srly-ose-server_1

ealmonte32 avatar Feb 24 '22 04:02 ealmonte32

Thank you very much @ealmonte32 for your great support, but I couldn't establish a running version of Screenly with your instructions. This time, Screenly was not installed entirely, because there was no web server at all? Pi starts and after a about 10 minutes, screen goes black and the connection is lost (still with SSH no connection)

I followed your instructions:

  1. Took the image 2021-05-07-raspios-buster-arm64-lite and the Raspi startet without any problems
  2. Did $ sudo apt update and $ sudo apt upgrade
  3. Installed following packages $ sudo apt-get install python-backports.ssl-match-hostname $ sudo apt-get install python-backports.shutil-get-terminal-size $ sudo apt-get install docker-compose
  4. Installed Screenly (developer branch)
  5. Did a restart, and Pi stopped at login
  6. $ sudo plymouth-set-default-theme -R screenly -> comes with following error: 1

Pictures during install: 2 3

Trying to get Screenly log-files without success: 4

journalctl: LogFiles.txt

By the way: Within the log files I see following: Machine model: Raspberry Pi 4 Model B Rev 1.5 5 6

HOEMichelR avatar Feb 24 '22 14:02 HOEMichelR

@HOEMichelR

Hmm.. I think we just need to get the right steps in place because the only reason I mentioned some of those install commands was in case you get the errors I got and it did not hurt to install them, but I also wonder why you are trying to run the plymouth theme command? you dont need to do any of that, those were some troubleshooting commands when we were trying to figure out Pi4 issues with plymouth theme not loading, but that was resolved with simply the script reinstalling the plymouth package at end of complete installation.

When the pi started up properly right after the installation of the lite image, you normally should run sudo raspi-config to configure your pi for things like locale and memory, etc. Then you run the bash command with install script.

That fatal error on the ansible task "docker-ce" is a similar error I saw on one of my first tries with recent installs, although not that message you got about it being unavailable, but you need this package, so try sudo apt install docker-ce -y manually and then if it installs run the bash install script again, this should work and the docker commands would then also work, and the containers would be built.

Now that we know we can get the buster lite working on that Pi4, we know it's just a matter of properly installing all the required packages before the Screenly is operating normally. Let me know when you finish these steps.

ealmonte32 avatar Feb 24 '22 15:02 ealmonte32

Thanks @ealmonte32 for your patience, but I'm less than a linux beginner ;-)

  1. Took the image "2021-05-07 raspios buster 64-bit lite" and installed it
  2. Installed "docker-compose" and "docker-ce" as you mentioned above
  3. Installed Screenly via script $ bash <(curl -sL https://www.screenly.io/install-ose.sh)

Same result, no Screenly server/viewer are working. I tried it with/without docker, but with the same result.

How can I provide the installation output/logs to you? I can't scroll up or copy all the text. But I've made a video: https://1drv.ms/v/s!AqlgVE4L_3TngXfS6KLeWbLZuuYQ?e=bKU7Yv

HOEMichelR avatar Feb 25 '22 10:02 HOEMichelR

Some additional information: Web-Server was installed after all, because I can open Screenly via IP-Address remotely, but on the Raspi, Screenly is not started, only the linux shell is visible.

When I click to System Info: 1

I only get an error: 2

HOEMichelR avatar Feb 25 '22 14:02 HOEMichelR

Here are the log files from Screenly (installed with raspios-buster-armhf-lite - the one I originally used) Server.txt Viewer.txt

HOEMichelR avatar Feb 25 '22 14:02 HOEMichelR

After watching your video I see two issues, the docker-ce says unavailable when trying to install from ansible, which is a problem in itself, but you kind of solve that by manually installing it prior to ansible running.

image

But, I think the main reason your viewer keeps failing is because I see your errors say python3, Screenly was coded for python2, and even though some python3 commands/code work the same as python2, you will not be able to run Screenly with python3 being the default, not sure how your system defaulted to this. Other users that have reported this mention that they installed Raspbian OS bullseye, but I know that you installed buster so that wouldn't be the reason...

Do me a favor and type this in: sudo update-alternatives --config python

See if you can make it default to python2.7, and then run this file: ./screenly/bin/upgrade_containers.sh

One of the errors you can see is the docker container trying to be created for screenly viewer but it fails with error.

image

ealmonte32 avatar Feb 25 '22 17:02 ealmonte32

I get the message, that there are no alternatives for pyhton

But, when I type python --version, I get the result: Python 2.7.16

HOEMichelR avatar Feb 25 '22 17:02 HOEMichelR

I have 3 folders in /usr/lib:

  • python2.7
  • python3
  • python3.7

HOEMichelR avatar Feb 25 '22 17:02 HOEMichelR

When I take my second image (32 bit raspios-buster-armhf-lite) there is the same python version installed and also these 3 folders are existing; recreating the Screenly containers works there: Unbenannt But still not Viewer with assets is visible

HOEMichelR avatar Feb 25 '22 18:02 HOEMichelR

Ok, so the one where the containers were properly created doesnt give you python3 errors or docker-ce ones, ok good, now we can check why the viewer is still black.

First thing is, make sure you enable default assets on the Settings area of the Screenly web GUI. Then, in the command line type docker container logs screenly_srly-ose-viewer_1 You can press tab for auto-completion when typing commands.

Also, you can run docker container ls -a to show me the list of containers running or their status, because if they are not running then you wont see any logs.

ealmonte32 avatar Feb 25 '22 18:02 ealmonte32

Viewer logs: Viewer.txt There seems to be type mismatches

List of containers: Viewer seems to start again and again: 2

HOEMichelR avatar Feb 25 '22 19:02 HOEMichelR

The error about model number not found on the viewer logs would just return a Unknown Pi revision, that should not cause the error to prevent the viewer from starting, the actual reason why the script is not fully executing is the TypeError string integer one, and this usually means the line is being interpreted by a python version that doesnt take the code that way which is what leads me to believe python3 is trying to execute the entry.sh file rather than python2.7... but that requires some thorough troubleshooting.. I wonder if you remove python3 and all python3 packages, and reboot, to see if it defaults to that and all scripts run as that and that for now is your workaround..

ealmonte32 avatar Feb 25 '22 20:02 ealmonte32

How do I remove python3 cleanly?

HOEMichelR avatar Feb 25 '22 20:02 HOEMichelR

If you want to try and see if just adding your board revision manually would allow the entry.sh to run, you can easily do so by editing the raspberry helper file and adding your board version..

I write this just in case you want to learn to do this and are willing to try.

How do I SSH into a running container

    Use docker ps to get the name of the existing container.
    Use the command docker exec -it <container name> /bin/bash to get a bash shell in the container.
    Generically, use docker exec -it <container name> <command> to execute whatever command you specify in the container.

by reading the above, you should get an idea about what it is doing, basically you cant edit the lib/raspberry_pi_helper.py file outside of the container because it wouldnt make a change to the container that was already created/built and running, so what you want to do is get into that container and edit the file, save the file, close it, exit the container, and restart it.

so.. first, we go into the container: docker exec -it screenly_srly-ose-viewer_1 bash

this gets you to a shell inside the container, its ok if its running. then, while in the container you should get a command line shell#, in there we will use text editor nano to make the changes to the file. but first we need to install nano cause its easier for me to explain vs using Vi. so install nano by running: apt install nano -y

then when it finishes, run: nano ./lib/raspberry_pi_helper.py

then, scroll down all the way to the lines where you see the board versions and revisions.. now, since you dont really care for it to be the right info of the pi and this is just a test, you can go to any of the currently written models and change the board version from one of the ones that say Model 4B and change the board number on the left from the one b03114 to b03115, so you're basically telling the program that if it reads the board version b03115 which is the board you have, to just say it is a Model 4B, again we are just doing this as a test so that the helper file doesnt get an unknown model version, which again I dont think is the main error, but doesnt hurt to test. Once you make that change, press Ctrl+X and then press Y then enter, this should save the file in the current container. when you pressed enter you should be back at the command prompt/shell with #. Now you can exit by typing exit and pressing enter.

Then, back at the regular pi user shell, restart the container: docker container restart screenly_srly-ose-viewer_1 press enter.

what are the results?

ealmonte32 avatar Feb 25 '22 20:02 ealmonte32

How do I remove python3 cleanly?

run: sudo apt remove python3 -y

ealmonte32 avatar Feb 25 '22 20:02 ealmonte32

One problem might be encountered by removing python3 though, there is a possibility some dist-packages might be linked and removed.. so don't do that first, do the editing of the board revision thing first.. that way if that error comes back in the viewer container logs about TypeError then we know it isn't because of the new board not being recognized.

ealmonte32 avatar Feb 25 '22 20:02 ealmonte32

docker exec -it screenly_srly-ose-viewer_1 bash throws an error: Container is restarting, wait until the container is running

HOEMichelR avatar Feb 25 '22 20:02 HOEMichelR

removing python3 also did not solve the problem :-(

HOEMichelR avatar Feb 25 '22 20:02 HOEMichelR

docker exec -it screenly_srly-ose-viewer_1 bash throws an error: Container is restarting, wait until the container is running

So then viewer container is not even built, so the changes can be made in the actual ./lib/raspberry_pi_helper.py file while you are logged on as pi in the regular shell.. that way, when you build containers, it will be created with this revision already in them..

ok so the same instructions about editing the ./lib/raspberry_pi_helper.py file, but this time you need to edit it from within pi:

at the pi shell, edit: nano ./screenly/lib/raspberry_pi_helper.py

and then when done and saved, run the ./screenly/bin/upgrade_containers.sh script

ealmonte32 avatar Feb 25 '22 20:02 ealmonte32

I mean the container is built but it cant run/start since the error prevents it from starting properly, so make the changes that will then recreate the container with proper board revision in the file.

ealmonte32 avatar Feb 25 '22 20:02 ealmonte32

Did as you told me, but the container screenly_srly-ose-viewer_1 is still restarting

HOEMichelR avatar Feb 25 '22 21:02 HOEMichelR

I have the same problem with setting up screenly. i can confirm that it seems to be a problem with the revision 1.5. @HOEMichelR that is the revision you and i have if im not mistaken not 1.2. I have 6 raspberry pis sitting on my desk 2 of the 1.4-Version the rest with 1.5 When i set up the 1.4 ones everything works fine immediatly. The 1.5 versions all stay black after the splash screen. I can reach the interface, but it sometimes gives an internal server error message. When i try to go to sytem info this message shows up everytime. I also tried to put the sd card wich was set up in the 1.4-Pis into the 1.5-ones with the same effect. im using buster lite and the bash command to set up screenly. so bullsey doesnt seem to be the problem either.

nadinespiesse avatar Feb 26 '22 22:02 nadinespiesse

I understand the error message as follows: it expects an integer instead of a string 1 But why should this error occur with Pi in revision 1.5 and not in revision 1.4? The python code remains the same. I also added the new revision b03115 with no effect 2

@ealmonte32 I also tried to update the code file in viewer.py from media_player = VLCMediaPlayer() if get_raspberry_model(get_raspberry_code()) == 'Model 4B' else OMXMediaPlayer() to media_player = VLCMediaPlayer()

But that has no effect. I'm not a programmer, but I think the code file has to be compiled freshly.

Now I'd need help from professionals?

HOEMichelR avatar Feb 27 '22 16:02 HOEMichelR