A first at Dev8D: open source iPhone app for home automation

Ever wanted been away from home and wanted to check that the heating was off, or the lights switched on? Or wished you could switch on the kettle from the warmth of your bed when the morning alarm goes? All these things have been possible for a while now – but at a price. Now, with the software to automate home products becoming open source, the field has opened up for all kinds of innovative – and low cost – applications to make life easier, safer or just plain cosier.

Here at Dev8D, after attending just one iPhone development workshop, David Tarrant has created an  iPhone app, based on open source software, to control a light using your phone, wherever you are in the world. He explains how.

David Tarrant’s iPhone app

“The Z-Wave protocol for home automation products has only just become open source after being closed for a number of years. It has sparked an online community outside of academia with quite a few UK and US developers developing an open source library to talk to Z-Wave products.

We have created a Windows, Linux and OSX version of the library where before there had only been a Windows one. That library was finished on Sunday night, and I built a simple REST api for this library so that I can switch a device on and off, such as a light. Yesterday I could do it through a web browser and, thanks to the iPhone workshop, I’ve now created an iPhone app to control it.

This is a simple example of home automation, just like the products that are already available to do things such as control heating, turn on and off appliances and monitor your house. It is even possible to set up profiles for rooms so that you can put a room into different modes and use a combination of devices within it, all controlled by just one switch.

The difference now is that you can do all this without having to buy expensive, locked-down proprietory software or hardware controllers. The library is available under an LGPL licence. The kind of automation I’ve done here would previously have cost £400-£600 to buy – I’ve done this for about £120 and we expect the cost to come down as more open source developers get on board and have a go and want to buy more of the products.”

Interview: Sam Easterby-Smith and iPhone apps

Happiness Pipe iPhone versionI run a small consultancy business in Manchester called Spotlight Kid specialising in iPhone and mobile related stuff, generally focusing on applications for education, entertainment and the arts. I run training courses, strategic workshops and do actual real development work! In the old days I used to work for CETIS at Bolton.

Why iPhone apps?

I think the iPhone is interesting is because it changes the context of computing. Instead of it being a desk-based thing, or a sitting down in café with a laptop kind of thing, it becomes a wherever you are, stood on a street corner, always in your pocket kind of thing. While mobile devices, even with connectivity, have existed for years, the iPhone was the big game-changer in terms of making it usable and rather popular. Likewise, I think if the iPad has a niche it belongs on the sofa or the coffee table, again shifting the context.

And is the iPhone a Dev8D kind of thing?

There’s certainly interest here. I led a workshop yesterday where we took something like 30-40 people with no knowledge of programming in Objective-C from ‘hello world’ to building a very simple Twitter search client. That’s already had the result that one of the people doing the workshop has started using what he learnt to do to build a lightswitch into his phone in the Arduino workshop. Very impressive!

What iPhone projects have you been working on here?

I’ve been particularly thinking about navigation within buildings. This is a problem for most GPS-enabled hardware at the moment, it becomes very inaccurate within a building and so the accuracy of your location goes from 10m to anywhere up a kilometre or two.  I’ve been thinking about how to solve that problem and looking at data we can use in an augmented reality type of context, including the resources provided by the MLA and other bits of geo-tagged data we can find. It’s about using augmented reality techniques to visualise geo-located data of various kinds.

[Sam showed me the version of this he is working on: point the phone in a direction and  notes pop up on the screen displaying landmarks and their distances from that point, both within the building (such as the Project Zone) and outside (such as Russell Square tube station). In addition, a note about which event or talk is on in each location within the building appears.

The idea is that this will be a generic tool that could be used with any data set from a conference or even a music festival or arts event, such as Glastonbury or the Edinburgh festival]

Last year you made the Developer Happiness Pipe. Is it back again this year?

It’s back – with an iPhone version! Getting here this year I made a couple of minor changes – most important was adding a JSON output format so that can catch the data from it and export it. So I can pick that up from the iPhone up to work out what the current happiness rating is.  Anthony Seminara has made a set of Lego people images representing 10 different states of happiness.

