Englisch

Parkinson’s disease body illusion

Raspberry Pi -

Transports is an interactive installation from Analogue, a theatre/art group, sponsored by the Wellcome Trust, which creates the illusion that the viewer is experiencing Parkinson’s symptoms. As in the rubber hand illusion, the mind is tricked into believing that the user’s hand is the hand shown in some point-of-view video; while a glove with motors makes them feel the tremors associated with the disease.

The whole setup is controlled by a Raspberry Pi. The installation takes the user through a number of everyday tasks from the perspective of Andrew, a man in his thirties with Parkinson’s, who is about to give a speech at a friend’s wedding. Andrew’s experience is informed by a body of first-person data that Analogue collected from the blogs of people dealing with Parkinson’s, and interviews with patients.

This installation isn’t being exhibited as public art at the moment; instead, it’s being used to raise awareness and promote empathy among health professionals and carers. Psychology students are also using it; and there are plans to refine the whole thing by using Oculus Rift or a similar VR headset, and by shrinking the apparatus on the glove.

You can read more about Transports at Analogue’s site, or at the New Scientist.

Northern Ireland’s first Raspberry Jams

Raspberry Pi -

Liz: Andrew Mulholland is a first-year undergraduate student at Queen’s College Belfast, and the overall winner of 2014’s Talk Talk Digital Hero award. We’ve known him for a few years (he did work experience with us this summer – he created the Grandpa Scarer learning resource for us with Matt Timmons-Brown).

Andrew’s been setting up events to introduce other young people to computing for some years now. He‘s recently been running the very first Raspberry Jams in Northern Ireland, and is doing a lot of computing outreach with local schools. I asked him how the kids who’d attended the Jams had found the experience, and he sent me the blog post below. Well done Andrew – it’s brilliant to see how much fun an introduction to computing can be. You’re doing an amazing job.

Northern Ireland November Raspberry Jam

September, NI Raspberry Jam 5.

On Saturday 8th November 20+ soon-to-be Raspberry Pi enthusiasts arrived at Farset Labs for the 6th Northern Ireland Raspberry Jam.

This months main activities? Sonic Pi 2 and Minecraft Pi!

At the Jam we also have all the previous months’ activities printed out, so that if the kids want to try something else out, they are more than welcome to.

There are activities ranging from Sonic Pi, to Minecraft Pi, to physical computing projects like creating a reaction timer game in Scratch GPIO, along with quite a few others.

Lots of cool stuff to play with!

I asked a few of the kids at the jam to write down what they though.

Haley (11) having way too much fun hacking someone else’s Minecraft Pi game!

Haley:

“It was my first Raspberry Jam and I was quite nervous when I walked in but one of the mentors came over and introduced himself to me and explained what we would be getting up to. He found me a chair and showed me how to connect all the wires together and by the end of the Jam I was laughing my head off! I really enjoyed learning how to make music using Sonic Pi. I made the tune Frère Jacques. My favourite part was learning how to code while playing Minecraft. Andrew told me I should learn how to code because I had never done it before. I used a programming language called Python to hack others Minecraft games and to teleport them to a random place. I heard another kid start exclaiming after teleporting her several times, initially she had no idea it was me! Andrew and Libby were very supportive the whole day and I learnt a massive amount thanks to them. It was great fun!”

Apparently Haley enjoyed her first Raspberry Jam.

 Katie:

“I heard about the Raspberry Jam because one of the mentors volunteers at my school and the Jam was announced in Assembly as part of EU Coding Week. My friend Rachel and I decided to give it a go. I didn’t know anything about a Raspberry Pi and had no idea what to expect before I went but Andrew and the mentors have taught me loads and are very encouraging. I have just done my second Raspberry Jam and I loved it! I created a piece of music using Sonic Pi, played/hacked Minecraft and played with an LEDBorg in Scratch GPIO! Also we got doughnuts and got to make use of Farset Lab’s huge blackboard! It is the biggest blackboard I’ve ever seen. I don’t have a favorite part because everything I did was great fun and everybody was helpful. I definitely suggest anyone my age giving it a go!”

Rachel and Katie creating music with Sonic-Pi 2

Rachel

“I had a great time at my second Raspberry Jam at the weekend. The thing I enjoyed the most was learning with Scratch with the GPIO pins. This is something my school doesn’t teach so I don’t get the chance to do anything like this normally. It was great fun programming the LEDs to change different colours using a program I wrote.

The Raspberry Jam is such an amazing workshop and I am very grateful to Andrew and Libby for running it! I can’t wait till the December Jam!!”

We didn’t just have young people at the NI Raspberry Jam this month! The Jam is open to people of all ages, coding knowledge and backgrounds.

Never to old to play Minecraft! John (70) getting taught how to play Minecraft Pi by Isaac (10)

A parent:

“These events are really great. It lets the kids experiment with technology that they wouldn’t otherwise have got the opportunity to use in school. Most schools in Northern Ireland don’t seem to offer any coding opportunities for the kids so stuff like this is essential. And Andrew and Libby are great, giving up their Saturdays to come and teach these kids and my son!”

Next month is the Christmas special Jam! We have some secret new activities planned and of course, lots of food!

Some awesome cupcakes baked by @baker_geek for last months Jam.

Want to come along to the next NI Raspberry Jam?

Northern Ireland Raspberry Jam is on the 2nd Saturday of every month with NI Raspberry Jam 7 (Christmas special) being on the 12th December at Farset Labs, Belfast.

Tickets are free! (Although we ask for a £3 donation towards the venue if able to).

The event is especially aimed at complete beginners to the Raspberry Pi or people just starting out, but we do have some more complex projects and challenges for you if you are an expert.

Special thanks to Libby (16) for helping me with this months Jam, and to Farset Labs for basically letting us take over the building for a Saturday afternoon!

You know when you are onto something good when you overhear one of the kids on their way out saying: “Daddy, daddy, can I borrow your phone to book next month’s tickets before they all go?”

Interested in finding a Raspberry Jam near you? Check out our Jams page!

A collection of Pis

Raspberry Pi -

Liz: Today’s guest post comes from Alex Eames, who runs the rather wonderful RasPi.TV. He’s been furtling through his drawers, and has discovered he owns a surprising number of Raspberry Pi variants. Thanks Alex! 

Now we have the A+, I thought it’d be a good time to celebrate its ‘birth’ by having a rundown of the various mass-produced models of Raspberry Pi.

I had a look through my collection and was somewhat surprised to see that I have 10 different variants of Raspberry Pi now. There is one I don’t have, but more about that later. Here’s the family photo. You can click it for a higher resolution version.

Rev 1 Model B

In row 1, column 1 we have the Rev 1 model B. Although I was up early on 29th February 2012, I didn’t get one of the first 10,000 Pis produced. This was delivered in May 2012. It’s a Farnell variant (I have an RS one as well, but it does full-time duty as my weather station). This was the original type of Pi to hit the market. It has 256 Mb RAM and polyfuses on the USB.

Rev 1 Model B – With Links

In row 1, column 2 you’ll see a slightly later variant of Rev 1 model B. This one has 0 Ohm links instead of polyfuses. It helped to overcome some of the voltage drop issues associated with the original Rev 1, but it introduced the “hot-swapping USB devices will now reboot your Pi” issue, which was fixed in the B+.

Rev 2 Model B (China)

Row 2, column 1. Here we have an early Rev 2 Pi. This one was manufactured in China. It originally had a sticker on saying “made in China”, but I took it off. This one was bought some time around October 2012. The Rev 2 model B has 512 Mb RAM (apart from a few early ones which had 256 Mb), mounting holes and two headers called P5 and P6.

Rev 2 Model B (UK)

Row 2, column 2. This is a much later Rev 2 Pi, made at SONY in Wales, UK.

Chinese Red Pi Rev 2 Model B

Row 3, column 1. This is one of the Red Pis made especially for the Chinese market. They are not allowed to be sold in the UK, but if you import one yourself that’s not a problem. It is manufactured to a less stringent spec than the ones at SONY, and is not EMC tested. Therefore it bears no CE/FCC marks.

Limited Edition Blue Pi Rev 2 Model B

Row 3, column 2. I’m not going to go into how I got hold of this. Suffice it to say it was not at all easy, but no laws were broken, and nobody got hurt. RS had 1000 of these made in March 2013 as a special limited anniversary edition to use as prizes and awards to people who’ve made a special contribution to education etc. I know of about 5 or 6 people who have them. (At least two of those people traded for them.) They are extremely hard to get. They come in a presentation box with a certificate. I have #0041. Other than their blueness, they are a Rev 2 model B Pi.

Model A

Row 1, Column 3 is a model A. The PCB is identical to the Rev 2 model B, but it has only one USB port, no ethernet port, no USB/ethernet chip and 256 Mb RAM. The $25 model A was released in February 2013. On the day I got mine, the day after launch, I made a quick and dirty “I’ve got mine first” video, part of which ended up on BBC Click. The model A sold about 100k units. Demand for it was outstripped by the model B, although at one point CPC was offering a brilliant deal on a camera module and model A for £25 (I snagged a couple of those).

Compute Module

Row 2, column 3 is the Compute Module, sitting atop the Compute Module development board. This was launched 23 June 2014 as a way to enable industrial use of the Pi in a more convenient form factor. The module is made so it fits in a SODIMM connector and is essentially the BCM 2835, its 512 Mb RAM and 4 Gb of eMMC flash memory with all available GPIO ports broken out. It costs $30 when bought by the hundred.

Model B+

Row 3, column 3 is the model B+. This was launched on 14 July 2014 and was a major change in form factor. Rounded corners, corner mount holes, 40 GPIO pins, 4 USB ports, improved power circuitry and a complete layout redesign. The B+ was announced as the ‘final revision’ of the B. So it would appear that it’s going to be with us for some time.

Model A+

In row 4, all by itself we have the shiny new Raspberry Pi A+, launched 10 November 2014. It’s essentially the same as a B+ with the USB end cut off. It’s the smallest, lightest, cheapest, and least power-hungry Pi of all so far. It’s 23g, $20 and uses just half a Watt at idle.

So Which One Don’t I Have?

I don’t have a Rev 2 256 MB variant. If you have one and would like to trade or sell it to me, I’d be happy to hear from you (alex AT raspi.tv).

I believe there is also now a red Chinese B+ I’ve not got one of those, but it’s only a matter of time. I wonder if there will be a red A+ at some point too? We Just Don’t Know!

 

 

MagPi issue 26

Raspberry Pi -

I’m in a bit of a rush today; we’re all at the factory in Wales where the Raspberry Pi is built to show the team that works in Cambridge how to make a Pi. So I’ll hand over to Team MagPi, who have just released their 26th edition of the free monthly Raspberry Pi magazine, written by Raspberry Pi fans for Raspberry Pi fans.

Editor Ash Stone says:

This month’s Issue is packed with hardware and programming articles.  We are pleased to present the first article in an OpenCV (open source computer vision) image recognition software series by Derek Campbell.  The robot that Derek used to test the software configuration is shown on this month’s cover.

Expanding the I/O possibilities of the Raspberry Pi is often a first step of electronics projects.  This time, Dougie Lawson presents a review of the Arduberry board from Dexter Industries.  This little board provides an ideal microcontroller interface for more complicated electronics projects.  This month’s hardware articles are rounded off by Karl-Ludwig’s third BitScope article, which includes examples of preamplifier circuits and associated test and measurement.

The Raspberry Pi provides the opportunity to run many different software applications.  Voice over IP (VoIP) allows telephone calls to be carried over an internet connection.  Walbarto Abad continues his mini-series by describing how to setup an Asterisk VoIP server.

The second application article this month continues the discussion of git (distributed version control system).  Git was originally produced for Linux kernel development, but is now a mainstay of many different development projects and has been adopted by several schools too.  Alec Clews leads us through his second tutorial on the subject.

This month’s programming article demonstrates how to build an arcade game using FUZE BASIC.  Jon Silvera includes instructions, code and images to build a horizontally scrolling game.

We are on the look out for more articles at all levels and on all subjects.  If you are interested in submitting an article, please get in touch with us by emailing articles@themagpi.com.

If you have any other comments, you can find us on Twitter (@TheMagP1) and Facebook (www.facebook.com/MagPiMagazine) too.

 

 

Gertbot is here!

Raspberry Pi -

Over the last few weeks, we’ve been whetting your appetite for something new from Gert.

How is Gert performing this magic? He’s built a new add-on for your Raspberry Pi: the GertBot. GertBot is a motor controller and power management board, which you can buy today from Farnell or from The Pi Hut.

What makes it so special? Gert has put an ARM cortex-M3 processor on board, which handles all the real-time requirements, so the Pi’s processor is left free to get on with other things – this means you only need to send high-level commands to the GertBot, and the board handles all the rest for you.

This is a powerful piece of kit. While Gert expects most of you to use it for driving motors and building robots, he notes that you can also use it to drive other things: using all three RGB channels, for example, your Pi with the GertBot attached can operate 30,000 led lights. Which should be enough for anybody.

And, of course, there’s the ability to generate DCC signals, which will make model train enthusiasts pink-cheeked and happy.

Gert says:

It has four full H-bridges which can drive 2.5A each. Thus one board can control four brushed motors or two stepper motors. If that is not enough you can cascade up to four board which gives you sixteen brushed motors or eight stepper motors or any combination in between. Additionally the board can control model trains as it supports the DCC standard.

As to software: it comes with a debug and development GUI, C-drivers, Python drivers, and example code showing how to use the drivers, all available in source code. Hop over to www.gertbot.com where you can download all the code and can also see a number of videos demonstrating the board’s capabilities. The board is distributed by Farnell and the Pi-hut.

Gert sits just across the room from me, where he plays with trains and stepper motors. When I loaded this video this morning, everybody looked to see if he was hiding under my desk. Over to Gert, who will show you how to set up GertBot in three minutes from a standing start.

Example programs, utilities, and more are all available at the GertBot site. As with all Gertenproducts, there’s a full and detailed user manual available for download too. If you can’t get enough of Gert’s mellifluous Dutch tones, you’ll also find more example video.

Thinking of buying one? What would you use it for?

Jacquard looms, and a Pi simulator

Raspberry Pi -

I’m not alone at Pi Towers (hi Lorna! Hi Rachel!) in being a textiles nerd. There’s a 200-year-old cushion made of strips of worn-out Regency clothes (which nobody is allowed to sit on) in my living room; Mandarin sleeves I’ve rescued from rummage bins in Hong Kong and framed on the walls, and a rotation of vintage wedding kimonos and obis that hang up at the end of the hall. I have a theory about textile art being considered domestic, female art – and therefore, for cultural reasons I don’t care for very much, deprecated in comparison with other sorts of art, and a hell of a lot cheaper per square foot than paintings or prints in frames. If you’ve got a big wall to decorate, you could do a lot worse than hitting eBay and wallowing in kimonos.

What’s all this got to do with Raspberry Pi?

In case you hadn’t already noticed, I am also a computing history nerd. Last weekend I spent several hours in the Fashion Museum in Bath, thinking tranquil thoughts about Spitalfields silk, Jacquard looms, and the way some of these beautiful textiles relate directly to the history of programming. The Jacquard process for weaving was invented in the early 1800s; and we get excited about them because Jacquard looms were the very first programmable machines used in manufacturing.

This shawl, from the collection of the Metropolitan Museum in New York, was woven in 1840 on a Jacquard loom. Click through for a zoomable image; the detail is phenomenal.

Punchcards were threaded together and fed into the loom, each card full of holes representing one line of weaving. It was a flexible system: your chain of cards could be as long or as short as was needed, and to weave a different pattern on the loom, you could simply swap out the set of cards. Imposing that flexibility on a mechanical system was a completely novel concept, and those punch cards were a first step on the road to what became the computer programming that all those of you with Raspberry Pis are familiar with. (Charles Babbage used the Jacquard punch card concept around forty years after the invention of the Jacquard process to store programs in the Analytical Engine – and they’re still not obsolete. Those American voting machines that cause so much controversy were still employing punch cards in the 2012 election.)

Punch cards in use on a Jacquard loom

It can be hard to visualise the relationship between the holes in the cards you can see above, and the individual lines that create the pattern on the brocade you can see next to them. So Macclesfield Silk Museum (which I have only just found out about, and am going to make a beeline for next time I’m in Cheshire) put a Raspberry Pi to work to make this demonstration model for museum visitors.

Today, textile professionals can buy specialised software for designing and producing Jacquard fabrics: a direct line of descent from Joseph Marie Jacquard’s two-century old innovation. (Check out this blog post from Florence, where you can see some modern examples of fabrics woven using modern Jacquard software.)

Joseph Marie Jacquard – a portrait woven in very fine silk on a Jacquard loom in 1839. 24,000 punch cards, each with 1050 positions, were used to weave this portrait, which is in the collection of the Science Museum in London.

Next time you’re out shopping for curtain fabric, or buying intricately woven cushion covers, step back for a moment and think about the computing history you’re holding in your hands. Computing’s everywhere.

Raspberry Pi Model A+ Cases

Raspberry Pi Spy -

It’s early days at the moment but within the first week of the Model A+ release the community has been busy creating custom cases. Pimoroni were quick off the blocks with a variation of their popular PiBow case.

Not to be out done some members of the community have been busy creating custom cases, in some instances before they had even received their Model A+. The popularity of 3D printers has made this sort of activity possible in a way it wasn’t at the time of the original Model B.

After a quick survey on Twitter here is a selection of cases currently available.

A+ Coupe Royale Pibow

This case from Pimoroni (@pimoroni) is only £6.50 so is in keeping with the low price of the Model A+ while maintaining the style and class of the original PiBow. It is created with coloured layers of acrylic. The top and bottom layers are transparent leaving the Pi visible inside. All the ports are accessible and the whole case only weighs 61g. There are more details on the Pimoroni site.

Graham Taylor (@rpiSchool)

The first 3D printed case I saw appear was from Graham. This was announced via Twitter at 2am when all the best work gets done! The top and base fit together using friction. The case provides a slot for the camera ribbon cable. The design is available from Thingverse so you can download and print your own.

http://www.thingiverse.com/thing:540393

Dave Hunt (@climberhunt)

Dave has created a full case which consists of a top and bottom section. The lid doesn’t contain openings for GPIO, camera or display cables but as he says on his website these can be added if required by editing the source files.

http://www.davidhunt.ie/3d-printed-raspberry-pi-model-a-case/ 

Mike Redrobe (@mikerr)

Mike has a created a minimal base plate for the A+. This gives you something to attach the Pi to either as part of a further structure or on its own.

http://www.thingiverse.com/thing:542643

The three 3D printed cases are all available to download, print and modify. Please see the linked websites for additional license details.

Thanks to @RasPiTV, @MarkSwashplate, @Mikered, @rpiSchool and @climberhunt for the info. If you are a Twitter user and aren’t already you should probably be following these guys.

If you print any of these cases don’t be shy in letting them know as I’m sure they will be pleased to hear their designs are in circulation.

Adventures in Minecraft

Raspberry Pi -

Martin O’Hanlon and David Whale will be familiar to many readers of this blog, whether from the excellent Raspberry Pi and Minecraft resources they’ve authored or from their work with schools, code clubs and Raspberry Jams. Now they’ve teamed up to write a fantastic new book, hot off the press this week.

Adventures in Minecraft teaches young people to customise their Minecraft world with amazing structures and new gaming experiences, developing Python programming skills along the way. Nine self-contained projects introduce readers with no programming experience to the basics and then move on to increasingly sophisticated mods, and eventually to controlling and sensing real-world objects from within Minecraft!

Made for Minecraft Pi or for Minecraft on a PC or Apple Mac, the book is written especially for 11-15-year-olds, although we’ve already come across rave reviews from both younger and older readers. It has a companion website full of extras and video tutorials, as well as a mini-site created by Martin, with a forum where readers can discuss their projects and ask for help. Martin has also made a video montage of some of the adventures in the book:

Carrie Anne Philbin, our Education Pioneer, says, “It’s excellent that kids have a dedicated, full-colour book like this to help them get into programming with Minecraft, and it will make a great companion to Adventures in Raspberry Pi!”

You can buy Adventures in Minecraft now from Amazon and other book sellers. Why not treat the Minecraft fan in your life?

Let the BattlePi commence…

Raspberry Pi -

Recently I visited the University of York Computer Science department for the second year running to see the Raspberry Pi being used to great effect on the new intake of students. Last year I visited to judge Blue Pi Thinking, and since it was such a great success they decided to repeat the exercise this year.

The students are sent a Raspberry Pi before they come to university, with a special build and a document that describes the challenge.  There are three main reasons for doing this. The first is to give the students a common computing platform that they can use throughout the year to base different projects/assignments on. Secondly, the students will learn a great amount and will kick start their education; and finally it becomes a real social event for the students to get together (some actually help each other out) with beer and competition (which of course go hand in hand!)

There are two elements to the challenge and the students can choose either (or both or neither!) The first is Blue Pi Thinking, where the challenge is to develop something creative; the second is BattlePi.

BattlePi is a game of battleships played automatically by the Raspberry Pi with a server through which two Raspberry Pis can communicate. The students are given the (well commented Python) software which initially just chooses random positions to make shots at. The student then has to modify the python code to implement better AI in both firing position and ship placement. At the end of freshers’ week the students all come together (with beer of course) to test their creations.

The Blue Pi Thinking creative competition whose aim is basically to create something was run as a judged event. The following are examples of projects that were created:

  • Playing card recognition. From first principles, the student had captured a picture of a playing card, thresholded it, segmented it to find the pips and count them (OK, it doesn’t work with face cards yet!) Then they apply an edge following algorithm to the pip to work out if it’s a heart, club, diamond or spade. I’d just like to say… Awesome!
  • Ultrasonic theremin. This student had taken a standard ultrasonic transducer and used it to create a theremin, again of some awe.
  • Raspberry Pi mosaic creator. This project was another very complex algorithm, which takes a picture on his Android mobile phone using his own app and transmits it to the Raspberry Pi. Then the Pi calculates the best match from a set of images for small sections of the image based on a calculated ‘average’ colour for the region. Then the software makes up the final image as a mosaic of the select set of images, and transmits it back to the phone!

Throughout the year the students will be using their Raspberry Pis to continue their education, and help develop next years BattlePi competition. Will Smith and Emma Hogson, who are in charge of undergraduate admissions have offered Raspberry Pi their complete BattlePi materials including all the software and instructions so we can give it to other universities…something we’re looking into with great interest.

May the worldwide BattlePi commence – watch this space!

How To Create A Raspberry Pi Video Capture Unit – Part 3

Raspberry Pi Spy -

In the previous two articles I explained how I made a simple video recording device with the Raspberry Pi, a camera module and a plastic case. It’s simple enough to be mounted wherever you need a video camera.

In this final part I will explain how I extract the resulting video files from the unit and convert them to MP4 files. This makes them easier to play on other devices and media software.

Converting The Files Directly On The Pi

To convert the files using the Pi you can use the “prepare_mp4.sh” script. Plug the Pi into a network and power it up. We do not want the Pi to start recording video but the main script will not run if a network connection is detected.

The script uses MP4Box to do the conversion. If you haven’t installed it previously you can do so using :

sudo apt-get install gpac

Now you can navigate to the location where your video files are and check a copy of the script is present. Run the “prepare_mp4.sh” script using :

./prepare_mp4.sh

It may take a while but the h264 files in the directory will be converted to MP4. You will need to make sure there is sufficient space available to do this as you will end up with a h264 and MP4 file for each clip.

Once the script has finished you can transfer the resulting video files via SSH or FTP to another computer.

Converting On A Windows PC

My preferred method is to write the video to a USB drive. This can then be plugged into a PC and the “prepare_mp4.bat” script will then convert the h264 files and give you a set of MP4s. In order to use this method you will need to :

Your MP4 files will be prepared and saved in the “d:\temp” directory. You can use a different directory but you will need to update the batch file appropriately.

Your video capture unit is now ready for another adventure!

Example Video Footage

Here is a two minute compilation I created from footage I filmed while the camera was attached to my windscreen :

The camera resolution was set to 1280×720 although the YouTube video was exported as 1920×1080. The video isn’t very exciting but shows how the camera deals with the varying daytime lighting conditions it comes across.

How To Create A Raspberry Pi Video Capture Unit – Part 2

Raspberry Pi Spy -

Following on from Part 1 I’ll explain how you can install the Python software and get your own Video Capture Unit up and running.

You don’t need to build your unit in exactly the same way as mine but as a minimum you need :

  • Raspberry Pi
  • SD card with Raspbian
  • Camera module
  • 5V power supply
  • 1 LED attached to GPIO4 via current limiting resistor (ie 330 ohm)
  • 1 Switch attached to GPIO7 with 10K pull-down to ground

If you want to be able to easily transfer video files to a PC you might also want to use a :

  • USB Flash Drive (8GB+)

The setup might be spread over a desk or installed in raspberry pi case. The choice is yours.

 

Software

The software is available from the RPiSpy Video Capture Unit BitBucket repository and consists of the following main files :

  • config.py
  • cron.py
  • instructions.txt
  • prepare_mp4.bat
  • prepare_mp4.sh
  • vcu.py

config.py
This file contain the user defined settings used by vcu.py. It allows the user to adjust various parameters. If “/boot/vcu_config.py” exists it is copied over this config file. The vcu_config.py can be used to edit settings on a Windows PC which can see the /boot/ partition on the SD card.

cron.py
This script is run when the Pi boots. It looks for a network connection and only runs vcu.py if it doesn’t find one. This allows the Pi to boot normally when you have connected it to your network to copy video files.

instructions.txt
Summary of these installation instructions for reference.

prepare_mp4.bat
This script provides an easy way to convert the recorded h264 files to MP4 files. It may take a while to convert depending on the total duration of the videos. It uses MP4Box and is meant to run via Windows.

prepare_mp4.sh
This script provides an easy way to convert the recorded h264 files to MP4 files. It may take a while to convert depending on the total duration of the videos. It uses MP4Box and is meant to run on the Pi itself.

vcu.py
This is the main Python script which does most of the work. It is called from cron.py when the Pi boots.

Installation

First prepare a fresh SD card with Raspbian. Use a recent download from the official RaspberryPi.org site. Why Raspbian? I use it for everything!

Power up the Pi and login. You will now be in the home directory. Expand the file system and Enable the Pi Camera using the config tool :

sudo raspi-config

Ensure you’ve got the latest firmware using :

sudo rpi-update

Create a new directory and navigate into it :

mkdir rpispy_vcu cd rpispy_vcu

Now we can download the archive file from BitBucket using :

wget https://bitbucket.org/MattHawkinsUK/rpispy-video-capture-unit/get/master.tar.gz

If you type ls you should see the master.tar.gz file sitting in the current directory. Use the following command to extract the files from the archive :

tar -xvf master.tar.gz --strip 1

Typing ls should show you a list of the files :

You can remove the archive now using :

rm master.tar.gz

The Python scripts control the Raspberry Pi Camera Module using the Picamera module. This is installed by default on the latest version of Raspbian.

Then finally install MP4Box (aka gpac) which can be used to convert the h264 files recorded by the camera to slightly more usable MP4 files :

sudo apt-get -y install gpac Config File Setup (optional)

If you want to be able to edit the config file in Windows you will need to place a copy in the /boot/ directory. You can do that using :

sudo cp config.py /boot/vcu_config.py

When the cron.py script runs at boot time it will check if there is a vcu_config.py file in /boot/. If there is it copies it over config.py. The main script would then run and use the new settings.

USB Flash Drive Setup

In order to save our video files to a removable drive we need to get the Pi to automatically mount the USB flash drive. This is a fairly easy process and is described in my How To Mount A USB Flash Disk On The Raspberry Pi tutorial. Follow the tutorial so that your drive is mounted as “/media/usb”.

If you don’t want to use a USB flash drive and you want to store videos on your SD card you will need to make a directory :

mkdir ~/rpispy_vcu/videos

and set the VIDEO_PATH parameter in the config.py file to point to ‘/home/pi/rpispy_vcu/videos/’. Don’t forget to update /boot/vcu_config.py if you are using that file.

Autorun On Boot Setup

To run the script automatically when the Pi boots you can use ‘cron’. To edit it we use the command :

sudo crontab -e

Using your cursor keys scroll to the bottom and add the following line :

@reboot python /home/pi/rpispy_vcu/cron.py &

Make sure you get this line correct as the script will fail to run on boot if there are any mistakes. Note that it ends in an ampersand symbol.

To save these changes click “CTRL-X”, then “Y” and finally “Return”. You should now be back at the command prompt.

 

First Run

Shutdown your Pi and remove the power. Disconnect your network cable. Reconnect the power and boot the Pi. The Pi will boot and you will hear the buzzer sound once. The camera is now recording!

When you want to stop recording hold down the button until you hear a double beep from the buzzer. The Pi will shutdown. Wait 10 seconds before removing the power cable.

In part 3 I will cover converting the resulting video files into MP4 files which makes them easier to play in a media player or editing application.

How To Create A Raspberry Pi Video Capture Unit – Part 1

Raspberry Pi Spy -

One hundred and fifty posts later I decided I should really complete a project I’ve been thinking about ever since I got my first Pi. That is a simple video capture unit that would be able to record video, in a loop, with the minimum amount of hardware and setting up.

I wanted a standard setup I could quickly deploy around the house, garden, car or bike. The software needed to be easy to setup so I could use it at short notice. I also wanted it to be basic enough that someone else could use it as a basis for their own Pi camera projects.

This sort of idea isn’t exactly unusual and there are plenty of Pi based camera projects out there but I wanted something I was happy with and did exactly what I needed without any fancy features. Re-inventing the wheel can be fun despite what other people might tell you!

Requirements

My requirements were something along these lines :

  • Easy and quick to configure
  • Basic Python script that is easy to follow
  • Ability to define number and duration of video files to store
  • Minimise hardware items
  • Minimise wiring, soldering and construction time
  • Provide a method to stop recording and correctly shutdown Pi
  • Provide a quick method to attach to a tripod
  • Provide a method to review footage on a PC

Although there are plenty of additional features I could have added I wanted to keep this simple. So you won’t see WiFi, Bluetooth or any web connectivity in this version.

Here is a photo of my finished system :

Hardware

The hardware I used is listed below :

  • Raspberry Pi (Model B)
  • Cyntech standard case
  • 8GB SanDisk SD card
  • 32GB Kingston Flash Drive
  • Camera module
  • 8mm metal washer
  • 3D printed tripod mount
  • RAVPower RP-PB13 14000mAh USB power bank

I needed 1 switch and 1 LED so used an already assembled BerryClip add-on board. This was a quick way of giving me an LED and Switch without me needing to do any additional wiring. You can easily complete this project with your own LED, switch and resistors wired up to the appropriate GPIO pins. In order to fit everything in the case I need to drill holes to accommodate the LEDs, buzzer and camera. The switch was recessed but still usable.

Sticky pads were used to secure the camera in place. The metal washer was glued in place on the outside to allow cheap magnetic lenses to be attached if required.

Tripod Mounting

In this project I used the Cyntech case as it is good value, easy to modify and has a nice Raspberry Pi logo on it. My friend Graham 3D printed me a plastic insert which held a metal nut compatible with my tripod. This beautifully simple modification makes the whole unit easy to mount in a fixed position without having to balance it on piles of books.

Usage

When the Pi is powered up a cron job is started which looks for a network connection. If there is no network the main Python script is run. I didn’t want the script to start when connected to a network as this is when I wanted to download video without the camera being active.

The main script reads the configuration file and starts recording a video file. The files can be saved onto the SD card or a USB flash drive. When the pre-set duration is reached the file is closed and a new one is started. If the total number of video files reaches a pre-set limit then the oldest one is deleted. The device can continue recording over-writing files as required.

The configuration file let’s you set the total number of files to keep, the duration of each file as well as camera properties such as frame rate and resolution.

When you are finished you can hold down the button to quit the script and shutdown the operating system. The power can then be removed.

Power

Around the house it is easy enough to use mains power but when I want to use the unit on the car or bike I just use my Ravpower RP-PB13 14000mAh USB power bank. I’ve had this battery for a while now and it has been in fairly regular use in my household.

Car Mounting

With a windscreen mount from eBay it’s easy to create a simple dash cam!

Here are some additional photos :

Part 2 details the installation and setup procedure if you are interested in creating your own version.

WiFi-controlled pottery kiln

Raspberry Pi -

I’ve always fantasised about having a kiln in the garage (Eben wants a pick and place machine; we need another garage). Kilns, though, are expensive. And where do you start if you want to refurbish a broken or old one safely?

James Huang has an answer, and it’s got a Raspberry Pi in it. (Well, not in it, but attached very firmly to it.

James’s girlfriend is an enthusiastic potter, and James is an equally enthusiastic hacker. They came together and made beautiful music a kiln. The project is based around an old electric kiln, which James built holes into to convert it into a propane-fired updraft kiln. A Raspberry Pi is hooked up to a thermocouple and a stepper motor that controls the propane regulator. James 3d-printed gears and a clamp to operate the regulator/motor setup.

Stepper motor and propane regulator

The kiln operates via a PID, which controls the temperature taking closed-loop feedback from the thermocouple to the regulator. Adjustments can be made remotely; the kiln controller system has WiFi. James has a really interesting series of photographs, with explanatory text and some examples of test firings, over at imgur; he also answers questions about the project at Reddit.

Results of two test firings – the variously floppy things are pyrometric cones, used to measure temperature in different parts of the kiln.

There are so many reasons I love this project. It’s a wonderful demonstration of what can be done with no specialised experience (James had never worked with kilns before starting this project, and neither he nor his girlfriend had any knowledge about firing pottery). The ingenuity on show is just brilliant (3d-printed gears!), the pottery that comes out of the end is immensely satisfying – and face it; there’s something very thrilling about flames. On top of all this, the whole project came in at less than $200.

All James’s control software, along with a BOM, is open-source, and available on GitHub.

Raspberry Pi Model A+ on sale now at $20

Raspberry Pi -

When we announced the Model B+ back in July, we said that we’d also be producing a lower-cost variant, analogous to the original Model A. Since then, James has been beavering away, and today we’re pleased to announce the release of the Raspberry Pi Model A+ at a new low price of $20.

Smaller, more energy-efficient and crazy-affordable

Like the Model A, the Model A+ uses the BCM2835 application processor and has 256MB RAM, but it is significantly smaller (65mm in length, versus 86mm for the Model A), consumes less power, and inherits the many improvements that we made to the Model B+, including:

  • More GPIO. The GPIO header has grown to 40 pins. The Model A+ is compatible with the HAT standard for add-on boards.
  • Micro SD. The old friction-fit SD card socket has been replaced with a much nicer push-push micro SD version.
  • Better audio. The audio circuit incorporates a dedicated low-noise power supply.

When we announced Raspberry Pi back in 2011, the idea of producing an “ARM GNU/Linux box for $25″ seemed ambitious, so it’s pretty mind-bending to be able to knock another $5 off the cost while continuing to build it here in the UK, at the same Sony factory in South Wales we use to manufacture the Model B+. You can buy the Model A+ today from our partners Farnell/element14/Newark.

We handed out a very few preview units to some people we know with video cameras and microphones. Here’s what they had to say:

New Raspberry Pi Model A+ Revealed

Raspberry Pi Spy -

Looks like the new Raspberry Pi Model A+ is ready to be released by the Raspberry Pi Foundation. As expected it is very similar to the Model B+ with the network socket removed. In this regard it follows the same principle as the Model A/B setup.

The big difference is the board size has been reduced making this the smallest Pi yet.

If the power consumption is improved by the same proportion then this is going to be ideal for portable applications.

Here are the specifications :

700MHz Broadcom BCM2835 CPU
256MB RAM
40pin extended GPIO
1 x USB 2 ports
4 pole Stereo output and Composite video port
Full size HDMI
CSI camera port
DSI display port (Raspberry Pi touch screen display)
4 mounting holes
Micro SD port
Micro USB power connector

The board has a smaller footprint but is fully HAT compatible.

I can’t wait to get my hands on one!

Watching an endangered Tuatara hatch

Raspberry Pi -

As I type this, Emma is hugging herself and shouting “LOOK AT THE LOVELY BABY!” We believe that every office environment is enriched by biologists.

The little guy/gal in the video above is a Tuatara – and I didn’t have to go to Wikipedia to learn more about them, because Emma is amazingly well-versed in New Zealand’s endemic lizards. One of her friends works in conserving Tuataras, which are endangered, in New Zealand. (Emma says, sadly, that we can’t have one of these in the office – they live for more than a hundred years, and we won’t be around to feed it forever.)

This video was filmed in a specially prepared, laser-cut incubator, with a Pi NoIR camera, hacked together with a DSLR lens. Over at Hackaday, Warren (what’s your surname, Warren? Let us know, and we’ll add it here), the maker, has put together a detailed how-to. He says:

Ok so a few weeks ago I was asked to film the hatching of a endangered species of reptile called a Tuatara. It isn’t often that you get a chance actually be involved in this sort of project. So needless to say I said yup I am happy to do it. Then I was told what the restrictions were….. first problem was they are in an incubator, I was thinking incubator as in the sort we see on TV with windows and such so it would be easy to pop a camera on the side focus thru a window and ta-dah video footage complete, job done, but no! No windows or no light.. The space is a temperature and humidity controlled space. So time to think laterally. I had a friend who used Raspberry pi’s and had rav’d about how cool they were. I had been tinkering with the idea of getting one for home and having a bit of a play.

The results speak for themselves. Thanks Warren; we love it.

Rendering camera images in Minecraft in real time

Raspberry Pi -

Ferran Fabregas worked out a couple of months ago how to render .jpg images in the Minecraft world using Minecraft Pi Edition. Our logo seemed an obvious place to start.

And Ferran has just made that good idea an absolutely fantastic idea, by adapting it to render images captured in real time from a Pi Camera.

Here’s his face, in all its pixellated, Minecrafty glory.

This is a really, really simple project to replicate at home – all the code you’ll need is on Ferran’s website, so if you’ve got a Raspberry Pi camera, you’re ready to go. Links to screenshots of your own in the comments below, please!

Sonic Dreams with Meta-eX and Sonic Pi

Raspberry Pi -

Dr Sam Aaron is the creator of our musical programming environment, Sonic Pi, and a researcher at the University of Cambridge Computer Lab by day. By night he’s something else altogether. The music from this video by his band, Meta-eX, was all composed on a Raspberry Pi using Sonic Pi.

Sam’s hoping to make a making-of video – we’ll feature it here when he does. In the meantime, dim the nights, put on some headphones and enjoy.

Have you checked out our Sonic Pi competition? Your UK school can win a half-day workshop with Sam and Juneau Projects, Raspberry Pis, and more. You’ve got until January 9 to enter – learn more here!

A Raspberry Pi computer lab for learners in South Africa

Raspberry Pi -

Back in July we wrote about an exciting project aiming to make computing accessible to school students in South Africa, where most schools have no computers at all and many lack electricity. Solar Powered Learning was raising funds for a Raspberry Pi computer lab at a secondary school in Johannesburg, with the aim of creating a facility that can be reproduced all over South Africa, and powered by solar energy where mains electricity isn’t available.

Their Indiegogo campaign was successful; we donated a classroom set of Pis and accessories, and project manager Taskeen Adam and fellow organisers set about coordinating volunteers to sand, drill, paint, lay cables, build desks and fit curtains.

Remarkably, less than one month after the close of the fundraising campaign, the new computer lab was ready to use.

Computers in the new lab on the day of its launch

Graham Schwikkard, a good friend of Pi who represents us in South Africa, went along to the launch of the new facility in September. He writes:

The team really did a stellar job meeting such a tight deadline. I was especially charmed by the school choir opening the ceremony, a student’s poem extolling the potential of technology and the many hand written thank you letters from students. It was very clear that the school, teachers and learners are very excited and appreciative of the project.

Learners and teacher enjoy using their new lab for the first time

The Lab itself utilises a Linux Terminal Server Project (LTSP) with the Raspberry Pis working as thin clients. The server is additionally loaded with Khan Academy Lite (adapted to the local curriculum). This lets the students have a capable desktop experience and access to teaching videos and interactive exercises. Worth mentioning are the key local partners Siyafunda CTC, PiFactory and Ismail Akhalwaya, who have done a similar setup previously at another local township school and were key in getting this project completed. ​This first pilot does not include solar panels and they were able to use a school which has an existing electrical connection.

Hopefully, in the coming months we’ll be able to see the success of the model, and we hope to see it expand across South Africa where many schools lack both computer labs and valuable computer skills.

Students wrote to thank project sponsors

Several of the students have written letters of thanks to sponsors of the project – it’s clear the school community is really excited about the opportunities their new computer lab offers. It’s been great to watch the project develop this far, and we’re looking forward to more!

Seiten

RaspberryCenter.de Aggregator – Englisch abonnieren