Error message

  • Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in include_once() (line 1389 of /Library/Server/Web/Data/Sites/Documents/jonathansblog/includes/bootstrap.inc).
  • Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in require_once() (line 341 of /Library/Server/Web/Data/Sites/Documents/jonathansblog/includes/module.inc).

Warning message

The service having id "facebook_widget" is missing, reactivate its module or save again the list of services.

Raspberry Pi

Pi Powered Presentation Screen

One of the first developments as Head Teacher at my new school, Ivy Chimneys Primary School is to introduce a large LED screen in the foyer area to display information about the school and to share children's work.

After a summer of exploring lots of digital signage solutions, many of which were very pricey and were either far too complex for what I needed to achieve, or didn't quite fit the bill.

My specification was simple:

* affordable solution, meaning high impact on learners, low impact on budget.

* the screen needs to reflect the life of the school, displaying key messages and to share children's work.

* maintaining the screen needed to be simple, so that uploading new 'pages' is quick and easy.

* both children and staff are able to administer the screen.

I'm a true believer in 'pupil voice' and the very reason schools exist is to provide opportunities for children to learn new skills. One of the best ways to achieve this is to involve them in the process of learning at every opportunity. I am also intent on building a community of learners who are thinkers and who are able to reflect on their successes and be self-critical on finding improvements too. 

When children feel success, they should have a place for celebrating and feeling proud of their achievements. This screen is just one of those places.

The Solution

It occurred to me that the Raspberry Pi costing just £25 coupled with a large 32" LED screen would be one of the cheapest options available. Of course the Raspberry Pi alone isn't the solution, because it is just the computer and operating system. The Raspberry Pi has several HUGE advantages:

- cost effective - only £25.

- tiny size (footprint no bigger than a credit card)

- negligible power consumption (just 2 watts)

- onboard HDMI graphics adaptor which makes connectivity very straightforward.

- runs Raspbian Wheezy which is a flavour of Debian - a very reliable operating system. 

I bought an LG 32" LED HD TV from Richer Sounds, Romford with a wall mount bracket. It has all the standard connections but of particular importance are the two HDMI connectors. A standard HDMI cable connects the Raspberry Pi to the TV. 

I did note that the TV also has a USB socket, which provides enough power to run the Raspberry Pi, but unfortunately this port only provides power when the screen is on, i.e. not in standby. A real pity since the whole project would then only need one 240v plug socket.

When I started this project, I knew I wanted children to be able to engage with the technology and an earlier decision was to display the Raspberry Pi rather than to tuck it carefully, out of sight, which would have been so easy to do.

Instead, I choose a transparent case, and mounted it on the wall beneath the screen. As you can see in the photograph, I have even labelled the ports to make the wall display as informative as possible. Only 1 week into the new term, and children have been drawn to want to find out more about how it all works.

Software

After much testing of different operating systems, starting first with the RaspBMC, I opted to run the Debian Wheezy installation. The RaspBMC is an XBMC Media Centre system which offers plenty of advantages. I initially used the Screensaver plugin to load images from a folder and present them based on the timing settings selected. This would be an ideal solution, especially since RaspBMC also supports AirPlay technology enabling the screen to take a AirPlay feed from an iPhone or iPad.

However, having found a similar solution using the X windows system in Raspbian Wheezy, I felt that I had greater flexibility in using the Pi to perform other tasks, not just the screensaver. I also had greater control over finding a mechanism of being able to access the folder of images across the network and reloading the image 'set' during the slideshow.

In the end, Raspbian Wheezy was the operating system of choice. I enabled a couple of options from the 

raspi-config page

Start desktop on boot? - YES

Enable SSH? - YES

Display

I discovered that an image viewer application called 'feh'  would be ideal for this project. Feh can run from the command line and has several configuration settings to tell it how to behave. Within the config you simply point feh to a folder from which to display images. Simple.

1. First install feh.

sudo apt-get install feh

2. To start the slideshow, simply run the command:

/usr/bin/feh --quiet --recursive --randomize --full-screen \ --slideshow-delay 5 /home/pi/frame/photos/

the commands are fairly self-explanatory. The digit '5' tells feh how many seconds to wait before loading the next image. 

Because the application 'feh' runs in the X windows environment (startx) the mouse cursor was visible on the screen whilst the photos were being displayed. I found a way around this, by installing 'unclutter'

sudo apt-get install unclutter

Uploading photos to Pi

This was solved by using a pre-packaged PHP application called KCFinder. What's really nice about this tool is its ease of install and simplicity of operation. All I wanted was a tool which was web based, enabling anyone with a web browser to upload & delete images on the Pi.

First I needed to install the Apache webserver.

apt-get install apache2

and also the PHP interpreter with GD for graphics support.

apt-get install php5-gdI then downloaded and copied across the KCFinder files.

I configured the KCFinder config file to ensure the upload directory was pointing to the same folder that feh used to load the images for slideshow.

Bingo! When I go to the Pi hosted web address of KCFinder, I can simply drag and drop images into the browser window to upload. What's more, as the images are uploaded, thumbnails are created which allows me to see which image is which.

I can also delete images from this folder, so when it comes to deciding which images to keep in the slideshow, this is quite straightforward.

 

One thing to be aware of, however, is that feh loads its images on startup, when the application is first run. This means that if you add images to the folder, feh doesn't know about them unless you restart the application.

This led me to script feh. I needed to do this for several reasons, one, so that it automatically starts on boot. Second, to enable me to restart after adding or removing images from the slideshow folder.

I ended up with two scripts. 

starting the slideshow:

#!/bin/sh
#
# Script to run Digital Signage Solution using Feh
# jonathan@learningspaces.net
#
# hide the cursor after 15 seconds
/usr/bin/unclutter -idle 15 &

# Start slide show
/usr/bin/feh --quiet --recursive --randomize --full-screen --slideshow-delay 7 /xxx/xxx/foyer/upload/files/ &

exit 0

 

reloading the slideshow:

#!/bin/sh
#
# Script to run Digital Signage Solution using Feh
# jonathan@learningspaces.net

#export DISPLAY=:0

# Stop the currently running Slide show

kill `pgrep -f "feh"`

sleep 10s

# Start slide show
/usr/bin/feh --quiet --recursive --randomize --full-screen --slideshow-delay 7 /xxx/xxx/foyer/upload/files/ &

exit 0

And that's it. That should give you a fully working digital signage system based on a simple slideshow of images.

There's more development that I'd like to explore, including using some push switches on the GPIO ports to run a set of scripts for perhaps displaying a particularly screen. Maybe the week's house points chart, or weather information etc. I also have a Pi Camera which I would like to hook up, and perhaps it could be accessed through pushing another button? Who knows. With the Raspberry Pi powering the screen, the possibilities are endless, unlike many of the corporate solutions which tend to be quite finite.

Exciting possibilities ahead. If you have a really fabulous idea to develop the Pi Screen further, do let me know by adding a comment below.

 

More products can be found on the Farnell website, see Vishay and Panasonic

Modifying Raspberry Pi volumes shared over AFP

I needed to find a way of accessing other folders on my Raspberry Pi other than just the standard "home directory"

I edited a file "/etc/netatalk/AppleVolumes.default"

and added the line:

/var/www                "WWW"

at the very end of the file, see below:

 

# By default all users have access to their home directories.

~/                      "Home Directory"
/var/www                "WWW"
 
The folder /var/www is now available through my AFP share as 'WWW' unsurprisingly!

 

Travel Tidy Cables

Whenever I travel with technology of any kind, I always find myself carrying a nest of handy cables and adapters. Clearly, when travelling light and with hand luggage, smaller and lighter are the two key words.

So here is my latest technical addition in that quest for light-weight and compact.

Raspberry Pi Retractable RJ-45 Ethernet Cable

Despite most hotels offering wifi solutions. I still find myself plugging in occasionally. This is exactly what you need. 

Raspberry Pi Power Supply

I've been running my Raspberry Pi server for the past 9 months now. It's been a tremendous success running server / device monitoring & downtime alert software called PHP Server Monitor. As the name suggests it is written in PHP which makes the software very easy to customise and tweak. Currently, PHP Server Monitor is configured to send emails when any one of the devices it is monitoring fails to respond. It also sends an email alert when the device becomes available again.

Here are just some of the devices being monitored. I have obscured IP addresses for security reasons.

Another piece of software running on the Raspberry Pi is 'thermd', a 1-wire device logging and graphing tool written in Perl. I have 1-wire temperature and humidity sensors dotted around my home and garden, monitoring freezer / fridge temperature, front room, upstairs, heating system temperature. Outdoors, I have data from outside temperature sensors, greenhouse, propagator, cold frame sensors. Coupled with a rain gauge and light meter, I have plenty of data points being made available across the Internet to my iPhone wherever I am. The home automation software also hooks into this data to make decisions on whether to heat the house, water the plants in the greenhouse, turns lights on etc. The Raspberry Pi is switched on 24/7 and is powered by the sun.

Here is the graph produced by thermd. This is just displaying temperature sensors located outside.

Solar energy is stored in large batteries and a 12V feed runs via a multi-way cigarette socket. The Raspberry Pi USB cigarette lighter adaptor is plugged in to this multi-way adaptor. You can find 12V USB chargers from most places, but I found this one by following this link to Raspberry Pi Power Supply

 

Networking with the Raspberry Pi - Apple File Protocol changing its name

When I installed my first Raspberry Pi and enabled the Apple File Protocol (AFP) so that I could connect to its file system from my Mac, all was well. It defaulted to using it's own name "raspberrypi"

However, with two Raspberry Pi's on the same network, I needed to identify them individually.

All that is required is a file to be added to the file:

/etc/avahi/services/afpd.service

If you don't have one of those, simply create it:

sudo pico /etc/avahi/services/afpd.service

and copy and paste the following:

 



   RPi-0
   
      _afpovertcp._tcp
     
548    

 

In the line beginning:   <name replace-wildcards="yes">%h</name>
replace the %h with the unique name you have decided upon:
 
<name replace-wildcards="yes">RPi-0</name>
 
 

Raspberry Pi and PiFace

My PiFace arrived last week and this was the first time I've had a proper play using it with the Raspberry Pi.

I needed to do some things first to get it working, and I thought I'd document it here for future reference. Your Raspberry Pi will need to be connected to the Internet for this install.

INSTALL

1. Firstly, the Raspberry Pi interfaces with the PiFace through SPI, so this will need enabling.

sudo pico etc/modprobe.d/raspi-blacklist.conf

Insert a # at the beginning of the line

 blacklist spi-bcm2708

like so
 #blacklist spi-bcm2708
 
2. Second, install the PiFace Digital libraries and change the permissions of the SPI interface. Luckily, running this command will automate the entire process.

sudo apt-get update

wget -O - http://pi.cs.man.ac.uk/download/install.txt | bash

And reboot your Pi once installed.

sudo reboot

TESTING

Use the PiFace emulator to test the input and outputs for the PiFace board.

You'll need to log back into your Raspberry Pi and start the GUI environment (startx)

Open the Terminal application and type:

piface/scripts/piface-emulator

This will enable you to test the inputs are recognised and the outputs software controllable.

USING PIFACE IN PYTHON

I was itching to begin controlling the PiFace board from within Python. I wrote a simple program to demonstrate it working.

import piface.pfio as piface
piface.init()
switch7 = piface.digital_read(7)
print switch7
if switch7 > 0:
   piface.digital_write(1,1)

This code simply switches output one on if switch7 is closed.

TeachMeet Essex (Chelmsford) - the home of professional CPD for teachers

I'm now very proud to have attended a TeachMeet Essex session held in Chelmsford, Essex. The host school, King Edward Grammar School (www.kegs.org.uk) was an amazing venue with its large tiered seating in the main hall. A delicious range of food had been prepared by the students themselves.

Nearly 200 teachers arrived for the 6pm start, with 20 presenters prepared to speak for 7 minutes (micro presentation) or 2 minutes (nano presentation.) The thing is, the batting order is entirely randomised through the use of the 'speaker fruit machine' - you only had a moments notice. Interesting.

The quality of the speakers was staggering and I would challenge anyone who could find another CPD event that could match the passion, dedication, knowledge, relevance shared, in just the 2.5 hours we had tonight.

I spoke about the use of the Raspberry Pi in the Primary Curriculum. This is a project that I'm already developing with Helena Gillespie at University of East Anglia. I'm also teaching our Year 5 & 6 cohort, programming using a range of programming environments, such as Scratch and Python.

If you are interested in what I said, you might like to look at my presentation (slides)

and / or

Watch the (then) streamed version of all the presentations at TeachMeet Essex

Finally, here is the Computer Science: A curriculum for schools document that I referred to at the end of my talk. This document was written by the Computing at School Working Group in March 2012. It is incredibly decisive and outlines the entire Computer Science curriculum for Key Stages 1, 2, 3 and 4. Well worth a read.

Wire-less Care-free Type-more Keyboard

For a while now, I've been searching for the perfect wireless keyboard. Not necessarily for any serious typing, a full size one is needed after all. However, there's something very neat about this particular keyboard, its size.

Originally I thought I'd use this for armchair control over my home entertainment system, a 24" iMac with wireless mouse. It means I can send commands and controls to the Mac using the key commands across the room using its Bluetooth connectivity. It works very well at this and I'm delighted with it.

I then tried pairing the keyboard with my iPad, iPhone, and now the latest, my little Raspberry Pi computer. The Raspberry Pi needs a bluetooth adaptor, but that was easy to source and hook up. Using an iPad 3 keyboard has made such a difference to typing information effortlessly.

What I love most about the keyboard is its function. It comes with a USB cable (for charging) and a small pouch with a lift-and-over end for securing the keyboard. A really nice device, perfect for use in the home and for traveling. Fab.

 

Subscribe to RSS - Raspberry Pi