Raspberry Pi Week : Guestblog : Serve Your Message With a Slice of Pi

May 27

This weeks guestblog is brought to us by Daniel Messer, aka the Cyberpunk librarian. Find out more about Daniel, his podcast and his awesome website over at Cyberpunk librarian.Com


1740959_1558668224413538_2131227828_n

Digital signage is a passion of mine which is odd because, for the most part, I hate advertising. When you think “digital signs” you have to think about advertising because the two go hand and hand, right? You see them all over the place from your local big box store where they use monitors on end-caps to sell you stuff you don’t need to the trendy Apple store where they’ll use an iPad Air 2 as a digital sign.

 

That’s a baseline US$500 device sitting there. It kicked off the tablet revolution and ushered in a so-called “Post PC Era.” And there it is, bolted to a table, telling you why you’d want to buy a PC. That’s irony so thick you could spread it on toast.

But it doesn’t have to be this way.

As a public library webmaster, one of my jobs is managing the digital signs in our branches. I don’t create the content so much anymore, but I handle the tech side when needed. These things run off of small, dedicated PCs running Windows 7. Their administrative interface is lousy, the PCs are overkill as they’re rolling glorified PowerPoint presentations, and the big screen monitor and PCs kick out enough heat to keep you warm in the winter.

For the record, I live in Phoenix. We really don’t have a winter here.

When I first got my hands on a Pi, I knew this would be better for getting the library’s messages out on digital signs. They’re tiny, produce little heat, could be velcroed to the back of a monitor, and they run on free software. Diving into different software packages I played withScreenly OSE, Concerto, RiseVision, and others before landing on something I really liked — an idea I got at an airport.

The Phoenix Mesa Gateway Airport, aka AZA, uses Pis for almost all of their digital signs from the ones dropping ads to the ones that tell you when your flight departs and from what gate. Even the monitors beside the gates use Raspberry Pis to display the gate number, flight number, destination, and so on. I talked with a couple of their IT staff to find out what they used and the answer was surprising and refreshing.

They use a web browser. When you look at those signs, you’re simply looking at a website, in a browser, in full screen mode. The website refreshes itself every so often, and there’s a quick blank screen while it does this, but then you’re presented with the latest information.

I went back to my desk and got to work.

An old server bound for surplus found new life in our racks with an Ubuntu Server installation. I knew I’d have to do things slightly different as our library district covers a huge area while the airport covers a single large building. Instead of using the Pis to call a website, I’d have them bring up web content stored locally, but synced from the server.

I installed Chromium on the Pis because I like how easily you can feed it switches through a command line. That’ll be useful later. I also need to make sure that the screens don’t go blank or into power-save mode. Turns out there are a couple of ways to worry about this, but an easy way to handle it is to simply install XScreenSaver and then disable it.

My Pi OS of choice is Raspbian, which uses LXDE as its desktop environment. That’s excellent because to make all the necessary changes I just need to edit a couple of files, maybe three if you’re running the latest version. Opening up LXTerminal and then running

sudo nano /etc/xdg/lxsession/LXDE/autostart

I added the following lines:

@xset s off

@xset -dpms

@xset s noblank

@chromium --kiosk --incognito /home/pi/display/index.html

(Depending on your version of Raspbian, you might need to put the @chromium line in

/etc/xdg/lxsession/LXDE-pi/autostart

The other three can go in the first file.)

The first three lines disable all the screen blanking stuff that Raspbian would normally do, which forces our screen to stay on. The last one launches Chromium, in a full screen kiosk mode which. When you launch Chromium in incognito mode it won’t remember any previous shutdown errors and thus, never throws an error on startup. Then it displays my index.html in a local directory. Since we’ve put these in the autostart file(s), they will automatically happen when the pi user logs into the GUI. (Which you can set to happen immediately after boot up through sudo raspi-config.)

The index.html is simply a slideshow powered by JavaScript. It displays images, sized to fit the monitor’s resolution, and that’s it. It also refreshes itself every ten minutes to pick up new content.

But how to update it?

Since the geographic area covered by the library district is bigger than some east coast states, I wanted things to update quickly, in the background, on a schedule, while reliably pulling down the data and resuming the odd failed transfer. Fortunately, you can do all of that with rsync and cron.

Remember that old server now running Ubuntu? That’s the only place I update the code and content. I can change and add slides, modify the code, save everything, and ten minutes later all the Pi displays are updated. Here’s how that works:

On each Pi, I set up rsync to talk to the server. To do this without a password you need to set up a keypair for the Pi and the server. First thing to do is make sure ssh works between the Pi and server. If so, generate a keypair on the Pi using ssh-keygen. Don’t use a password to generate the keypair and don’t use sudo as the user pi will be doing all the work. Once you have the keypair transfer it to the server using:

ssh-copy-id -i ~/.ssh/id_rsa.pub user@servername

Replace the user@servername with the user on the server where you’re hosting these files. In this case, the syncing directory is under my own username, dan, in a directory called display.

ssh-copy-id will ask for your login password to the server and, if all goes well, that’ll be the last time it asks for it. Once the keypair is set up between the Pi and the server, you should be able to ssh and rsync without a password.

Now we’re ready to sync things up! Set up a cron job using:

crontab -e -u pi

This will launch nano and you can set up a cron job to call rsync as you like. Me, I do it every ten minutes. That means that, on the very outside, any change I make to the master files will take up to twenty minutes to reflect on the monitors in the branches. I could set it to go more often, but there’s nothing so critical as flight information on those screens. So my cron job looks like this:

*/10 * * * * rsync -az --partial dan@piserver:/home/dan/display /home/display/

Looking back, let’s see what we’ve built. We’ve got a Raspberry Pi, connected to a monitor in a remote location. It’s running a slide show through Chromium and all the content is local, so it comes up fast with no lag. That content is synced to a server via rsync running as a cron job and everything updates every ten minutes, both the browser and the content.

So in the end, we’ve used no software geared specifically towards digital signage. The digital sign is powered by open source operating systems, running open source software, on open source hardware. As a librarian into open access, that’s the kind of thing that really makes my day.

Related Posts

Reviewing Samsungs UD970 4k Display.

Sep 30

When Samsung offered us the chance to review the UD970 we didn’t have to think about it for long. Getting ones hands on a 4k monitor to gawk at was something we wanted to try out since the very moment Samsung presented the model at IFA in Berlin this year.

“Spec-porn”

The UD970 comes in a box .. a BIG box .. a box that is usually reserved for big things like snow plows, space shuttles and big tv’s. Granted , it would have been a bad idea to ship the 31.5 inch display in a paper bag .. So the big box was a good idea. The difference between the UD970 and a Snow plow is the fact that the former has a much higher resolution.  Where classic TV screens of this size have to find their limit at a resolution of 1920 by 1080 (Full HD) the UD970 goes almost up to infinity .. But not beyond. A 4k resolution of 3840 by 2016 means that ‘theoretically’ the screen real estate of a 31 inch 4K display is about the same as a 62 inch TV screen .. on a theoretical full HD resolution.  And it still fits on your desk (but it might not fit in your budget)

2014-09-25 06.54.15

We thought that we would be confronted with a behemoth of a box where you need to puzzle apart 24 pieces of styrofoam , but the UD970 is nicely packaged and taking it out we noticed the very simple and elegant design .  A stable base, slim neck and thin bezel mark the fact that this monitor not only shines in resolution, but also in design. When inspecting the ports we noticed that this monitor can also ROTATE !  Spontaneous hallucinations of ‘Triple screen portrait monitor setups’ flooded our mind .. But there would be limitations in our budget .. and the number of pixels both a graphics card and the human mind can handle … Without melting down in a puddle of high resolution 4k blubber.

UD970hero-1200-80

“Hooking it up”

Speaking of puddles .. getting this baby to work was a little bit of a challenge. We hooked it up to the latest and greatest 15 inch Macbook pro (with its high end graphics card) to see just how OK , 4K was … We had some trouble. Hooking it up to the Tunderbold display port with an HDMI adapter ( the UD970 has HDMI, Display port and classic DVI ports) we were disappointed that the maximum resolution we got was a mere 1600 by 900 (according to our Mac). This made the screen look bad. Fuzzy images and obese fonts .. not something we liked. Things got better after we hooked the display straight to our HMDI port .. The result was like staring into oblivion .. ‘Double-HD’ on this 31 inch display is massive .. So massive its hard to comprehend .. there is SO MUCH ROOM on your screen. Opening up ANY document to full-screen will be a thing of the past. The amount of screen real estate will have you working with tiled windows all the time since you can place so many of them. You will need to “crane your neck” from time to time since you need to cover the full 31 inches of screen right in front of your nose.

2014-09-25 07.21.26

“Not your average holiday catalogue”

The colours and crispness of the screen is very very good for a Samsung display. Where the Oled displays of their smartphones and tablets have over saturated colours and brightness (That make an obituary look like a summer holiday magazine) Samsung has “toned down” the “WHOOOW” factor to resemble something that is more toned towards reality. The matt display, high resolution, thin bezel and slick design give this screen the potential to match or even outclass Apple’s expensive cinema display line.

“Dinero mucho baby ? “

We haven’t received and official price yet but at the rumored 2000 dollars pricerange this screen is going to be outside the budget range of the average user. The high resolution does require a hefty graphics card (Even our Mac had some trouble) but what you get in return is pretty slick. We shipped the display back to Samsung with mixed feelings .. After getting used to it , i’m pretty sure I would miss the display if I had to miss it .. But I would also miss the car I had to sell in order to get the money to BUY the UD970 in the first place. This display is something for the high end users (or the ones without girlfriends who live in their parents basement). That way they can watch their own My Little Pony marathon on a massive display .. with crisp colors, sharp text, lots of ports and a slim base.

Now excuse us as we drudge back to our 14 inch CRT display with a maximum resolution of 640×480 and watch the world in 8-bit.

Link : The UD970

Related Posts

Column : Single display Simplicity.

Feb 15

If you ever watched the movie Wargames (I am showing my age here) or remember the scene inside the control room of the Nebuchadnezzar and you found your geek heart-rate quickening at the sight of all those screens … then you know what I mean when I say : “One display is never enough”.

