Tangram: An Open Source Map Rendering Library

I have a Raspberry Pi project that I’d love to use street maps for, but it would be a daunting challenge for me to figure out how to read map data and write the code to draw the maps on screen. It’s why I was delighted to discover Tangram ES, which is a library for rendering 2D and 3D maps using OpenGL ES 2 with data from OpenStreetMap. The library works on a number of devices, including of course Raspberry Pi.

Patricio Gonzalez Vivo (from the video above) and the team at Mapzen are responsible for the open source project, which is an offshoot of their WebGL map rendering library, Tangram. While Tangram ES is still a work-in-progress, they’ve been using Raspberry Pi 2 to speed up their development of the library and they’re ready for more people to take it for a spin.

Structured a lot like a research and development lab, Mapzen is a startup founded with the idea that mapping done collaboratively, transparently, and in the open can produce more resilient software, and ultimately, better maps. Their focus is on open source tools and using open data to create the building blocks for future mapping applications, including search & geocoding, routing, and transit, in addition to the rendering work they’re doing with Tangram.

Patricio is a graphics engineer on Tangram, responsible for implementing different graphical features such as tessellation, lights, materials, environmental maps, and other CG effects. The team also includes Brett Camper, who is Mapzen’s co-founder, as well as Peter Richardson, Ivan Willing, and Karim Naaji. The ES version of Tangram was started by Matt Blair and Varun Talwar.

“Last December Karim and I thought it could be interesting to get Tangram ES running on a Raspberry Pi,” said Patricio. “At the beginning we thought it would be difficult and probably slow, but at the end we were surprised by the speed of the app and how easy the implementation was. Cross-platform C++ development is possible!”

“In a way, the Pi is an ideal test platform for developing graphics software that targets low-power systems,” said Matt. “The OpenGL ES 2 implementation on the Pi is the strictest that we’ve encountered, so it has become our gold standard for ensuring correct usage of OpenGL. The only major missing piece on the Pi was a compiler that supports C++11, which Tangram uses extensively. However since the Pi is a complete Linux distribution, installing the packages we needed with apt was a breeze.”

Don’t have to take Matt’s word for it; you can install and test drive Tangram ES on the Raspberry Pi right now:

Installing Tangram ES

Using Raspbian, here’s how to install the Tangram ES library from the command line and execute the included sample code:

sudo apt-get update
sudo apt-get install cmake g++-4.7 libcurl4-openssl-dev
cd ~
git clone https://github.com/tangrams/tangram-es.git
cd tangram-es
git submodule init && git submodule update
make rpi
cd build/rpi/bin


Announcement: Creative Technologists 2015-16

Hey everyone!

After much preparation we are super happy to announce an exciting new project from the Raspberry Pi Foundation.


Creative Technologists

The Raspberry Pi Creative Technologists is a mentoring programme for creative people interested in technology aged 16 – 21 years old. If your passion is the creative arts, and you’re wondering how you can use technology to enhance that, this is for you.

Ben and I are heading up the programme, and the first year will run from April 2015 to April 2016. We will provide individual and group mentoring via online video chats, industry networking and technical support. It’s free to participate. As well as costs of food, travel and accommodation, each participant will also receive a Raspberry Pi 2 starter kit and a £300 materials grant, and the group will receive a £1000 grant for exhibition costs.

Applications are now open and the deadline is 9am on 30th March 2015.

We are both certified Arts Award Gold Advisers – so participants will have the opportunity to complete Trinity College London’s Arts Award Gold accreditation; a Level 3 Award, a QCF credit value of 15, and 35 UCAS points.

We will also have some amazing partners helping us out with mentoring and site visits: Victoria and Albert Museum Digital Programmes, Writers’ Centre Norwich, FutureEverything, Pimoroni, Saladhouse and Hellicar&Lewis.

For full details on the programme, and how to apply, visit the new Creative Technologists page.


Welcome James to our Education Team

If you visited us at the Bett Show in January, or came to Picademy in October or February half term, then you will recognise James Robinson as one of our education team volunteers. He is a well-established member of the Computing At School community, as both a CAS Master Teacher and CAS Hub Leader for Cambridge. He is also a Raspberry Pi Certified Educator and a frequent attendee of Cambridge Raspberry Jams.


I’ve known James for roughly a year now. He is a hugely successful and experienced teacher whose opinion I have sought on regular occasions. We also seem to keep bumping into him at Computing education events like the CAS Conference, and PyconUK as well as at community events like Piwars. It seemed like we were destined to work together!

