Using a Raspberry Pi as a display device for various web pages - Page 1
Forum section: electronics / general

author: Halcyon
author_rank: Unknown
timestamp: September 17, 2020, 03:37:33 am
content: 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?

author: ledtester
author_rank: Super Contributor
timestamp: September 17, 2020, 03:49:48 am
content: 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-xserverhttps://stackoverflow.com/questions/1029027/x11-move-an-existing-window-via-command-lineand 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

author: MK14
author_rank: Super Contributor
timestamp: September 17, 2020, 03:51:35 am
content: This link might help.https://pimylifeup.com/raspberry-pi-kiosk/

author: Halcyon
author_rank: Unknown
timestamp: September 17, 2020, 04:00:36 am
content: Yes I'll be running Linux.Thanks MK14 -- "Kiosk" is the terminology I'm looking for.

author: RenThraysk
author_rank: Regular Contributor
timestamp: September 17, 2020, 01:50:39 pm
content: Yeah, kiosk for full screen web browsing, and dashboard the term for the displaying of metrics.

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 17, 2020, 06:14:45 pm
content: 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.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.

author: rstofer
author_rank: Super Contributor
timestamp: September 19, 2020, 05:10:10 pm
content: 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.

author: perieanuo
author_rank: Frequent Contributor
timestamp: September 22, 2020, 02:54:02 pm
content: hi,nowadays a backup power supply cost nothing if you want steadyness, I saw ups at 40 euros, newthere are no miracles on power loss, even superior devices can suffer from thisbut if you can risk, try sw solutions like just some workstation on your pi with some basic scripting for app start-upregards,pierre

author: rx8pilot
author_rank: Super Contributor
timestamp: September 22, 2020, 07:32:28 pm
content: Following - doing the same thing as the OP.