Somehow, having a workstation with multiple computers blasting lines of random code onto several monitors surrounding a hyper-connected fast typing individual has something strangely appealing to it. More computers, more screens, more keyboards, more input, more data .. it somehow enhances our sense of power.

I remember the near fistfight scenario’s at the office where users would demand a dual-screen setup. They would vaguely think up scenario’s about the need to simultaneously run applications or compare data across the screen. The troglodyte rat-race that had prefaced this situation featured the urge to get “the biggest screen” in the office. Now there was a new kind of ‘hip’ in town .. the need to have TWO screens. Never mind if they needed it .. their neighbour had two .. so one screen was just not enough.

The domestic geek in the confounds of his own private dungeon is very much the same. ONE computer cannot be enough… you need SEVERAL machines. And since we are well on a roll on tilting the number of devices per user quota , lets add some tablets and smartphones to the mix .. shall we ?
So what you end up with is a complete over-connected bat cave with plenty of systems that you need to maintain. More screens then you can encompass, each displaying a separate part of your information streams (or each redundantly displaying the SAME information streams). Giant “waves” of notifications across all the different systems whenever you get a new reply on Twitter. Plenty of of keyboard-swapping and a dizzying amount of chair-swivelling. Yes : You have built a veritable mission control centre with enough machines to keep 5 people occupied, but you have a staff of one.

starbucks-and-laptop

So what if we go back to simplicity ? Last week, I had to confine myself to our kitchen table downstairs so I could keep my wife (who had the flu) company as she was sleeping on the couch. My “Mission Control Centre” sat unmanned upstairs. The only thing I had was my laptop, a notebook riser, an external keyboard and mouse .. and a pair of earphones. My geek universe shrunk to ONE 13 INCH screen. Can you imagine the horror ? 

So was it horrible ? Did I suffer information deprivation ? Did my fingers grasp the empty air where otherwise secondary (or tertiary) keyboards used to be ? Initially the answer was : YES. It took me quite  to squeeze all of my workflows onto one machine/display but after a couple of hours I started to enjoy it. I  have to admit , my personal digital architecture ( the way I have organised my Cyber Lifestyle) highly favours “sliding” from OS to OS , from machine to machine so I seldom have data or workflows locked down to one specific machine. I could cope with using just ‘one machine’ for a short time, but would it last ? 

To my own surprise I actually started enjoying it ! The “one machine” approach meant that I could  focus on what I was doing. The distractions were kept down to a minimum (Windows that I did not need simply remained closed) and notifications just came in ONCE on ONE system. When I closed down my email client, I did not get any mail notifications. I didn’t have to fight the urge to “check Twitter at a glance”. With fewer monitors and fewer systems I gained more focus then ever before.

On top of that, I got back some “intimacy” with my system. When there was a problem, or I needed to figure out how to do stuff , it was just on that ONE machine. It had been a long time since I experienced the feeling of having “one” computer that was “MY” computer and not just  “A” computer. This kind of “human-device” intimacy resulted in me taking extra good care of that machine. I tweaked it to my liking. It took me 25 minutes to find the right wallpaper and really ‘settle in’ on my machine,  instead of just ‘passing by’ and quickly rap on the keyboard before moving on. That one little computer became my ‘home’.

So I have learned something : More is not always better. I admit it is quite hard to do full screen video editing on a single 13 inch laptop but it does help you focus on the content. More machines means more maintenance, more distractions and more ‘distance’ from the machine. We loose not only the intimacy with “OUR computer”, we also lose the intimacy with the applications we have because we “bounce around” so much. We hop from phone to web interface, from mail client to tablet and loose any ‘deep knowledge’ of an OS or an application. We don’t seem to the time anymore, or better said : We don’t TAKE the time.

It felt refreshing to be back upstairs after a couple of days. Basking in the glow of all three 24inch displays, overlooking my digital horizon while leaning back with my hot cup of tea .. but somehow I missed my little excursion. Going back to the basics of one simple machine reminded me .. that sometimes less .. is so much more.

Related Posts

Keep an eye on your SSH server with this short command.

Oct 11

Setting up and running your own little SSH server is not really hard. Just punch in sudo apt-get install openssh-server on your Ubuntu command line and you’ll have a server that allows you to run remote commands, send over files via SFTP or even forward graphical applications over X-Forwarding.

R2

But when you open up a window to the internet, it might be a good idea to keep an eye on any nosy people who might come knocking. A good tip is NOT to run your server on the default port (22) and poke it up to a random port over 1024 so it won’t  be obvious to any scriptkiddie you are running an SSH server. But just to be safe its nice to keep an eye out too. Every system access is logged in /var/log/auth.log but there is a ton of info in here. But with this one simple command you can not only sort out the messages that talk about your SSH server, you can also “follow along live”

sudo tail -F /var/log/auth.log | grep sshd

The output will generate a cool scrolling textfile with all the failed and approved login attempts, the usernames of who is loggin in and when they connect and disconnect.  The command is simple .. but the output might be just what you need. 

Related Posts