What are your top 5 tips for building iPhone apps?

  1. Don’t make it too complicated
  2. Do your memory management properly
  3. Make something that people will want to use everyday
  4. Make something that works better on your phone than on your desktop
  5. Read Apple’s user interface guidelines otherwise they may reject it from the store

Interview: Kieran Marron

kieranKieran Marron is a web developer at Eduserv, a not-for-profit organisation which delivers technology for various public sector services.

What are you hoping to get out of Dev8D?

This if the first time I’ve ever been to this kind of thing. I’m here out of sheer intrigue! Yesterday morning I attended all of the lightning talks, and I’ve also been to the Zenity coding dojo. The dojo was a very good session, it was a great way to learn from other people.

What kind of skills are you gaining by being here?

I’m very keen to learn more about Zenity, as it’s about repository data stores and sharing data. It’s definitely something we’re going to be using so it’s good to see how it’s been applied early on.

More generally it’s also good to see a whole hall of people working on madcap ideas, just trying things out together and seeing what can happen.

Of all the projects or ideas you’ve seen, which will have the greatest impact?

The 3D printer has definitely stolen the show, It’s absolutely mind boggling! The fact that anyone can do it, and it’s so cheap.

Workshop: Arduino happiness

One of the events that has been creating a real buzz at Dev8D is the daily Arduino workshop. For a couple of hours each day, groups of developers have been let loose with basic electronic equipment – think breadboards, LEDs, resistors and wire cutters – and discovering the joys of using a microcontroller to programme little lights to flash in sequence and cheesy tunes to tinkle out.  The tweets and excited chatter following the morning workshops – and the attendance at the afternoon’s more advanced sessions – all testify to the way that it has caught the imagination of Dev8D participants.

Arduino kit

At the heart of the workshop’s activities is the Arduino circuit board, a small piece of open source hardware named after the pub where, in 2005, three Italian techies came up with the idea for an inexpensive, powerful microcontroller. (The story behind Arduino is pretty cool – find out more in this Wired article from 2008)

Arduino

Since then many thousands of units of the ‘official’ Arduino board (identified by the Italian flag on the back) have been sold and, because the designs are licenced under Creative Commons, many millions more have been made and used. The Arduino is cheap, fast and flexible and, as a result, it has swiftly become the circuit board of choice for makers all over the world. Check out the Arduino Playground exhibition page to discover some of the quirky creations, which include robots, musical instruments and note-taking systems.

So what’s the appeal of Arduino?  “It’s very direct, very tangible,” says Garry Bulmer, the Dev8D workshop leader. “A lot of modern applications have got obsessed with windows and mice and keyboards and people think that’s what computers are but there are 25 times more of these around which have very different physical interfaces.”

This also makes them ideal for the work Bulmer does introducing electronics to kids in after-school clubs. “The kind of technology that high tech labs had 30 years ago to observe the world, kids have now so if they are ingenious they can do some quite radical things. It’s delightful for me for people to be able to do what used to be high tech activities.”

Arduino workshop

It’s this element that has impressed Alistair Grant, a developer who took part in the workshop in the hope that it might help him to teach programming to a younger age group. He compares using Arduino to Lego Mindstorms, a graphical language with Lego blocks that proved that you could teach even really young kids the basics of programming.

“This could work as a similar method as the concepts are similar,” he says. “Most kids love building robots and making flashing things and this is playing at it in the full way they would use it, it’s not stripping it down much or dumbing down, it’s something real to use. The breadboards are great as there are no health and safety issues with hot soldering irons involved!”

Talking to him after the workshop, he was full of enthusiasm for the potential of Arduino in his work. “This is definitely a great way to introduce younger kids to computing – if they had access to stuff like this a lot of them would be more interested in it rather than the stuff they get taught in schools.”

Arduino 2“It’s been an eye-opener,” agrees Kelvin Gan. “I didn’t think I’d find this interesting as I’m generally not interested in electronics or hardware. In school was all about building circuit boards. This, using programming, brings it into my realm.”