James says:

I have always enjoyed tinkering with technology and understanding exactly what’s going on under the surface. To learn more, I studied Computer Science at university, and graduated with first class honours. This enhanced my passion for the subject, and I worked at IBM for a while. I initially trained as a maths teacher, but within a term I was leading an ICT department in a middle school, and offering training to non-specialists. Most recently I worked at Soham Village College as lead teacher for Computing. I am very excited about the introduction of Computing to KS3 and 4, and enjoy testing and developing projects with students. My current interests and projects include: using Raspberry Pi in the classroom, Minecraft Pi, Sonic Pi and High Altitude Ballooning. Looking forward to working on the weather station and getting more schools involved with Pi in the sky!

As part of the Foundation’s Education Team, James will be writing educational resources for the website (especially schemes of work for teachers of KS4), as well as continuing to assist with Picademies and other outreach. James has the best case I’ve ever seen for all his Raspberry Pi bits and bobs, and as soon as I saw it I knew he would fit in around here.




She said yes

Matt Broach made this box, which contains a Pi, to propose to his girlfriend Jackie.

Box o' love

She’s now his fiancée. The box does something at the end of this video that made my heart go boom-biddy-boom. Beautiful job, Matt.

Congratulations to you both from everybody at Pi Towers!


A history of Raspberry Pi in LEGO

There is a significant chance that this is the very best thing on the internet. Richard Hayler and his two boys have built a massive LEGO diorama tracking the history of the Raspberry Pi, from concept to Astro Pi’s visit to the ISS.


The level of detail’s amazing. Here’s a group of mad scientists inventing the Pi:


And here’s a primary school with its own Raspberry Pi setup, some deliveries going on in the background.


Here, for some reason, are a PIrate, MOnkey, RObot and NInja hiding in some bushes.


And here’s a lady in a pith helmet.


There are loads more pictures and much more explanation over at Richard’s website: click here, or on any of the pictures to marvel at the enormous detail Richard and the boys have gone into. Bonus points if you can work out what the hotdog guy is all about. (I couldn’t, and I work here.)



The Raspberry Pi Guy interviews Eben and Gordon

On Monday, Matt Timmons-Brown, The Raspberry Pi Guy, took a day out from revising for his GCSEs to come and do some video interviews with Eben and Gordon. We really enjoy working with Matt; he asks difficult questions, and I think that many of you will find this interview particularly interesting, as Eben talks about plans for open-sourcing the Pi’s graphics stack, what’s going on with the display board, what’s up with Windows 10, and much more.

Thanks Matt – come back to Pi Towers when your exams are over! (Next time, we want more Gordon!)


Five million sold!

Yesterday we received some figures which confirmed something we’ve suspected for a few weeks now: we’ve sold over five million Raspberry Pis.

The Pi has gone from absolutely nothing just under three years ago, to becoming the fastest-selling British computer. (We still have Sir Alan Sugar to beat on total sales numbers – if you include the PCW word processor in the figures, Amstrad sold 8 million computers between 1984 and 1997.)

We roll this picture out every time we have a sales update: this is the first batch of Raspberry Pis we ever had made, around this time three years ago. There are 2000 original Raspberry Pis in this pallet. That’s 0.04% of all the Raspberry Pis that are currently out there. (Every individual Pi in this pallet now has 2500 siblings.)

There were so few Pis in this first production run that Eben and I were able to stick them in our car and drive them to RS and Farnell’s headquarters.

Three years ago today, I was sitting at my kitchen table stuffing stickers into envelopes (we were selling them for a pound a throw to raise the money we needed to kick off the original round of manufacture). Today, I’m sitting in an office with nineteen other people, and if I’m quite honest, we’re not quite sure how we got so far so fast. It definitely feels good, though.

The Raspberry Pi Foundation is a charity. That means that we personally don’t make a profit from the Pi – all profits go straight back into our educational mission and into R&D. Your five million purchases mean that we’re able to train teachers for free; provide free educational resources; undertake educational outreach; fund open-source projects like XBMC (now Kodi), PyPy, Libav, Pixman, Wayland/Weston, Squeak, Scratch, Webkit and KiCad; and – for me, most importantly – we fund this sort of thing (and much more; you’ll hear more about projects we’ve sponsored with our education fund over the coming year, as they get written up by their owners).

