Camera board available for sale!

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

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!

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

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

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.


New SD card image

An updated Raspbian “wheezy” SD card image is now available from the downloads page. This is a minor point release, adding support for the 512MB Model B and permitting arbitrary partitioning of memory between CPU and GPU by editing the gpu_mem property in config.txt.


Model B revision 2.0 schematics

Update: On Pete’s advice I’ve removed the caveat about the redundant pins on the GPIO connector. We’re committing to these remaining as power and ground pins from here on out. Damn my conservative hide :)

We are pleased to announce that schematics for the revision 2.0 Raspberry Pi Model B are now available here.

This post describes the key changes introduced in the new board revision. Note that although we have not yet exercised our option to add additional signals to the expansion connector, developers of expansion boards should continue to treat pins 4, 9, 14, 17, 20 and 25 as DNC (do not connect).


Model B now ships with 512MB of RAM

Update again: We’ve now added the ability to adjust the split between GPU and CPU memory with 1MB granularity, rendering the instructions in the previous update obsolete. Now you simply copy the updated firmware here, including the file fixup.dat, into your /boot partition. You can adjust the split manually by setting the gpu_mem property as described here.

Update: Those of you lucky enough to receive a 512MB Pi this morning can download updated firmware here. For example, download arm384_start.elf and rename it to start.elf on /boot partition. You will then have a 384M/128M memory split.

One of the most common suggestions we’ve heard since launch is that we should produce a more expensive “Model C” version of Raspberry Pi with extra RAM. This would be useful for people who want to use the Pi as a general-purpose computer, with multiple large applications running concurrently, and would enable some interesting embedded use cases (particularly using Java) which are slightly too heavyweight to fit comfortably in 256MB.

The downside of this suggestion for us is that we’re very attached to $35 as our highest price point. With this in mind, we’re pleased to announce that from today all Model B Raspberry Pis will ship with 512MB of RAM as standard. If you have an outstanding order with either distributor, you will receive the upgraded device in place of the 256MB version you ordered. Units should start arriving in customers’ hands today, and we will be making a firmware upgrade available in the next couple of days to enable access to the additional memory.

I’d like to thank our partners, RS Components and element14/Premier Farnell, and the suppliers, particularly Samsung, Sony and Broadcom, for all their help in delivering a smooth transition to the 512MB. I’m looking forward to seeing what you all get up to with your shiny new Pis.


Introducing turbo mode: up to 50% more performance for free

Since launch, we’ve supported overclocking and overvolting your Raspberry Pi by editing config.txt. Overvolting provided more overclocking headroom, but voided your warranty because we were concerned it would decrease the lifetime of the SoC; we set a sticky bit inside BCM2835 to allow us to spot boards which have been overvolted.

We’ve been doing a lot of work to understand the impact of voltage and temperature on lifetime, and are now able to offer a “turbo mode”, which dynamically enables overclock and overvolt under the control of a cpufreq driver, without affecting your warranty. We are happy that the combination of only applying turbo when busy, and limiting turbo when the BCM2835′s internal temperature reaches 85°C, means there will be no measurable reduction in the lifetime of your Raspberry Pi.

You can now choose from one of five overclock presets in raspi-config, the highest of which runs the ARM at 1GHz. The level of stable overclock you can achieve will depend on your specific Pi and on the quality of your power supply; we suggest that Quake 3 is a good stress test for checking if a particular level is completely stable. If you choose too high an overclock, your Pi may fail to boot, in which case holding down the shift key during boot up will disable the overclock for that boot, allowing you to select a lower level.

What does this mean? Comparing the new image with 1GHz turbo enabled, against the previous image at 700MHz, nbench reports 52% faster on integer, 64% faster on floating point and 55% faster on memory.

Previous image (2012-08-16-wheezy-raspbian):

BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)

TEST                : Iterations/sec.  : Old Index   : New Index
                    :                  : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT        :          222.08  :       5.70  :       1.87
STRING SORT         :          31.659  :      14.15  :       2.19
BITFIELD            :      7.1294e+07  :      12.23  :       2.55
FP EMULATION        :          44.808  :      21.50  :       4.96
FOURIER             :          2188.1  :       2.49  :       1.40
ASSIGNMENT          :          2.6545  :      10.10  :       2.62
IDEA                :          671.41  :      10.27  :       3.05
HUFFMAN             :           414.2  :      11.49  :       3.67
NEURAL NET          :          2.9586  :       4.75  :       2.00
LU DECOMPOSITION    :          77.374  :       4.01  :       2.89
=====================ORIGINAL BYTEMARK RESULTS=====================
INTEGER INDEX       : 11.414
FLOATING-POINT INDEX: 3.619
Baseline (MSDOS*)   : Pentium* 90, 256 KB L2-cache, ...
=========================LINUX DATA BELOW==========================
CPU                 :
L2 Cache            :
OS                  : Linux 3.1.9+
C compiler          : arm-linux-gnueabihf-gcc
libc                : static
MEMORY INDEX        : 2.447
INTEGER INDEX       : 3.192
FLOATING-POINT INDEX: 2.007
Baseline (LINUX)    : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, ..
* Trademarks are property of their respective holder.

New image, with 1GHz turbo enabled:

BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)

TEST                : Iterations/sec.  : Old Index   : New Index
                    :                  : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT        :           340.8  :       8.74  :       2.87
STRING SORT         :           47.52  :      21.23  :       3.29
BITFIELD            :        1.05e+08  :      18.01  :       3.76
FP EMULATION        :           66.32  :      31.82  :       7.34
FOURIER             :            3431  :       3.90  :       2.19
ASSIGNMENT          :          4.5311  :      17.24  :       4.47
IDEA                :          991.67  :      15.17  :       4.50
HUFFMAN             :          615.08  :      17.06  :       5.45
NEURAL NET          :            4.76  :       7.65  :       3.22
LU DECOMPOSITION    :          135.12  :       7.00  :       5.05
=====================ORIGINAL BYTEMARK RESULTS=====================
INTEGER INDEX       : 17.356
FLOATING-POINT INDEX: 5.933
Baseline (MSDOS*)   : Pentium* 90, 256 KB L2-cache, ...
=========================LINUX DATA BELOW==========================
CPU                 :
L2 Cache            :
OS                  : Linux 3.2.27+
C compiler          : arm-linux-gnueabihf-gcc
libc                : static
MEMORY INDEX        : 3.810
INTEGER INDEX       : 4.768
FLOATING-POINT INDEX: 3.291
Baseline (LINUX)    : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, ..
* Trademarks are property of their respective holder.

Other changes to the latest firmware include:

Temperature and frequency widgets

You can enable a core temperature widget for the lxde taskbar to see how close to 85°C you get (in the UK, it’s not very), and a cpufreq widget that will show the current ARM frequency when you hover over it. See here for more details.

USB interrupt rate reduction

We have enabled Gordon’s “FIQ Fix” in the USB driver, which reduces the USB interrupt rate, improving general performance by about 10%.

WiFi is now supported out of the box

If your WiFi driver is supported by the default linux tree, or is based on the popular RTL8188CUS chipset, then WiFi should work out of the box. Boot the image with the WiFi dongle plugged in (a powered hub is recommended). Run startx and select “WiFi Config”. You can scan for wireless networks and enter your wireless password and connect from the GUI. No need to install additional packages or scripts.

Improved analogue audio

Analogue audio quality has been improved.

Extra software installed by default

SmartSim and PenguinsPuzzle are pre-installed.

If you are using an older wheezy image, you can upgrade: “sudo apt-get update && sudo apt-get upgrade” will get almost all these improvements.

Thanks to MrEngman for his amazing work supporting users with various WiFi dongle, Dorian Peake for the cpufreq and temperature drivers, and Dmitry Dudkin for his work on the USB and SD card drivers.

Alex has started a forum thread for further discussion – pile in!


Upcoming board revision

Update: Added locations of mounting holes. Fixed minor error in I2C paragraph. Clarified expected use of P5 connector.

Update: A lot of people are asking when revision 2.0 boards will appear in the wild. They’ll be filtering out over the next month as the last stocks of the revision 1.0 at each distributor and in each geography are exhausted. I’m aware of at least one person who has received a revision 2.0 board already (from Farnell, in the UK).

We don’t believe that the changes are large enough to make it worth “holding on” for revision 2.0, unless you have a specific requirement to add an audio codec or you need mounting holes for some industrial application.

In the six months since we launched Raspberry Pi, we’ve received a lot of feedback about the original board design. Over the next few weeks, we’ll be gradually rolling out a new revision 2.0 PCB which incorporates some of the most popular suggestions. You can determine which board revision you have by typing cat /proc/cpuinfo at the command line and looking up the hardware revision code in the following table:

Model and revision Code(s)
Model B Revision 1.0 2
Model B Revision 1.0 + ECN0001 (no fuses, D14 removed) 3
Model B Revision 2.0 4, 5, 6

There has been a small change to the GPIO pin out of revision 2.0, to add ARM JTAG support and to present a different I2C peripheral from that which is (heavily) used on the camera interface. Users wishing to produce portable GPIO code should either avoid using the these pins, or add code to check the board revision and behave appropriately.

Reset

A reset circuit has been implemented, although in the standard build the required header is not fitted. Users wishing to use this circuit should fit an appropriate header to P6. Shorting P6 pin 1 to P6 pin 2 will cause the BCM2835 to reset.

USB Output Power

The resetable fuses protecting the USB outputs have been removed. This feature was implemented on some later revision 1.0 PCBs by replacing the fuses with links; revision 2.0 permanently implements this modification. It is now possible to reliably power the RPI from a USB hub that back feeds power, but it is important that the chosen hub cannot supply more than 2.5A under fault conditions.

JTAG Debug Support

Two GPIO pins have been interchanged to allow a missing debug signal (ARM_TMS) to appear on P1 pin 13.

Originally the connections were:

  • CAM_GPIO [BCM2835/GPIO27] routed to S5 pin 11
  • GPIO_GEN2 [BCM2835/GPIO21] routed to P1 pin 13

The new connections are:

  • CAM_GPIO [BCM2835/GPIO21] routed to S5 pin 11
  • GPIO_GEN2 [BCM2835/GPIO27] routed to P1 pin 13

I2C Support on P1/P6

The primary and secondary I2C channels have been reversed.

Originally the connections were:

  • SCL0 [BCM2835/GPIO1] routed to P1 pin 5
  • SDA0 [BCM2835/GPIO0] routed to P1 pin 3
  • SCL1 [BCM2835/GPIO3] routed to S5 pin 13
  • SDA1 [BCM2835/GPIO2] routed to S5 pin 14

The new connections are:

  • SCL0 [BCM2835/GPIO1] routed to S5 pin 13
  • SDA0 [BCM2835/GPIO0] routed to S5 pin 14
  • SCL1 [BCM2835/GPIO3] routed to P1 pin 5
  • SDA1 [BCM2835/GPIO2] routed to P1 pin 3

Version Identification Links

The four GPIO signals originally used for version identification have been removed. These were never read by the system software and were redundant.

Additional I/O Expansion

To utilise GPIO signals released by the removal of the version identification links, a new connector site P5 has been added. This carries the four GPIO signals [BCM2835/GPIO28 – BCM2835/GPIO31] named GPIO7 – GPIO10 respectively, along with +5V0, +3V3 and two 0V. Currently this connector is not populated.

This GPIO allocation provides access to one of:

  • SDA0, SCL0 (Operating independently of P1 SDA1, SCL1); or
  • PCM_CLK, PCM_FS, PCM_DIN, PCM_DOUT or I2S; or
  • Four GPIO signals.

This connector is intended to be a suitable attachment point for third-party clock and audio codec boards, and is pinned to be mounted (ideally) on the underside due to connector clash. Pin 1 is marked with the square pad (top left – looking from the top).

+5V0 Leakage from HDMI

Some users have found that connecting an unpowered Raspberry Pi to an HDMI television interferes with the correct operation of CEC for other connected devices. This was fixed on some later revision 1.0 PCBs by removing the ESD protection diode D14; revision 2.0 fixes this issue by connecting the top side of the diode to +5V0_HDMI.

SMSC +1V8

The SMSC 1V8 power has been disconnected from the system supply.

Mounting Holes!

Two 2.5mm (drilled 2.9mm for M2.5 screw) non plated mounting holes have been provided to assist with ATE test mounting. Positions of these holes relative to the bottom left of the PCB (Power Input Corner) are:

  • Corner: 0.0mm,0.0mm
  • First Mount: 25.5mm,18.0mm
  • Second Mount: 80.1mm, 43.6mm

Warning: If used to permanently mount the PCB – do not over tighten screws or drill out to fit larger screws, as this will lead to damage to the PCB.

LED Marking

Two minor changes have been made to the silk screen:

  • D9 (Yellow LED) graphic changed from the incorrect 10M to 100
  • D5 (Green LED) graphic changed from OK to ACT (Activity)