Although this kind of workshop may seem far removed from the everyday work of many of the developers here, there is a value in being introduced to new skills that help you to think differently.  “It’s good to sometimes do things that are very different to what you normally do as makes you look at things in a different way, and it’s always good to be reminded how quickly you can learn new stuff –  it’s too easy to get daunted by doing new stuff and forget how much progress you can make in a couple of hours,” explains Juliette Culver, another happy participant in the Arduino workshop.

Playing with Arduinos is cheap, you say? How cheap?

Chris GutteridgeMake your own Arduino LED circuit for not very much money

You need:

Breadboard (£1.80)
Battery (34p from the Poundshop)
LED (5p each)
Resistor (1p)
Red wire and black wire (5p a metre)
An Arduino (£23 or, with Open Source, could make your own for £14)

Follow the instructions and within a couple of hours you, too, can have your own Blinking LED or Doorbell of Loathing.

I have an idea: democratic web development

Chuck SeveranceCharles Severance (aka “Dr Chuck”) believes anyone can be a web developer. Here he explains how.

“My crazy dream is for everyone in the world to build their own web applications. Non-technical people are creating content online with text, images and video, but I think there’s scope for so much more. I want to help people create their own Twitters, their own Facebooks – any database-backed website they can think of.

Google have created a way in for this democratisation of web development with their Google Application Engine, which is a free hosted service for apps.

$10 a month for php hosting might not be a big deal for someone in the UK or USA, but for much of the world it’s a lot of money. But now we’re opening up web development to people who might only have access to a computer once a week, from an internet cafe.

So Google have provided the infrastructure for low-cost web applications, but we also need to give non-developers the skills to create whatever they want.

My intention with the book was to take someone who knew nothing about programming, and in a couple of weeks teach them the HTML, CSS and Python they need to create an app which can run in the Google cloud.

I want to bring down the limitations of what you can do online. I want people to leave the limitations of MySpace and instead start thinking of ‘my space’ – their space. Everyone on this planet has the right to own their presence on the internet.

Web development is art, and programming is our paintbrush. We should be opening up this community and giving everyone the tools they need to become artists in our digital landscape.”

Charles Severance’s book Using Google App Engine is published by O’Reilly.

RepRap: the self-replicating 3D printer

For anyone who has read Cory Doctorow’s Makers (and if you haven’t then I urge you to. It’s free under a Creative Commons licence) the idea of a self-replicating 3D printer will not come as a surprise. However, there is still something mind-boggling about seeing one in action and thinking through some of its potential uses.

RepRap demo

That was the treat in store for Dev8D participants today when Adrian Bowyer from the University of Bath demonstrated the RepRap. It’s a 3D printer that will not only print out plastic objects – from children’s shoes to doorhandles – but will also print out most of itself. As Bowyer says, “anyone with a RepRap can make one for a friend!” What’s more, as it is licenced as open source, under GPL, with all the instructions available online, anyone with a RepRap can make one for a friend for free and with their own modifications and improvements.

RepRap printerThe RepRap can currently copy about half of its own parts and the others (such as nuts and bolts) are almost entirely available from general hardware stores with a couple of specialist components needing to be bought online. At its print rate of about 19ml an hour, it takes around 2.5 days to replicate itself. It costs about £300. To put that in perspective, the cheapest commercial 3D printer costs over £10,000. On top of that, non-open source 3D printers only allow their own, branded plastic cartridges to be used – at an inflated price. And, of course, the machines do not self-replicate.

“Companies have no commercial interest in making a machine that copies itself – as a company it’s the last thing you want your machine to do,” explains Bowyer.  “But the fact that it is not a commercial entity does not mean that it’s not in the interests of the end user.”

And the potential for the end user, particularly if that user is in a developing country, is where it gets really exciting.  At the moment, the objects people are making and sharing (see http://www.thingiverse.com) are interesting but are limited by the constraints of the material the RepRap can use (it works with a plastic, polylactic acid, made from starch). When the RepRap can deal with multiple materials, such as electronic components, the landscape will really open up.

“One of the things about making stuff is that you need a lot of capital to make almost anything – it could cost thousands or millions of pounds to set up a screwdriver factory, for example –  but a printer like this allows you to make them for a couple of hundred pounds. A small community could start putting a foot on the first rung of the manufacturing ladder and the ability to start manufacturing with low capital costs brings considerable benefits to the world’s poorest people,” says Bowyer.

“As it’s all open source they can do it without spending a penny apart from the materials and nobody can take it away from them – it’s on the web and all over the planet and nobody can kill it off,” he adds.

RepRap in action

There will undoubtedly be some commercial interests who might be very keen to try to kill off the self-replicating 3D printer. Bowyer compares the impact that printers like the RepRap will have on the manufacturing industry with the effect new digital technology had on photographic film. The difference is that, in this case, it won’t be one industry completely replaced by a technical innovation but chunks of all industries that are affected.

“It will be difficult to put this genie back in the bottle,” he says. “Industry will divide into two camps, just like with music and MP3s: those who embrace it and can see how they might benefit from having their designs replicated, and those who don’t and try to fight it.”

And what of Cory Doctorow’s point that “printing AK-47s is so much weirder and more interesting as a futuristic effect of the 3D printer than printing trademarked objects will ever be”? Is Bowyer concerned that he might have made a monster?

Bowyer smiles and takes a philosophical approach to the issue. “Every technology humanity has ever created has been used to make weapons. If I really wanted to cause mayhem, I’d buy a lathe, not one of these. But having said that, yes people may use this to make weapons but it is also human nature to make far more ambulances than we make tanks. It will not change human behaviour but will allow them to behave in different ways. There will be more medical equipment printed than weapons.”

RepRap shoe

All photos by Ben O’Steen, licensed under Creative Commons

Interview: Steve Lee talks about accessibility

Steve Lee from OSS Watch and Will Walker from GNOMESteve Lee gave a lightning talk on accessibility. Here Steve talks about why accessibility is an important issue for web developers.

“There are a several views with accessibility – the most prevalent is that it’s about helping people with disabilities to interact with technology. But it’s also about widening technology use generally.

The emergence of mobile platforms, for example, has increased the ways in which people use devices. A classic example is a SatNav in a car – it needs audio instructions because it wouldn’t be practical to use a mouse in that situation.

There are certain accessibility issues that we see all the time – one of the worst offenders is requiring users to use a mouse. Blind people don’t use mice, and many people with physical impairments use switches which use keyboard commands. So there’s no way those people would be able to use some whizzy feature you can only see if you wave the mouse cursor.

The other one we see a lot is the alt attribute of images. If you’ve got an important image on a website – and by important I mean an image with isn’t just eye candy – then you need a description of the image so that visually impaired users know what is the purpose of the picture.”

I have an idea: genetic algorthims

ants

Richard Jones from Symplectic Ltd has spent much of Dev8D helping people play with an array of plastic creepy crawlies. Here he explains why.

“What we’re doing here is using genetic programming to look at the unexpected results of simple rules. It’s similar to the way that ant colonies work – nothing in the individual ant tells the ant colony how to behave.

Essentially what we’ve done is create a population of programmes, which are basically strings of characters interpreted as programmes by another piece of software.

We set the 500 programmes – or ‘ants’ – a task: to try and solve maze. How well the ants performed was measured by another programme, which ranked the ants in order from most to least successful.

We took the best ants and ‘bred’ them to create the next generation, which was then better at solving the maze. If we did the same again, the third generation would be better still.

‘Breeding’ in this context is actually fairly true to the biological version – each programme contains 16 ‘genes’, and we select 50% of each ‘parent’ to create the ‘child’. Each gene also goes through a lengthening, shortening or mutating process, so that no child is exactly 50% of both parents. It contains something unique, just as with life.

What’s really interesting is looking at the properties that arise that haven’t been programmed in – the behaviour of the colony that emerges from the behaviour of each ant. Nothing in the individual ant tells us how the whole colony works.

We can take this idea and expand it. It’s how something like Celebrity Big Brother emerges from the given rules of the universe. There is a causal connection from one to the other, but you would never expect it.

To bring it down to a more manageable level, we can use the philosophies of genetic programming to look at something like project management within an institution.

In big organisations there’s sometimes a temptation to work out every element of a project. But what we’re learning from genetic programming is that it’s better to allow these things to emerge naturally out what is needed. What is needed will emerge, what isn’t will die – it’s the basic principle of natural selection.”

Richard Jones is on Twitter at @richard-d-jones.

Interview: Bradley McLean on how Dev8D might grow

Bradley McLean

As the CTO of Duraspace I try to find the synergies between our products and communities and external products and communities and set up projects to take advantage of them. Duraspace is a not-for-profit foundation in the US that supports the development of DSpace, Fedora commons and Duracloud.

What are you hoping to get out of Dev8D?

I’m here because it’s an opportunity to talk to many of our colleagues at the same place and the same time and look for project opportunities. This year I have tried to bring some more of the US repository developers here for the same purpose and to start to consider a similar event in the US.

It’s been observed at many formal conferences in the past that many of the value and great ideas come out of the unscheduled sessions so the grand social experiment of Dev8D to build a conference that does that day in day out for several days is fascinating.

I was here last year and concluded that it’s highly effective format and the challenge is to find ways to expand it both to a larger global community and increase the frequency so that the continuity of ideas is maintained. One somewhat idealistic vision for the future, but perhaps achievable, would be to have four Dev8D conferences spaced at roughly quarterly intervals in different areas of the globe. It would be impractical for most people to attend all four but it would allow the ideas and concepts that emerge to get a refresh every few months and you could track areas you are interested in through tweets and blogging and the other outputs. We’re working on it!

Why do communities like Dev8D matter?

Developer communities have been self-organising for a long time and have shown themselves to be of value in fostering innovation and making efficient use of resources. They enable you to find out what’s going on in other institutions and that saves time and money and gets a better product.

Dev8D demonstrates that you can set out to  have that as your sole goal – it doesn’t have to be a secondary effect of some other goal.

 What do you think your organisation gains by you being here?

The organisation gains awareness of current areas of research and project development. It allows us to plan our own research and development to complement it.

Interview: Ben Charlton talks about web security

Ben CharlotonBen Charlton is the systems administrator at the University of Kent. He gave a lightning talk on web security, going through the OWASP 10 worst web security mistakes – and how to fix them.

Why did you give a web security talk?

It’s a hobby interest for me and my day job as well, and it seemed an area that was missing on the programme.

Web security is something we’ve had a problem with at Kent, and I imagine lot of other universities will be having similar issues. Universities tend to have a lot of people doing a lot of things online, and there’s not always a great deal of attention paid to security.

I’ve already had someone come up and ask for more details – it’s impossible to cover everything on web security in 15 minutes. Hopefully the people who were in the room can now go and find out more about the issues, and it will lead to more secure websites.

What do you think your institution gains by sending you here?

Kent gain from a greater breadth of knowledge. I’ve found out about LTI – a really useful way of embedding learning objects in a VLE. That’s something we had no idea about until today. So it’s great for picking up on new technology.

Are you involved in any other communities?

List8d is another project I’ve been involved. I’m also interested in library systems.

What kind of skills are you gaining or improving by being here?

From attending Dev8D last year I knew there would be loads of different areas to get involved in. It’s amazing the things you pick up that you never expected to, just from chatting to people.

Of all the projects or ideas you’ve seen, are there any you think can be put into action straight away?

Wookie is interesting, and of course LTI has immediate applications for the University of Kent. There’s also lots of stuff that isn’t directly relevant but makes you a better programmer, like the stuff on genetic algorithms or learning about Clojure.

XKCD400

Image reproduced with permission from XKCD.com