Author Archives: eben

Camera board available for sale!

via Raspberry Pi

The camera boards are now available for order! You can buy one from RS Components or from Premier Farnell/Element14. We’ve been very grateful for your patience as we’ve tweaked and refined things; it’d have been good to get the camera board out to you last month, but we wanted your experience to be as good as possible, and we’ve been working on the software right up until last night. Thank you to Gordon and Rob at Raspberry Pi and to Dom Cobley for their work on the firmware (Rob also worked on the documentation); to JamesH for his work on the software; to the Broadcom Cambridge ISP team, particularly David Plowman and Naush Patuck, for volunteering to help with tuning; to Bruce Gentles at Broadcom for his volunteering to help with some of the initial bring-up; to James Adams at Raspberry Pi for running the hardware project, and everybody at Sony Pencoed for making it happen.

Tehzeeb Gunza at OmniVision coordinated things from their end, and helped us with sensor selection. Thanks also to Gert van Loo and Rob Gwynne for their work on the hardware design. (And thank you to Broadcom for letting us take advantage of your team’s willingness to volunteer for us!) This, for the curious, is the camera lab we’ve been borrowing from Broadcom for testing. The mannequin’s name is Veronica. She’s lousy company. The room gives us a calibrated and fixed target to use during tuning; it’s designed to be filled with examples of the sorts of things people tend to take pictures of. Which makes it a kind of creepy place to hang out. Between this and anechoic chambers, we’re getting the full range of testing chambers that give us the shivers.

Click to enlarge. You might be interested to learn that this was snapped with a Nokia N8, which uses an earlier version of the imaging core that’s in the Raspberry Pi (but a different sensor and optics).

For such a small device, this has been an enormous project, and a year-long effort for everybody involved. We’re pretty proud of it: we hope you like it!

How to set up the camera hardware

Please note that the camera can be damaged by static electricity. Before removing the camera from its grey anti-static bag, please make sure you have discharged yourself by touching an earthed object (e.g. a radiator or water tap).

The flex cable inserts into the connector situated between the Ethernet and HDMI ports, with the silver connectors facing the HDMI port. The flex cable connector should be opened by pulling the tabs on the top of the connector upwards then towards the Ethernet port. The flex cable should be inserted firmly into the connector, with care taken not to bend the flex at too acute an angle. The top part of the connector should then be pushed towards the HDMI connector and down, while the flex cable is held in place. (Please view the video above to watch the cable being inserted.)

The camera may come with a small piece of translucent blue plastic film covering the lens. This is only present to protect the lens while it is being mailed to you, and needs to be removed by gently peeling it off.

How to enable camera support in Raspbian

Boot up the Pi and log in. The default username is pi, and the default password is raspberry. (Note: if you have changed these from the default then you will need to supply your own user/password details).

Run the following commands in a terminal to upgrade the Raspberry Pi firmware to the latest version:

sudo apt-get update

Click to enlarge

sudo apt-get upgrade

Click to enlarge

Access the configuration settings for the Pi by running the following command:

sudo raspi-config

Navigate to “camera” and select “enable”.

Click to enlarge

Click to enlarge

Select “Finish” and reboot.

Click to enlarge

How to use the Raspberry Pi camera software

raspivid is a command line application that allows you to capture video with the camera module, while the application raspistill allows you to capture images.

-o or –output specifies the output filename and -t or –timeout specifies the amount of time that the preview will be displayed in milliseconds. Note that this set to 5s by default and that raspistill will capture the final frame of the preview period.

-d or –demo runs the demo mode that will cycle through the various image effects that are available.

Example commands

Capture an image in jpeg format:

raspistill -o image.jpg

Capture a 5s video in h264 format:

raspivid -o video.h264

Capture a 10s video:

raspivid -o video.h264 -t 10000

Capture a 10s video in demo mode:

raspivid -o video.h264 -t 10000 -d

To see a list of possible options for running raspivid or raspistill, you can run:

raspivid | less

raspistill | less

Use the arrow keys to scroll and type q to exit.

Extended documentation is available.

Note that we recommend that you change SSH password if you are using a camera, in order to prevent unwanted access.

How to stream video from the Raspberry Pi camera over a network

To view the feed on Linux

Install the dependencies by running the following in a terminal:

sudo apt-get install mplayer netcat

Find your IP address by running ifconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Run the following command in a terminal to view the feed using MPlayer:

nc -l -p 5001 | mplayer -fps 31 -cache 1024 -

To view the feed on Windows

Install and run Linux instead.

Find your IP address by running ipconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Download MPlayer.

Download Netcat.

Note that your browser may complain that these files are malicious, as they are unsigned executables.

Press the Windows key and the ‘r’ key simultaneously to bring up the “Run” dialog. Enter cmd.exe into the dialog and press enter/return to open a DOS prompt.

Enter the following command at the prompt to view the feed using MPlayer:

[Path to nc.exe]\nc.exe -L -p 5001 | [Path to mplayer.exe]\mplayer.exe -fps 31 -cache 1024 -

To view the feed on OS X

Download MPlayer.

Alternatively, you can download mplayer using Brew, which we recommend.

Find your IP address by running ifconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Run the following command in Terminal to view the feed using MPlayer:

nc -l -p 5001 | mplayer -fps 31 -cache 1024 -

To view the feed on a Raspberry Pi:

Find your IP address by running ifconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Run the following commands in a terminal on the receiving Pi:

mkfifo buffer

nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin buffer

To transmit the feed from the Pi with camera module attached

After setting up the “receiving” machine as per the instructions above, run the following commands in a terminal on the “transmitting” Pi:

raspivid -t 999999 -o – | nc [insert the IP address of the client] 5001

You can then use the commands listed in the “How to use the Raspberry Pi camera software” section above to change the capture time or to add a video effect.

How to submit bug reports or see the source code

You can see the source code and submit bug reports for raspivid and raspicam here.

PyPy on Pi

via Raspberry Pi

While we love all programming languages equally here at the Foundation, we do love Python an awful lot. Most users run their code under the “default” CPython interpreter, but over the last few years the PyPy project has made great strides in producing an highly compatible alternative interpreter with an integrated tracing JIT compiler. On x86 platforms this can improve the performance of some workloads by a factor of ten or more, and the PyPy team are now bringing the same sort of boost to the ARM world.

You can download an Pi-compatible alpha release of PyPy for ARM and see some benchmarks here. We’re proud to have been able to contribute a small amount of funding to the latter stages of this project; over the next few weeks we’ll be running an irregular series highlighting some of the other open source projects that we’ve been contributing to.

NetBSD is here!

via Raspberry Pi

In last week’s FreeBSD post, we linked to an early version of Nick Hudson’s NetBSD image for Pi. Nick has now released a new version which fixes a number of USB issues, and we’ve placed it in our mirror system. Of the major BSD-derived operating systems this only leaves OpenBSD (for which we’re not holding our breath).

Torrent rpi-20130124.img.bz2.torrent
Direct download rpi-20130124.img.bz2
SHA-1 5aac2d48d1a425db14b253d7bfddf5e24de5ca22
Default login Username: root Password: <none>

Nick says:

It’s a build of NetBSD-current which is the development version. It’s using a LOCKDEBUG kernel which is quite a performance hit, but will help us track down any locking issues.

Please leave any feedback in the comments!

Introducing the Pi Store

via Raspberry Pi

We’ve been amazed by the variety of software that people have written for, or ported to, the Raspberry Pi. Today, together with our friends at IndieCity and Velocix, we’re launching the Pi Store to make it easier for developers of all ages to share their games, applications, tools and tutorials with the rest of the community. The Pi Store will, we hope, become a one-stop shop for all your Raspberry Pi needs; it’s also an easier way into the Raspberry Pi experience for total beginners, who will find everything they need to get going in one place, for free.

The store runs as an X application under Raspbian, and allows users to download content, and to upload their own content for moderation and release. At launch, we have 23 free titles in the store, ranging from utilities like LibreOffice and Asterisk to classic games like Freeciv and OpenTTD and Raspberry Pi exclusive Iridium Rising. We also have one piece of commercial content: the excellent Storm in a Teacup from Cobra Mobile.

Pi Store menu

Applications menu

We hope that the Pi Store will provide young people with a way to share their creations with a wider audience, and maybe to a make a little pocket money along the way; as well as offering commercial developers an easy way to get their software seen by the Raspberry Pi community. To start with, we’ll be encouraging the winners of our Summer Programming Contest to upload their entries to the store. Anybody can submit their own project for moderation and release. You can choose whether to make your content free or paid: the store has a tip jar mechanism, so even if you’re not charging (and not charging will get you far more downloads), you still have the opportunity to make some money from your development work if people really like it. You can submit binaries, raw Python code, images, audio or video; and soon you’ll be able to submit Scratch content too. Raspberry Pi-related media of all kinds also has a place in the Pi Store – we’re carrying the MagPi, and hope to be able to host as many of your homebrew tutorials there as possible. We’re hoping to see everything, from hobbyist content to full-blown commercial software.

As ever with things Pi, the community is going to be key to making the Pi Store great. As well as submitting your own projects (and there are tools in there to help you get started, like free sprite packages for budding games developers), you can help us out by reviewing and rating the stuff you download. The Pi Store has a recommendation engine which is tailored to you and your preferences, so the more you review, the better the recommendations we’ll be able to offer you (and other users) will be. If you rate and review constructively, it means the really great content that gets submitted will percolate up to the top, where everyone can see it. If Liz rates games I hate highly (and believe me, she does: most of her favourite PC games have customisable half-elves in them), that’s no problem: the engine reflects your personal taste, and will learn that, displaying a different selection of recommendations for everyone, once enough ratings are in. We’ll also be adding achievements and leaderboards shortly.

Content page for Storm in a Teacup

Content page for Storm in a Teacup

An updated Raspbian image which includes the Pi Store is available from the downloads page. Raspbian users can add the Pi Store application to their existing install by typing:

sudo apt-get update && sudo apt-get install pistore

We’ll leave you with a video of Storm in a Teacup in action.

RISC OS for Raspberry Pi

via Raspberry Pi

We’re very pleased to announce the immediate availability of RISC OS for the Raspberry Pi. First released in 1987, its origins can be traced back to the original team that developed the ARM microprocessor. RISC OS is owned by Castle Technology Ltd, and maintained by RISC OS Open Ltd. This version is made available free of charge to Raspberry Pi users.

Steve Revill, from ROOL, shows off RISC OS on the Pi

Steve Revill, from ROOL, shows off RISC OS on the Pi

We really recommend a download; it’s very smooth, very fast to boot, and we’re delighted to be able to offer RISC OS for the platform. You’ll find a RISC OS image on the downloads page; and if you’re completely new to the OS, you’ll find Burngate’s  Stroll around RISC OS in pdf form very useful.