Thank you. The Raspberry Pi community is a wonderful thing, and we’d be absolutely nowhere without you all.


Portrait of an Inventor

Just before the launch of Raspberry Pi 2, RS Components, one of our two main manufacturing/distribution partners, sent a film crew to point some cameras at Eben for the day to talk about the history of Pi, about the new device, and about what we do. (He had a cold, which is why he sounds like Darth Vader.) This is the resulting video – we hope you like it!


Astro Pi: Mission Update 1


I’m sure a few of you are wondering why we’re not screaming about this from the rooftops, right? Okay: stand back, here we go.

To quote the Portal space core: “SPAAAAAAAAAAACE!!!!!

Back in March 2014 Eben sent a casual email around the office asking if anyone wanted to join him at a meeting between the Surrey Space Centre, Airbus Defence and Space and Surrey Satellite Technology (SSTL). So, being a space geek, I tagged along and we found ourselves talking about the possibility of using a Raspberry Pi in space flight for a variety of applications.

There was excitement over the possibility of flying several compute modules on a cube-sat for a space software lab experiment, and Stuart Eves, who is the lead mission concepts engineer at Airbus Defence and Space, was especially enthusiastic about using Raspberry Pi as a mechanism for educational outreach by UK Space (a trade association of companies that contribute to the UK space industry).


A month or so later, another meeting was on the cards, and this time the UK Space Agency (UKSA, an executive agency of the British Government) was going to be there.

That’s when I met Libby Jackson and Jeremy Curtis. Libby and Jeremy were behind the Great British Space Dinner competition you may remember from last year, and, between them have years of experience in human space flight. Doing something with British ESA astronaut Tim Peake’s six month ISS mission was on the table, but we were not sure how it was going to look.

It was clear to everyone that the existing popularity of Raspberry Pi, the connection with computer science education, and the forthcoming changes to the UK curriculum would cast a wide net over the UK; and together could generate a lot of participation in a potential coding competition. We realised that a situation where UK schools could own the same computer hardware that was in space had never, as far as we knew, existed before.

Doug Liddle, head of science at SSTL, told me that the possibility to achieve this was more exciting than anything else the UK Space trade association had been considering for Tim Peake’s flight. So over the course of several further meetings we put together an outreach plan that would provide a range of computer science challenges to cover the diverse needs of the space industry. At the core of these would be a Raspberry Pi with a range of peripherals and sensors which would act as the platform for the pupils to send their software into space.

Libby and Jeremy took the plan to the European Space Agency (ESA) for approval, and it was well received. To very briefly summarise: the programme would be split into two halves, with some activities that Tim would do up on the ISS during his mission and a competition run on the ground before blast-off.

At this point we still hadn’t decided a name for it and I think it might amuse you to see the names that we were considering:

  • Pi in the Sky
  • Astronaut Pi
  • Astro Pi
  • Cosmic Pi
  • Fly Pi
  • Space Pi
  • Chris HATfield
  • Astronaut HAT
  • Orbital Pi
  • Peake Pi
  • Raspberry Peake

As the year went on, we were well into discussions about what the hardware would be like. It was agreed that it would be a B+ HAT that could be mass produced and made widely available to schools and the general public. The same HAT would then be flown, along with Tim’s Raspberry Pi, to the ISS, thus creating the situation where all school pupils have exactly the same computer hardware as the astronauts are working with in space. They would be able to write code against their own Pi, and that could then be sent to the ISS and run on Tim’s Pi!

If you win the Astro Pi competition this is exactly what will happen to your code.


We didn’t want the Astro Pi HAT to have any single purpose, but rather to be a toolkit that could be employed in many different ways. Initially the list of sensors we wanted to have on it was enormous, and this had to be trimmed down due to the physical space constraints of the HAT standard. The sensors that made the cut were chosen for their ability to provide learning opportunities in the context of space flight. The solar arrays on the ISS, for instance, each have about 12 gyroscopes to control their orientation so that they can track the sun. Accelerometers are used to measure forces exerted by thrusters on all space craft, and magnetometers work like a compass so you can know which way you’re facing in relation to the Earth’s magnetic field.

We also knew that we wouldn’t be able to plug the Astro Pi into anything like a monitor or keyboard, and that it would have to run headless. Having some kind of visual output, despite this constraint, would be important: so this is why we included the 8×8 matrix of LEDs. Use it wisely!


So all that was the easy part. Meanwhile we began the process of getting the hardware approved for space flight with ESA. Space conditions are challenging, and because of this there is an abundance of testing that must be done for any object going up to the ISS. What you need to possess, to be allowed up there, is a flight safety certificate. The process to obtain this for Astro Pi is still ongoing as I write this blog entry.

There two kinds of payloads (space cargo consignments): they’re called “educational” payloads and “real” payloads. Educational payloads are usually inanimate objects, like balls which are sent up to collide together in zero gravity to demonstrate the conservation of momentum effect or similar. Real payloads are things like the complex machines that are designed to perform a job on the station, or robotic arms that can be controlled by an astronaut. The thing that differentiates the two is the simple question: does it plug in and turn on?

So we found ourselves in the unique situation of being an educational payload that has to consume power from the ISS mains. This meant that our path through the safety approval process was not going to be trivial. Fortunately we have some of the best people in the UK Space industry on our side, who are actively working towards making this happen. ESA have also hooked us up with engineers and safety experts, who are helping guide us through their processes too. It’s been an absolute pleasure and a privilege to work with these folks.

Here is a list of some of the tests we have to do:

  • Flammability assessment
  • Off-gassing assessment
  • Electromagnetic interference / susceptibility assessment (the CE and FCC ones don’t count in space)
  • Electrical interface testing (to prove we can consume power from the ISS safely)
  • Vacuum exposure assessment
  • Sharp edges hazard assessment (so we don’t accidentally poke holes in any astronauts)
  • Launch conditions vibration test (to make sure the Astro Pi still works afterwards)

We plan to shout about each of these on social media in the coming months, as they happen, so stay tuned! Once we have the flight safety certificate we can be scheduled for a launch. This was originally planned to be an ATV or Space X Dragon capsule, however it now looks more like we’re going up on the Soyuz rocket with Tim Peake himself. I can’t believe I just typed that.

Tim Peake Mission X

I had opportunity to meet Tim at the Farnborough Air Show last year too. He was there doing the closing ceremony of Mission X with the UK Space Agency, but was able to spare an hour of his time to attend one of the UK Space progress meetings. We gave him a general Raspberry Pi demonstration and talked a bit about the competition and what he would be required to do. He was really enthusiastic and said he wanted to make it as interactive as possible, even suggesting the possibility of a live debugging session with the competition winners.

Imagine randomly getting a phone call from the ISS: “Hello this is Tim Peake on the International Space Station, I’ve just found an error on line 21 of your code. Does it work properly on yours?”

I don’t know if that will happen, but it might!

Aside from the flight safety procedures, a lot of mission specific documentation needs to be produced too. You may not know this, but a lot of the European crew operations on orbit are controlled from a little house in Lucerne, Switzerland. Libby Jackson and I paid them a visit in December last year to give them an orientation on the hardware. They’re a division of Lucerne University called BIOTESC, and they write all of the step-by-step procedures that the crew follows during day to day operations. Understandably they all have very good personal and professional relationships with the crew members.

BIOTESC Lucerne Switzerland

They’re a lovely bunch of people who are going to become super-competent in the use and maintenance of a Raspberry Pi. They’ll be required to advise Tim should anything not work as intended up there. We had one of the Astro Pi prototype units with us and went through a few mock procedures that Tim would be expected to do. Libby took the opportunity to dust off her coding skills and spent about an hour programming a nice countdown sequence on the LED matrix which she blogged about here.

Back in the UK, the Astro Pi media drive was beginning to roll into action. Many people from UK Space trade association were working behind the scenes to get the website ready, setting up interviews and organising press conferences. The announcement was scheduled for 10 December at the CGI offices in Kings Cross, London. Press were invited and we had a number of school students from Weydon School in Surrey join for a Raspberry Pi workshop during the conference. The full report from that day can be found online here. The BBC were involved too and technology correspondent Rory Cellan-Jones caught up with Tim and interviewed him about Astro Pi.

Meanwhile, our artist and animator, Sam Alder, who had already designed the Astro Pi logo, was busily working on story-boarding and producing a cartoon about the competition. We were fortunate to be allowed to record Tim Peake’s voice for it. Sam and his colleague from Saladhouse Studios, Scott Lockhart, met up with Tim to do the recording at a hotel in London. He told me that they sat down, started looking through their notes, and looked up at Tim in his ESA polo shirt and whispered: “I can’t believe this! What the hell are we doing here?”

