0

I want to make own digital signage app.

  • I have Ubuntu server installed on RPi4B.
  • On that machine I serve the web application with frontend (React.js) and backend (Express.js) on the localhost.
  • This web application is remote control of the machine.

I want to make this application be able to force the Raspberry Pi to show some movie on it's display. If it will be possible - I can remotely steer my machine from every device connected to the same network as my RPI.

I tried to:

  • connect to ubuntu machine from other windows computer to executes mplayer - it didn't worked well - mplayer tried to show movie from Ubuntu local hard drive on Windows machine
  • use ubuntu-frame - but it has no effect and i don't have idea why - I used commands from official site:
snap install ubuntu-frame
snap install wpe-webkit-mir-kiosk
snap set wpe-webkit-mir-kiosk daemon=true
snap set ubuntu-frame daemon=true
snap set wpe-webkit-mir-kiosk url=https://YOUR_WEBSITE.com

but got errors:

ERROR: /build/mir-Cmm0ws/mir-2.7.0/src/server/graphics/default_configuration.cpp(224): Throw in function virtual const std::vector<std::shared_ptr<mir::graphics::DisplayPlatform> >& mir::DefaultServerConfiguration::the_display_platforms()
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: Exception while creating graphics platform
ERROR: /build/mir-Cmm0ws/mir-2.7.0/src/server/graphics/platform_probe.cpp(137): Throw in function std::vector<std::shared_ptr<mir::SharedLibrary> > {anonymous}::modules_for_device({anonymous}::ModuleType, const std::vector<std::shared_ptr<mir::SharedLibrary> >&, const mir::options::ProgramOption&, const std::shared_ptr<mir::ConsoleServices>&)
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: Failed to find any platforms for current system

Do you have any proposals how it could be done?

2
  • I don't know all of those complicated apps you're using, but you simply need to write a CGI script (it may be also in PHP or any other web scripting language capable of executing programs on the server) that runs mplayer on display :0 - assuming of course that the GUI on display :0 is up. The script will also almost certainly need to have XAUTHORITY variable set to the proper value, that needs to be taken from GUI session running on display :0. Or, if you don't want to run X on RPi display, run mplayer in framebuffer mode.
    – raj
    Commented Apr 11, 2022 at 21:25
  • Thanks to you I could search right things and found solution! My issue was just that I tried to do it 'by hand' in ssh terminal from windows machine. But when I made 'play.sh' script: bash #!/bin/bash export DISPLAY=:0 xset dpms force on mplayer -fs my_video.mp4 and saved it on Ubuntu's storage, and just do the source play.sh - then video showed up on Ubuntu's desktop! Commented Apr 11, 2022 at 22:02

1 Answer 1

0

That was quick! Thanks to raj I could search right things and found solution! My issue was just that I tried to do it 'by hand' in ssh terminal from windows machine. But when I made 'play.sh' script:

#!/bin/bash
export DISPLAY=:0
xset dpms force on
mplayer -fs my_video.mp4

and saved it on Ubuntu's storage, and just done the source play.sh - then video showed up on Ubuntu's desktop! Now I need to polish it, but finally got solution!

EDIT.

After some time i learned more about the case: If machine have properly set environment, GUI is working and mplayer is properly configured then script doesn't have to exports display and set dpms.

If everything properly set mplayer can be executed by your nodejs server or python backend or whatever you want. Just execute "mplayer [list_of_movies]" and it is working.

So my problem was not lack of knowledge how to run mplayer, but lack of knowledge about proper environment configuration.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .