I’m trying to put together a public display to show the output power of a large PV system. The power measurement bit all works fine, so now I’m looking at the ‘minor’ matter of the public display. What I want to do is pretty simple. It’s just displaying some very big digits, possibly with a couple of logos and a small graph or two.
The idea is to mount the system high on a wall with no keyboard or mouse for user input. This is an output only program, taking a data feed via a file in /tmp. My hope is to plug an HDMI monitor into the Pi and use this as the display. (Access to the system for maintenance and development is by ssh and xrdp.)
Screen refresh will be every 15 seconds which hopefully won’t be too challenging, and this seems to be OK at the moment even on a Pi B.
I want to do this project on a Raspberry Pi so it will be cheap, and play nicely with the other open source energy bits and pieces I’m writing on the Pi.
Digging into the X documentation and online examples, my initial experiments have gone well, but all are based on examples which tell you how to do things the usual way, within windows, and on the display that’s in front of you. All the examples basically start XopenDisplay(), XcreateSimpleWindow(), then XmapWindow(). Subsequent calls to do useful things like write the text like XdrawString() take Display and Window as parameters. XnextEvent() is used to get things out of the message queue, with XcheckWindowEvent() called to see if there’s an event waiting. If there isn’t, I can check to see if the message I’m displaying needs updating, which matters to me far more than any of the standard X events, as in normal operation there shouldn’t be any.
At the moment I’ve got as far as an x11 application which runs in a window with lovely big digits, which I can see in my development environment over xrdp. See enclosed code.
There are a few things I need to know.
Can I force this to run on the (virtual ?) display which will output to the HDMI monitor ?
Do I need to do x11 graphics in the context of a window at all ? Is it possible to write directly to the display in the absence of any window ?
Do I have to read the X event queue ? I tried only reading it when XcheckWindowEvent() said there was something, but it would still sometimes block on the subsequent call of XnextEvent() which stopped the program looking for data updates to display.
To avoid the problem in 3) above, I’ve now taken out all references to the X event handling and the program seems to be doing pretty much what I need. Are there any downsides to this ? Will the program eventually become deranged if the event queue isn’t read ?
If I can force the program to send its output to the HDMI display, can I also remove all the other screen furniture from this display (login prompts, backdrops etc).
If 2) above isn’t possible, is it possible to make the window completely borderless so it can’t be differentiated from the background ?
Many thanks, J/.