Author Topic: Using a Raspberry Pi as a display device for various web pages  (Read 1265 times)

0 Members and 1 Guest are viewing this topic.

Offline HalcyonTopic starter

  • Global Moderator
  • *****
  • Posts: 5975
  • Country: au
Using a Raspberry Pi as a display device for various web pages
« on: September 17, 2020, 03:37:33 am »
I want to build an "always on" display out of a surplus Raspberry Pi I have. Basically all I need it to do is display various web pages (and auto refresh at set intervals) in a neat and tidy arrangement (no menu bars, etc...).
If the Pi loses power, it needs to come back up without intervention and resume where it left off, preserving the window layout etc...

It'll be used for displaying things like weather radar, solar PV input/output and other telemetry from around the house.

Any ideas?

 
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3248
  • Country: us
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #1 on: September 17, 2020, 03:49:48 am »
Are you going to be running Linux?

Haven't booted up a RPi in a while, but if the Linux distro is still using an X11 server you can query and modify window locations from the command line:

https://stackoverflow.com/questions/252906/how-to-get-the-list-of-open-windows-from-xserver

https://stackoverflow.com/questions/1029027/x11-move-an-existing-window-via-command-line

and you can resize windows, etc.

Also -- a lot of Xwindows programs take a -geometry command line flag which sets its absolute pixel location and dimension:

https://en.wikibooks.org/wiki/Guide_to_X11/Starting_Programs#Specifying_window_geometry


« Last Edit: September 17, 2020, 03:53:38 am by ledtester »
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #2 on: September 17, 2020, 03:51:35 am »
 
The following users thanked this post: rx8pilot

Offline HalcyonTopic starter

  • Global Moderator
  • *****
  • Posts: 5975
  • Country: au
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #3 on: September 17, 2020, 04:00:36 am »
Yes I'll be running Linux.

Thanks MK14 -- "Kiosk" is the terminology I'm looking for.
 

Offline RenThraysk

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #4 on: September 17, 2020, 01:50:39 pm »
Yeah, kiosk for full screen web browsing, and dashboard the term for the displaying of metrics.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6952
  • Country: fi
    • My home page and email address
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #5 on: September 17, 2020, 06:14:45 pm »
This used to be so much easier in the times before systemd.

You see, you can use Python with Qt Webkit or Webengine to create an easily controlled web browser, and you can run Qt on top of X11, Wayland, or even the raw framebuffer.  So, all you needed was to remove the greeter, optionally start the X11/Wayland server before your application, and run your Python script as a dedicated user as a service.  With very little configuration, you could (under X11) get even accelerated video playback within the controlled web browser. Simples!

Most of the Python code is configuration (window location and such) and browser manipulation.  IIRC, the minimum browser implementation was something like a dozen lines or so.

Under systemd, the procedure is much the same, except that you must remember that systemd controls all, and that you must abide by its internal model of services, users, and sessions; and ensure the necessary dbus and systemd services are running, and so on.  Essentially, instead of a "kiosk", you must think of it more as a "single-user workstation" with an untrusted and limited user (but don't think of that user as a guest, because that invokes a different submodel in systemd; more like a passwordless login user).

Or, you can use one of the kiosk projects/templates, which have about as much security as a bag of marshmallows, because "security" is not something systemd design patterns ever consider; it's too hard to think about, they'll add it later, you see.

:rant:

Ahem.  Apologies for the rant.

As I have a few Linux SBCs, I've been asked to do a guide on how to prune Debian to secure kiosk use, maximizing maintainability, but ripping out all the systemd nonsense that are not suitable for small appliances or secure kiosks, then rebuilding one of the init systems with a fast boot and nice bootsplash/animation; but certain details jusk irk me too much.  (I've done this sort of stuff years ago for a couple of different universities, server and kiosk stuff, standalone testbenches for cluster tenders, etc.  I do claim I know this stuff.)

First is that I dislike RPi's because Qualcomm/Foundation hostility to Linux/GPL developers.  The second is that dropping systemd – which really is completely unsuitable for small appliances and secure kiosks due to its internal model of what should be happening (users, sessions, the entire dbus model) – usually causes a volley of negative comments and useless time-wasting discussion from people who do not understand the details.  (Simply put, systemd model is designed for workstation use, and does not really fit anything else at all; it's just shoe-horned to kinda-sorta work.  Like using a letter opener to drive a screw.  For what it is designed for, systemd works quite well for most users.  It is just an all-compassing userspace framework and model, not an answer to all problems.)



Q: If we ignore security for a while, what are the main differences between existing kiosk setups and a full DIY kiosk/appliance stack?

A: Control, versatility, and freedom.  You are not tied to any specific model, and have full control of the hardware.

If one of the existing kiosk/appliance projects suits your needs, and you don't worry about security, feel free to use those.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9935
  • Country: us
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #6 on: September 19, 2020, 05:10:10 pm »
The Raspian version of Linux used on the Pi does not respond well to power loss.  During a regular shutdown, you have to wait for the disk writes to complete before removing power.  Do some research on this because it may be a really big deal!  It likely applies to other Linux variants as well but I don't know that.  There's a lot of stuff on Google.

 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 914
  • Country: fr
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #7 on: September 22, 2020, 02:54:02 pm »
hi,
nowadays a backup power supply cost nothing if you want steadyness, I saw ups at 40 euros, new
there are no miracles on power loss, even superior devices can suffer from this
but if you can risk, try sw solutions like just some workstation on your pi with some basic scripting for app start-up
regards,pierre
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3644
  • Country: us
  • If you want more money, be more valuable.
Re: Using a Raspberry Pi as a display device for various web pages
« Reply #8 on: September 22, 2020, 07:32:28 pm »
Following - doing the same thing as the OP.

Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf