Sammlung von Newsfeeds

Raspberry Pi car computer

Raspberry Pi -

Raspbian running in the dash of a Ford Focus

Last century I spent weeks researching car computers. I wanted mp3s, videos and access to Notepad on the road. I wanted my car to respect and love me, just like KITT loved David. I wanted it to shout, “Right on tiger!” when I achieved an optimum MPG and to flash up encouraging messages like, “Hello Clive, might I say that you are driving very handsomely today” on a heads-up display.

Sadly it was never to happen. The reality was that you needed a PC the size of a coypu in the boot; an industrial 12/240v inverter; a 15″ CRT monitor strapped to your dash; and hawseholes in your bulkheads. And after a week of constant rebooting halfway through Captain Sensible’s Happy Talk, your hard drive failed because of the vibration and your battery discharged for good.  (I gave up and bought a 32Mb Diamond Rio and a hi-tech cassette adapter instead.)

Back in the 21st century, Derek Knaggs at Flamelily I.T has made the thing of my dreams: a low cost, low maintenance, general purpose car computer. There are other Pi-based car computers about but we especially liked this one because it’s simple, cheap and it looks like a factory fit. Very smart.

A quick swap of SDs and Raspbmc meets all of your multimedia needs

The Raspberry Pi is stored in the centre console and all wires routed underneath. Audio is fed through the aux socket of the car’s radio so no additional hardware is needed for this. A wifi dongle provides internet connectivity on the move via a mobile phone hotspot.

Neatly tucked away in the console — note the wifi dongle for internet on the move.

Full details including a shopping list are on Derek’s blog. I’m off to make one.

Taking Hi-Res Photos With The Pi Camera Module

Raspberry Pi Spy -

Taking photos with the Pi Camera Module is easy once you have plugged it in and made the correct configuration changes. In order to do this make sure you have read my Installing The Raspberry Pi Camera Module page.

Once you’ve completed the camera installation you won’t need to do it again and you can concentrate on taking photos and recording HD video.

Basic Photo Capture

Capturing stills is done using the raspistill command line utiltity and is as easy as typing :

raspistill -o myimage.jpg

This takes a photo which is then saved as “myimage.jpg”. By default the image is previewed on the screen and is captured after a 5 second delay. You can change the delay by using the “-t” option and supplying a time in milliseconds.

In the example below we take a photo with a delay of 3 seconds (3000 milliseconds) :

raspistill -o myimage.jpg -t 3000

This is a list of some of the more common options available when using raspistill :

-?,  --help      : This help information -w,  --width     : Set image width <size> -h,  --height    : Set image height <size> -q,  --quality   : Set jpeg quality <0 to 100> -o,  --output     : Output filename <filename> -v,  --verbose    : Output verbose information during run -t,  --timeout    : Time (in ms) before taking picture (if not specified, set to 5s) -th, --thumb    : Set thumbnail parameters (x:y:quality) -d,  --demo     : Run a demo mode -e,  --encoding   : Output format (jpg, bmp, gif, png) -tl, --timelapse  : Timelapse mode. Takes a picture every <t>ms -p,   --preview    : Preview window settings <'x,y,w,h'> -f,   --fullscreen : Fullscreen preview mode -n,   --nopreview  : Do not display a preview window -sh,  --sharpness  : Set image sharpness (-100 to 100) -co,  --contrast   : Set image contrast (-100 to 100) -br,  --brightness : Set image brightness (0 to 100) -sa,  --saturation : Set image saturation (-100 to 100) -ISO, --ISO    : Set capture ISO -vs,  --vstab     : Turn on video stablisation -rot, --rotation   : Set image rotation (90,180,270) -hf,  --hflip     : Set horizontal flip -vf,  --vflip     : Set vertical flip

To get a full list of options that can be used type :

raspistill | less

Scroll using the arrow keys and press q to return to the command line.

Depending on how you position your camera you may need to use the “-rot” option to ensure your photos are the right way around.

Time Lapse Photo Capture

Another great feature of the utility is the easy capture of a series of images over a specified period of time. You could write your own software to do this but for speed you can’t beat the time lapse options provided :

raspistill -o myimage_%d.jpg -tl 2000 -t 25000

The -tl option sets the time between photos (in milliseconds) and the -t option sets the total time the sequence will last. So in this example a photo will be taken every two seconds (2000ms) for a total time of twenty five seconds (25000ms).

In this example we take a photo every minute (60000 milliseconds) for a total time of 2 hours (60 x 2 x 1000 milliseconds) :

raspistill -o myimage_%d.jpg -tl 60000 -t 7200000

The “%d” results in a sequence of numbered images being produced. In this case you would get images named :

myimage_1.jpg myimage_2.jpg myimage_3.jpg myimage_4.jpg ...

If you change the “%d” to “%04d” you can pad the numbers with zeroes to always give four digits. I much prefer this as it gives you a sequence that looks like :

myimage_0001.jpg myimage_0002.jpg myimage_0003.jpg myimage_0004.jpg ...

Much neater!

As I experiment with the camera I will add other posts and cover some more advanced techniques but until then have fun!

Installing The Raspberry Pi Camera Module

Raspberry Pi Spy -

The Official Raspberry Pi camera module is here at last. The full specification can be found on my Official Raspberry Pi Camera Module page. This page aims to show how to get the camera connected and ready to go. Depending on the current state of your SD card this will take between 2 and 20 minutes.

Step 1 – Connect the camera to the Pi

The camera ribbon cable connects to the special connector on the Pi next to the ethernet port. The easiest way to see how the cable is connected is to watch this video. It’s fairly easy you just need to be careful you don’t crease the ribbon cable.

http://www.youtube.com/watch?v=GImeVqHQzsE

Step 2 – Update the SD card

In order to use the camera you must be using a recent operating system that knows that the camera exists. The easiest way to do this is to grab the latest Raspbian image from the RaspberryPi.org site and create a fresh SD card.

Regardless of what version of Raspbian you are using it is highly recommended to update the system using the following commands :

sudo apt-get update sudo apt-get-upgrade

Depending on how up-to-date your SD card is the second process may take a while.

Step 3 – Enable camera in raspi-config settings

Reboot. If you are using a fresh image the raspi-config utility should load. If it doesn’t then you can run it manually using :

sudo raspi-config

Sekect the “Camera” option and press “Enter”.

Select “Enable” and press “Enter”.


Select “Yes” and press “Enter”. Your Pi will reboot.

Updating your operating and enabling the camera using raspi-config did two things. It told your Pi that there is a camera attached and it added two command line utilities.

  • raspistill
  • raspivid

These allow you to capture still photos and HD video respectively.

You are now ready to start having fun!

Long term, deep water, satellite connected ocean monitoring system

Raspberry Pi -

Conservation, hackspaces and Raspberry Pis. And sharks. How could this not be the blog of the day? Gary Fletcher of ZSL sent us this report.

Marine Conservation Camera

ZSL have developed low cost cameras to monitor marine biodiversity in large marine protected areas (MPAs) using the $35 Raspberry Pi single board computers and standard webcams and running opensource Motion tracking software. ZSL reached out to UK hackspaces to help design the cameras and achieved unprecedented economy and features.

 Why Raspberry Pi?

Traditionally it has been incredibly difficult to capture events underwater – all of the usual apparatus such as PIR/heat, infrared and ultrasonic sensors simply do not work underwater. The Raspberry Pi literally opened up a new door with its low power consumption and processing power. It allowed us to deploy a solution which really fits the bill and without it would have been very troublesome to achieve!

Hardware

Each camera was deployed on an anchored buoy. Mounted directly onto the buoys were two solar panels for charging two deep cycle 90Ah lead-acid gel batteries, the aerial, and a waterproof box containing the communications system. This was then connected to a 50m SWA cat-5 cable running down to the pressure vessel containing the camera itself.

Pressure Vessel

The cameras are designed to operate at depths between 20 and 50 meters. Rlab’s (Reading Hackspace) Ryan White suggested basing the design around a clear polycarbonate tube, with machined HDPE end caps secured by threaded rods and double o-rings. One end-cap had a threaded hole which SWA cat- 5 cable was run though, anchored to the inside and then potted. This cable runs the power and communications.

BuildBrighton’s Mike Poutney and Paul Strotten machined the endcaps on their lathe and offered some great technical advice which was very well received.

The outer pressure vessels easily survived a 100m pressure test in a hydrostatic chamber. It should go significantly deeper had the internal structure not failed at that point.

Internal Structure

Rlab’s (Reading Hackspace) Barnaby Shearer designed the internal support structure. This was laser cut from 3mm acrylic. The designs were done in 3D in OpenSCAD to check all the components fitted together, then projected into 2d for laser cutting. The acrylic was glued with tensol.

Cable waterproofing

The junction box was 3d printed and then sealed using potting compound and left to dry for some time also forming a mechanical join between the inside and the cable gland.

Communications

Attached to the buoy in a waterproof case was a Raspberry Pi to coordinate the communications. This had an Ethernet link to the Raspberry Pi in the pressure vessel. It also had a WiFi dongle running in access point mode to allow easy monitoring and reconfiguration form the research vessel. The Pi also has a serial connection to an Iridium satellite modem so it can stream pictures of the images captured.

The satellite image transfer software was specially developed by Cambridge Consultants and the equipment and satellite bandwidth for this trip was kindly sponsored by Iridium.

Electronics

Attached to the bottom Pi was an Eve board to provide the Pi a RTC and a temperature sensor. Also attached was Ciseco’s Humble Pi hosting an AVR and a mosfet to to turn the Pi off at night (and critically back on each morning). This Pi wake was developed by Miles and Matt from Ciseco, who make an amazing range of Raspberry Pi and microelectronics and are well worth a look – http://www.ciseco.co.uk/

These boards were slightly modified to handle a HackHD camera via the AVR so we could capture high definition footage as well as stills.

The boards were assembled at Nottingham Hackspace.

Camera

The camera used is the Microsoft LifeCam Cinema HD, a cost effective camera conforming to the UVC specification. The only gotcha proved to be that it seems to only respond to a few ‘magic’ exposure settings (5,10,20,39,78,156,312,625,1250,2500,5000,10000,20000), and you have to wait 100ms and reset the brightness after any exposure change.

Software

Rlab (Reading Hackspace), Gary Fletcher and Doug Snead provided a simple command line program to control the camera, and a slimmed down version of MJPEG-Streamer optimized for this camera and with some additional time stamping.

This stream then fed into Motion which starts saving the frames as JPEGs after it detects an event. The JPEGs are then rsynce’d up to the top Pi (backups are always a good thing). ImageMagick then thumbnails and montages the images for efficient sending over the (slow) satellite link.

Stereo Vision

The project did spur off onto some stereo vision development work with Doug Snead and Gary Fletcher but could not be completed in time for deployment. It was hoped that it would be possible to develop this solution as so it could automatically size the passing fish to add to our conservation data.

Image showing the accurate sizing of a fish tied to the ceiling flapping in front of an oscillating fan.

What did it Look Like

The deepest ever Pi?

At 50 meters deep – could this be the deepest Pi to date?

Where was it Deployed?

The system was tested at ZSL in London Zoo behind the scenes and then went onto to open Ocean tests in the largest marine protected area in the world, the Chagos Archipelago.

Gary Fletcher and Barnaby Shearer the camera at ZSL London Zoo, behind the scenes

Results

Well as you can see the results speak for itself, but there is still quite a lot of development work to do but once these sentient units are complete, it will offer a low-cost monitoring system that, when deployed as a network, will greatly expand ocean areas that can be observed.

For those that would like a little further reading on the actual deployment, please have a look here on the Chagos Trust website http://chagos-trust.org/projects/latest/feb-2013-expedition/battling-heat

Acknowledgements

Gary Fletcher, Barnaby Shearer, Ryan White, Richard Ibbotson, Doug Snead, Paul Strotten, Mike Pountney, Miles Hodkinson, Matt Lloyd, Adam Markwell, Gary Fletcher Senior, Anna Fletcher, Charles Turner, Marty Morriss, David Curnick, Matthew Gollock, Heather Koldewey, Alasdair Davies, Charles and Anne Shepard, Yannick Mandarin, Ronan Roche, Reece Pitts, Richard Traherne, Marion Campbell, Jonathan Pallant, Ant Skelton.

Raspberry Pi boot

element14 Raspberry Pi Blog -

Hi, Ive just bought a new Raspberry Pi RevB and Im wondering if it is possible to boot it from a USB flash drive instead of an SD card.

 

If its possible could someone elaborate on how to set the Pi to boot like that please.

The Raspberry Pi Cluster

element14 Raspberry Pi Blog -

Joshua Kiepert at Boise State has built a cluster using 33 node Beowulf cluster using Raspberry Pi. Full details of the build are on the Boise State website and Joshua's Youtube video explains in detail how the build was put together.

 

 

 

Have you entered element14's Raspberry Pi competition yet? Submit your pictures now and you could win Raspberry Pi accessories! Details here.

Raspberry Jam at the National STEM Centre York, Saturday 8th June 2013

Raspberry Pi -

A post from Mr Raspberry Jam himself, Alan O’Donohoe.  This one promises to huge and fabulous, and the National STEM Centre is an outstanding venue. I am strangley drawn to joining the trans-Pennine convoy from Preston.

“You may have seen that we are holding a big Raspberry Jam in York on Saturday 8th June, 3 weeks today. Tickets are available here.

I’ve been working with the folks at the National STEM Centre there to help establish a presence in Yorkshire for Raspberry Jams. There are a lot of people in Yorkshire who have bought Raspberry Pi computers or who have not bought one but are interested in discovering just what you can do with them and this event is to give them a taste of the Raspberry Pi.

This event is going to be much larger than our regular Raspberry Jam events and we know that people  are travelling from far across the UK to attend. I will be travelling in a convoy of cars from Preston bringing old friends and new friends on the journey across the Pennines. Road-trips like these add an enormous amount to the whole experience.

Our busy programme of talks, demonstrations, stalls and hands-on classes is now filling up. We are delighted to have Pete Lomas of the Raspberry Pi foundation speaking and leading a workshop, he is the gentleman who actually designed the Raspberry Pi. We also have Amy Mather the 14 year old who learnt how to program Conway’s Game of Life on the Raspberry Pi, her film on YouTube has attracted over 27000 views.

If you look at our programme , you will see that we have a wide range of classes from how to switch on a Raspberry Pi to building weather stations, interfacing, networking, robotics, game making for all the family and programming in Python. David Whale will be running a workshop on how you can set up an after school Raspberry Pi club.

‘import random’, the start of great game! A Raspberry Jam programming class.

We hope to attract a diverse range of people to attend this family friendly event:

  • Teachers - who want to know if the Raspberry Pi is something they can use to support the teaching of Computing
  • Families - who together want to develop and nurture an interest in technology and computing
  • Hobbyists - who want to meet other people with a desire to share what they have been doing with their Raspberry Pi
  • Anyone - who has an interest in the Raspberry Pi at any level.

If you have never been to the National STEM centre before, this is a fantastic opportunity to come and discover what is there http://www.nationalstemcentre.org.uk/

New in the Swag Shop: recycled CD case pencils!

Raspberry Pi -

These feel lovely when you sharpen them, have a beauteous Raspberry Pi logo at the end, and are made in solid colours from recycled CD cases. Buy some, look funky when you doodle, help fund computing education, and save the planet too – what could be better?

Amazingly, we have not yet sold out of our first batch of Babbage the Bear. (He has stayed on the shelves longer than the camera boards, which we find shocking and remarkable.) Get him while he’s snuggly!

How To Disable The Red LED On The Pi Camera Module

Raspberry Pi Spy -

The Pi camera module includes a red LED in one corner of the PCB. This lights up when the camera is active. It’s really useful in giving a visual indication that the camera is doing something and most of the time you will be glad it is there.

However there are a number of reasons you might wish it wasn’t.

In my testing here are some of the reasons it can get in the way :

  • It can cause reflections on objects you are trying to photograph giving them a red glow.
  • For nature photography it scares animals.
  • For security applications it may draw unnecessary attention to the device.
  • It consumes power.

To disable the red LED you simply need to add the following line to your config.txt file :

disable_camera_led=1

To edit the config.txt file you can use Nano :

sudo nano /boot/config.txt

Use the arrow keys to scroll to the end of the file and add “disable_camera_led=1″ to the last line. Press “CTRL-x” to quit. If prompted press “Y” followed by “Return” or “Enter”.

Reboot your Pi with “sudo reboot” and when you next use the camera the red LED will be disabled.

To enable the light again you can either use Nano to remove the line you added above or you can change it to “disable_camera_led=0″. Reboot the Pi and you will have your camera light back.

Pi Camera Module Mechanical Dimensions

Raspberry Pi Spy -

Having played around with the Pi camera I quickly realised I needed to make some sort of stand for it. The module weighs almost nothing and is tiny so it can be quite hard to keep in one place when you are experimenting. The Raspberry Pi Foundation apparently recommends Blu-tack, based on cost, simplicity and plain, old fashioned versatility.

I thought it would be best to create a template that I could print out and use to create a camera holder without using the real module. That way I could get all the dimensions correct without worrying about squashing or dropping the module itself.

So here is a diagram showing the main module measurements.

Raspberry Pi Camera Module Diagram

The PCB is 25x24mm and is approximately 1mm thick. The distance between the reverse side of the PCB and the face of the camera is 6mm. The mounting holes will accept a 2mm machine screw according to various posts and photos I have seen.

Printing

You can either print the image above (click to get a bigger version) or use the Raspberry Pi Camera Module Diagram PDF. The image outline and the rectangle in the PDF are 50 x 60mm. You may need to set your printer driver to scale the diagram by 50% to ensure the module comes out 25mm wide.

If I manage to create a camera stand or mount that isn’t too embarrassing I will be sure to write an article about it and share photos.

Disclaimer : I’ve attempted to measure and represent the measurements as best I can using a set of plastic calipers I got free on the cover of a magazine. Please check before cutting or drilling anything.

If there is anything incorrect please let me know and I will correct it.

Raspberry Pi for Dummies: sample chapter

Raspberry Pi -

If you’re wondering about introducing your kids to Scratch, but aren’t quite sure where to start, here’s a handy resource for you. Sean McManus, one of the authors of Raspberry Pi for Dummies, has sent me a link to a couple of sample chapters of the book, including the first chapter on Scratch. You’re welcome to download it to find out whether the book’s for you.

Raspberry Pi For Dummies PDF Sampler

 

Hardware for Softies Workshop

Quick2Wire -

We’re thinking about running a version of our ACCU 2013 workshop as a public event. If you think you might be interested (no commitment) then please help us to judge demand by filling in the form below.

Hardware for Softies: physical computing with the Raspberry Pi

This is a hands-on workshop for software developers who’ve bought (or just heard of) the Raspberry Pi and would like a gentle introduction to using it to drive physical devices.

We’ll start with the Pi’s on-board digital I/O pins to drive some lights. Then we’ll look at how to communicate over an I2C serial bus, first to drive additional digital pins then to communication with an analog device. Given enough time, we’ll also show communicating with a satellite device such as an Arduino using Ward Cunningham’s Txtzyme

We will use Python as the programming language and provide the necessary hardware (including, optionally, Raspberry Pi’s). You’ll need to bring a laptop.

if (typeof(ecfconfig) == 'undefined'){var ecfconfig={};}ecfconfig[4]={};var ufobaseurl = 'http://quick2wire.com/wp-admin/admin-ajax.php';if (typeof(ufoFormsConfig) == 'undefined') {var ufoFormsConfig = {};ufoFormsConfig.submits = [];ufoFormsConfig.resets = [];ufoFormsConfig.validations = [];}ufoFormsConfig.phonenumberre = /^(\+{0,1}\d{1,2})*\s*(\(?\d{3}\)?\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/;When and where?Day of the week?WeekdayWeekendEitherufoForms.docReady(function(){ufoForms.get("ufo-field-id-966").value='Either'})Where?Keep me informedufoFormsConfig.validations.push({"events":{"blur":["email"]},"Validate":true,"showValid":true,"ValidMessageAbsolutePosition":true,"ValidMessagePosition":"right","RequiredMessage":"Please enter your email","AbsolutePosition":true,"RequiredMessagePosition":"right","id":"ufo-field-id-970","form":"ufo-form-id-4"});

Send an email to this address when something happens.

var c = {};c.id = 'ufo-field-id-971';c.form = 'ufo-form-id-4';c.Label = 'Submit';ufoFormsConfig.submits.push(c);SubmitPowered by Champion Forms

Frederik and Ernest’s Europe – Middle East – Africa roadtrip

Raspberry Pi -

Frederik and Ernest Lotter from Blue Horizon Embedded Systems in South Africa are driving from the UK to South Africa via Russia and the Middle East, taking in seventeen countries on their way.

They are making the journey in a Land Rover Defender which is fitted with a Raspberry Pi-based distributed light control system. The Raspberry Pi, and their lighting rig design, will be put to the test over 22000km of harsh conditions and rough terrain.

The Lotter brothers are experienced electronic engineers and are offering to meet up with groups of potential Raspberry Pi or ARM enthusiasts along the way. There may even be a Pi-themed reward available if you can find them using the live GPS tracking system they have installed.

You can track them live online, and if you want them to come and talk to your school, business or another group about Raspberry Pi and ARM processors while they’re in your country, they’re inviting you to email them - please get in touch as soon as possible if you’d like them to visit. Watch the video to learn more, and to find out what their route looks like. Thanks Fred and Ernest; we’re looking forward to tracking your progress!

Welcome to the Swag Shop!

Raspberry Pi -

You may have noticed that a little while ago, we quietly withdrew Raspberry Pi branded t-shirts from sale. Since then, we’ve been working on a reboot of the store. Shirts have been totally redesigned, and are now screen-printed rather than transfer-printed, which gives a much higher-quality and tougher finish; we’ve also listened to your requests for more colours and thicker material.

Every purchase you make goes to fund the Raspberry Pi Foundation’s educational activities, so you’re not just making yourself look swanky; you’re directly helping kids.

T-shirts, just calling out for you to buy them so they can escape their cruel imprisonment in plastic crates.

So today we’re relaunching the shop, under a new name, with new management (things are being run by our friends at Pimoroni), and new goodies for you to buy.

Babbage the bear needs a home.

Shirts (for ladies, men and kids) aren’t the only thing we’ve got in stock: you can now buy your very own Babbage the bear, and we also have Raspberry Pi mugs, bags, and travelcard holders for you to sip from, carry things in, and wave at turnstiles proudly.

A holder for your Oyster card (or your library card, bus pass or ID). Thanks to TfL for allowing us to mess with their map, and to Paul Beech for the design.

A tough drawstring bag for your hacking tools, about twelve Babbages or your overnight gear.

It’s a mug. You put coffee in it.

We’ll be introducing more goodies to the store as time goes on, and announcing them here when we do. We hope you like it! Please get buying – every penny of profit we make goes straight back into the Raspberry Pi Foundation, where it’s used directly to help educate kids in computer science.

 

 

Camera board project: time lapse video

Raspberry Pi -

Our friends at DesignSpark have produced a really beautiful time-lapse video with one of our new camera boards. It doesn’t start very beautifully, because it was filmed on a day whose start can best be described as “sodden”, but by afternoon the clouds parted and England started to look exceptionally green and pleasant. If you want to skip the rain, fast-forward to 1m46.

You can find detailed instructions on how to make your own time-lapse video with your own camera board over at DesignSpark. Big thanks to Andrew Back for the vid and the tutorial!

The Official Raspberry Pi Camera Module

Raspberry Pi Spy -

The first add-on from the Raspberry Pi Foundation is the official camera module. It’s been a long time coming but it is finally available to buy from Farnell, CPC (order code SC13023) and RS. The module attaches directly to the Pi PCB using the CSI connector.

The camera module is an OV5647 made by OmniVision and measures 8.5 x 8.5 x 5mm. The whole unit including the PCB measures 25mm x 20mm x 9mm. The camera contains a fixed focus 5-megapixel CMOS image sensor and is capable of recording 720p and 1080p HD video at 30 fps.

  • 5 megapixel
  • 2592×1944 stills
  • 1080p at 30 frames per second
  • 720p at 60 frames per second
  • 640x480p at 60/90 frames per second
  • CSi interface with 150mm ribbon cable
  • PCB+Camera module weighs 2.4g, ribbon cable weighs 1.0g

The camera is officially supported in the latest Raspbian SD card image as you would expect.

Here is a video showing how the camera modules ribbon cable should attached to the connector on the Raspberry Pi.

For full instructions on getting the camera working with Raspbian see this excellent camera setup and use post on the RaspberryPi.org site. It includes instructions on taking video and stills.

Here is a video showing a method for taking stills using tools provided by Element14 :

Camera board available for sale!

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 nc

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 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 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.

Raspbmc’s May update

Raspbmc -

Raspbmc’s May update ensures that Raspbmc gets better and better. Here’s what’s new:

  • Fixed a rare issue where the update system does not get triggered.
  • Fixed an issue where videos continue playing on a black screen (thanks popcornmix)
  • TVHeadend updated to version 3.4.
  • Fix a bug where the firewall does not disable despite being disabled via Raspbmc Settings.
  • USB DACs and PulseAudio support is supported in XBMC 12.2 again. Note that this is an unofficial addon maintained by the Raspbmc team, rather than being supported by XBMC directly, which is why it took some time to port to 12.2.
  • Better compliance with upstream Debian (using apt-get upgrade)

It is sad for me to announce that Raspbmc’s other developer, s7mx1 is no longer active. He brought excellent things to the project and was key in development of Raspbmc from early May to February this year. Since early February he has not been actively involved with development. Aside from the moderation and testing team, this leaves me as the sole developer.

To get the update, simply reboot your Raspberry Pi. Note that if you have disabled updates via Raspbmc Settings, you’ll need to enable them first, and if you’re running a nightly build, you’ll need to switch to ‘xbmc release’ in Raspbmc Settings to get back to the stable builds we ship as default.

If you enjoy Raspbmc, and this update, and would like to support continued development, you can make a donation here.

Thank you, and enjoy!

Raspberry Pi CPU Usage Monitoring With A BerryClip

Raspberry Pi Spy -

While wandering the internet I found an article Raspberry Pi: CPU usage monitoring using GPIO by chteuchteu. This explained how to display the current CPU usage on 7 LEDs attached to the GPIO header.

I thought this would be a great application to convert for use with a BerryClip 6 LED Buzzer board. So I modified the original code to use 6 LEDs and tweaked a few of the functions. Apart from the LED count I changed the script to use an array of GPIO references so it would be easier to update if you used different pins.

I started with a fresh install of the latest Raspbian SD card image.

#!/bin/bash #-------------------------------------- # ___ ________ # / _ )___ __________ __/ ___/ (_)__ # / _ / -_) __/ __/ // / /__/ / / _ \ # /____/\__/_/ /_/ \_, /\___/_/_/ .__/ # /___/ /_/ # # BerryClip - 6 LED Board # # This script uses 6 LEDs to display the # current CPU usage. # # Author : Matt Hawkins # Date : 12/05/2013 # # http://www.raspberrypi-spy.co.uk/ # # Original script created by chteuchteu # http://www.chteuchteu.com/ # # Modified by Matt Hawkins to use the 6 LEDs # on the BerryClip addon board. # # BerryClip LED reference : # LED 1 - Pin 7 - GPIO4 # LED 2 - Pin 11 - GPIO17 # LED 3 - Pin 15 - GPIO22 # LED 4 - Pin 19 - GPIO10 # LED 5 - Pin 21 - GPIO9 # LED 6 - Pin 23 - GPIO11 # #-------------------------------------- # Create array of GPIO references led[1]="11" led[2]="9" led[3]="10" led[4]="22" led[5]="17" led[6]="4" # Configure GPIOs to be outputs echo ${led[1]} > /sys/class/gpio/export 2> /dev/null echo ${led[2]} > /sys/class/gpio/export 2> /dev/null echo ${led[3]} > /sys/class/gpio/export 2> /dev/null echo ${led[4]} > /sys/class/gpio/export 2> /dev/null echo ${led[5]} > /sys/class/gpio/export 2> /dev/null echo ${led[6]} > /sys/class/gpio/export 2> /dev/null echo "out" > /sys/class/gpio/gpio${led[1]}/direction echo "out" > /sys/class/gpio/gpio${led[2]}/direction echo "out" > /sys/class/gpio/gpio${led[3]}/direction echo "out" > /sys/class/gpio/gpio${led[4]}/direction echo "out" > /sys/class/gpio/gpio${led[5]}/direction echo "out" > /sys/class/gpio/gpio${led[6]}/direction ################################################# # FUNCTIONS # ################################################# number=0 gpio=0 function LEDON { # Turn ON the LED "number" gpio=${led[number]} echo "1" > /sys/class/gpio/gpio$gpio/value number=0 gpio=0 } function LEDOFF { # Allow you to turn off the del (the number of the del is contained in "number") # number pin is done at the begining of the function gpio=${led[number]} echo "0" > /sys/class/gpio/gpio$gpio/value number=0 gpio=0 } function allON { # Turn ON all the LEDs for i in {1..6} do number=i ; LEDON done } function allOFF { # Turn OFF all the LEDs for i in {1..6} do number=i ; LEDOFF done } function flash { counter=0 while [ $counter -le $1 ] do allON ; sleep 0.2 allOFF ; sleep 0.2 counter=$(( $counter + 1 )) done } ################################################# # MAIN CODE # ################################################# # Turn ON all LEDs in sequence number=1 ; LEDON ; sleep 0.2 number=2 ; LEDON ; sleep 0.2 number=3 ; LEDON ; sleep 0.2 number=4 ; LEDON ; sleep 0.2 number=5 ; LEDON ; sleep 0.2 number=6 ; LEDON ; sleep 1 # Turn all LEDs OFF allOFF # Flash the LEDs 5 times flash 5 # Start main loop while true ; do # Obtain the current CPU usage percentage idle=`vmstat 2 3 | tail -n1 | sed "s/\ \ */\ /g" | cut -d' ' -f 16` cpu=$(( 100 - idle )) # Switch the LEDs ON or OFF the "cpu" value allOFF if [ ${cpu} -lt 5 ] ; then allOFF elif [ ${cpu} -lt 23 ] ; then number=1 ; LEDON elif [ ${cpu} -lt 41 ] ; then number=1 ; LEDON number=2 ; LEDON elif [ ${cpu} -lt 59 ] ; then number=1 ; LEDON number=2 ; LEDON number=3 ; LEDON elif [ ${cpu} -lt 77 ] ; then number=1 ; LEDON number=2 ; LEDON number=3 ; LEDON number=4 ; LEDON elif [ ${cpu} -lt 95 ] ; then number=1 ; LEDON number=2 ; LEDON number=3 ; LEDON number=4 ; LEDON number=5 ; LEDON else number=1 ; LEDON number=2 ; LEDON number=3 ; LEDON number=4 ; LEDON number=5 ; LEDON number=6 ; LEDON fi done # Turn all LEDs OFF allOFF exit 0

This script can be downloaded directly to your Pi using the following command :

wget http://www.raspberrypi-spy.co.uk/berryclip/6_led/berryclip_cpu_01.sh

The script must be made executable :

chmod +x berryclip_cpu_01.sh

It can then be run from the command line using :

sudo ./berryclip_cpu_01.sh &

The ampersand on the end of the line is required to run the script as a background process and give you your command line back. The number displayed when you run the script is the process ID. You can check the process is still running by typing :

ps aux | grep berryclip

You should see a process with the same ID. If you want to close the process you can type :

sudo kill 1234

Where 1234 is your process ID.

The LEDs will light up based on the CPU utilisation. The percentages required to light each LED are shown below :

None less than 5% 1 LED 5% or greater 2 LED 23% or greater 3 LED 41% or greater 4 LED 59% or greater 5 LED 77% or greater 6 LED 95% or greater

If you now run “startx” and use some applications (Midori for example) you will see the CPU monitor spring into life! If you don’t like the percentages used in this example they are easy enough to change by adjusting the appropriate numbers in the script.

Here are some photos of the monitor in action :

Seiten

RaspberryCenter.de Aggregator abonnieren