The final cut of the cartoon was kept under wraps with the intention to show it during the competition launch at BETT 2015 for the first time.

We had planned to do a live link interview with Tim, who would be in the United States, during the BETT arena presentation. Sadly this fell through because he was travelling on that Friday. So instead we organised a Skype call the night before, and I was the lucky one who got to interview him!

It was recorded on my computer at home. This was my own “What the hell are we doing here?” moment; I was a bit like a starstruck rabbit caught in the headlights for the whole interview.

So the next day Lance Howarth from the Raspberry Pi Foundation, Jeremy Curtis from the UK Space Agency and Doug Liddle from Surrey Satellite Technology gave an exciting presentation to a crowded BETT arena. Here is the Skype interview:

The cartoon animation was then shown to round off the presentation. This is by far my favourite of all the animations Saladhouse have done for us.

So that just about brings us up to date. ESA have told us that Astro Pi is the most advanced educational payload that they’ve seen, and that they’re watching what happens here with interest. If we have a high degree of participation in the competition then ESA may decide to repeat the whole process for the rest of Europe with another astronaut. So please do your bit and tell everyone you know! We want every school in the UK to participate!

We’re working hard to get the Astro Pi HAT manufactured in volume and we’re hoping for them to be available by the middle of March. But don’t forget that you can win them too! Secondary school sign up is now live so head over to astro-pi.org and read more about the competition rules.

Primary Schools enter here.

Secondary Schools enter here.

Thanks for reading this far; I know this is a long post. One final thought I’d like to leave you all with is regarding an awesome tradition of the Russian space program that is still observed on all Soyuz launches to this day. The Russian commander is responsible for choosing a talisman that hangs inside the capsule. It’s a visual indicator of when the spacecraft has reached weightlessness and dates right back to Yuri Gagarin (the first person in space).

The talisman is usually some kind of stuffed toy, and if you watch the most recent launch video below, where Italian ESA astronaut Samantha Cristoforetti went up, you’ll see they used Olaf from Frozen! Watch for the main engine cut off at 09:15 for when he shoots forwards and becomes weightless.

Can anyone think of a stuffed toy that might be appropriate for Tim’s launch?


The results are in for the Sonic Pi Competition!

To celebrate the launch of Sonic Pi 2 we held the inaugural Sonic Pi competition. We were looking for some of the best space-themed music, coded with Sonic Pi v2.0 on a Raspberry Pi by school children in the UK aged between 7-16 years – and we were not disappointed.

After a month of judging, Dr Sam Aaron, creator of Sonic Pi, and the Foundation gang have whittled all the entries down to just ten finalists. We will be announcing the overall competition winner at the Raspberry Pi birthday celebrations at the end of February.

Here are Sam’s thoughts on the competition:

Greetings Live Coders! Let’s gather round to discuss the results of the Sonic Pi competition. It’s something I’ve been looking forward to talking about for a long time. You see, I wrote Sonic Pi to give people the tools to make music they otherwise may never have made. It may sound crazy, but had a dream that once Sonic Pi was in the hands of others, especially children, music I couldn’t even dream about would be created using it. If you look back into the history of music you’ll see an interesting pattern – time and time again new genres of music explode out of people fearlessly experimenting with new technology. It was therefore a wonderful experience for me to listen to every one of the entries and repeatedly hear a fearless experimentation with code as a new technology for music. Thank-you!

This year’s competition was all about space, and it was fantastic to hear such a broad range of interpretations of the theme. Through the music, I was taken on a range of exciting journeys – drifting through galaxies, exploring the moon, escaping space battles and hearing sounds which can only be explained as alien.

Another aspect of the competition was the structure and readability of the code. Again, I was amazed by how much of Sonic Pi’s functionality was being used across all age ranges. Some people think it’s crazy to teach threads at school level, but these compositions show how not only has the concept been understood, but used in interesting ways. It was lovely to see so many of the entries display a real care for how the code was laid out and organised. Many were at a the standard of a professional programmer!

Of course, every competition needs winners, and we’ll get to those in a moment. However, before we do, I’d like to express my deepest thanks for everyone that entered. Each one of your entries made me smile. Thank-you so much, and please keep on coding!


Drum roll please…

Here are our 10 finalists (including cover art, audio, description and code)! If you would rather listen to the compositions then we’ve created this soundcloud album. Enjoy!