Eben Upton Raspberry Pi Visit

Last week Eben Upton presented to a packed audience in Hursley. Luckily Stewart was taking notes and has kindly agreed to share his post on Eightbar.

by Stewart Addison (photo by Steve Haskey, who arranged the visit)

An introduction for those not familiar with the Pi …

Yesterday Eben Upton (the guy behind the Raspberry Pi foundation) took time out of his very busy schedule to give a talk in Hursley. For those who are not familiar with it, the Raspberry Pi (here is the FAQ) is basically a small credit-card sized computer circuit board with a Broadcom BCM2835 chipset and a 700MHz ARM CPU powered via a microUSB socket, HDMI+composite video output, stereo audio output, ethernet port, 2 USB ports, an SD slot used for booting the device, and another proprietary expansion port, and a high performance graphics subsystem that can decode video at full HD resolution with h.264 (MPEG-2 available at extra cost) hardware playback support in XBMC/OpenElec – all for $35 for the “model B” version. They were initially built in China, but much of the manufacturing is now in the UK and is therefore supporting the UK economy! Keyboard/mouse/power/screen/SD card are not included in that price, but many people will have suitable ones lying around to connect to it, which certainly suited me as the last thing I need is more of them cluttering the place up.

As someone who was interested in the project from some time prior to the launch it was great to see Eben in person, particularly as I’m someone who owned a BBC Micro and lost many hours to Elite (co-written by David Braben, who is also involved in the project). If that though is making any of you feel nostalgic, why not try the ZX Spectrum port of Elite running in a java applet!) The Pi as a project is trying to bring back a bit of that sense of “playing” that the BBC Micro probably did better than any other machine of its time.

(Quick disclaimer: This article is a mix of things that Eben spoke about from the notes I took, plus a few extra pieces of background information and external links that I have added myself)

The detailed background to the original idea was something I had not heard in detail before. A director of studies at St.John’s college in Cambridge, he was concerned by the declining numbers of applicants for computing university positions, as well as a drop in the quality of those applicants (basically changing from getting many people of the type who could likely already code in assembler for two different architectures to a smaller number who’s experience predominantly “I know HTML” – people who would need more time spent educating them to get to a suitable standard to teach them further) This meant that it would take longer to get them to an adequate standard on the low level aspects of computing – or by throwing them at Standard ML programming for 6 weeks to make them depressed (I remember going through that!)

 

BBC Micro comparisons

I mentioned the BBC Micro in the opening paragraphs – earlier this year there was a “Beeb@30” event to celebrate 30 years of that machine, and here is a BBC article looking back on it. It hass been well documented that they did try to get the BBC branding on the device, but the “unique way the BBC is funded” means that it was nowhere near as easy for the BBC to support such a commercially available device as happened in the 1980s. Having said that, the ARM-designed processor used in the Pi (and probably, your mobile/cell phone) had is roots in Acorn (here is a brief history of ARM) who built the BBC Micro. And there is a – possibly somewhat indulgent – project to port RISCOS (the OS designed for the BBC Micro’s successor – the Archimedes) to the Pi.

The other thing of note on the Pi is the GPIO port. Now one of the things that made the BBC Micro special was the inclusion of easy I/O on the device, through the “user port” and “parallel port”. In fact even the “joystick” port was marked as an “analogue in” to plant the suggestion it’s use could extend far beyond games. This allowed a good quality of control of external devices and responding to inputs, something that allows many more interesting control projects to be done with it. At school I did a prototype satellite tracking system using it! But I digress, the GPIO port on the Pi even looks superficially very similar to the user port on the BBC Micro. The most popular interface using it so far is the Gertboard. (I wish a could remember the name of the blue boards we used on the BBC Micro – anyone know?)

 

A squashed marketplace

Another good point raised by Eben was about where the previous marketplace for the BBC Micro and comparable machine has now in modern times. With the home computers of the 80s you powered them on and you got a command prompt for a programming language interpreter that almost begged you to start programming straight away – almost as though, as Eben said, you had to actively choose not to program! It was easy for anyone to go into their local computer store and make them display scrolling rude messages up the screen, and anyone owning one of those computers would have almost certainly had the knowledge to do so!

Nowadays it is less easy. Games consoles have taken over the high performance graphics market, with high barriers to development entry. It a similar story for the consumer tablets on the market at present – from a practical perspective the development needs to be done in another environment rather than on the device itself. Even most consumer PCs do not ship with any reasonable programming language out of the box. While that is less of an issue in the high download speed internet of today, during the 90s it took real will and effort to be able to program. The concept of having to choose not to program got completely lost. And that is some of the spirit that the Raspberry Pi is now trying to recreate. It does appear to be a bit of a gap in the market, even ignoring the Cambridge admission quality problem. There are real low-level boards around, but not so much of an all-in-one device like the Pi. And one interesting thought was that the aforementioned relatively simple bloat-free non-content-enriched RISCOS with the ease of switching to a traditional command line from the desktop, could rekindle some of the mentality from the 80s home computers.

 

Interest and getting to market

The amount of early interest in the Pi took the foundation by surprise – 600,000 views on Rory Cellan-Jones (BBC Tech correspondent) brief video with Braben – could that really be an indication of how big the market was for such a device? And could they deliver that many at the target price point, which was pretty much set at $25 from the start (At the time of writing only the $35 model B mentioned in the first paragraph – which includes a 100Mbit ethernet port, 2 USB ports instead of one and the 512Mb upgrade recently announced – is shipping). But the foundation has kept to the target price point for the units, and the 512Mb upgrade for the model B has not resulted in a price change. The other remarkable thing was the number of downloads – in the tens of thousands – of the SD-card operating system image for the Pi that was released some time before the device was even on sale, so no-one could use it!

The vendor partnerships with Farnell/Element14 and RS were important as it allowed them to move from being a risk-averse charity to more of an IP licensing company to get the number of units they were going to need. And it was a good decision. The first day on sale, as those like me who were up at 6am to order will be aware, was a bit of a disaster (and I blogged to vent my frustration at the time, questioning the motives of many of those buying and how it was pitched by some parts of the media). 100,000 orders were placed by the lucky people who even managed to get to the manufacturing partners (Farnell/Element14 and RS) websites. Both crashed badly under the load, preventing people from buying their resistors or other electronics from those suppliers, not just Pis! A lesson in robust scalable web sites for those two companies.

Another interesting point for those who have been interested in the Pi is that although most of them used in relatively rich countries such as the UK and will therefore make use of the on-board HDMI output (HDMI-DVI-D adapters can be had for under £2 on ebay if needed – make sure you get male/female as required for your setup!), the Pi also has a composite analogue video output. For me, this is convenient as it allows me to attach it to my in-car screen, but as Eben pointed out it also allows it to be sold in much poorer/emerging countries in the world, where second hand analogue TVs are still in use, and the Pi can give them a new lease of life for a price point far less than, for example, a tablet.

So it was good to have the talk from Eben, and I chatted to him about some other things afterwards. Fantastic to get his time, and of course this blog has been written in a browser running on one of my Pis 🙂

 

A different kind of TV remote control

I’m very excited to be welcoming another Hursley innovator as a guest here on eightbar – Benjamin Hardill (you can find him on Twitter as @hardillb). Here’s some insight into what he’s been up to lately! More home automation, hardware hacking, and MQTT messaging adventures follow 🙂

I got a new TV around Christmas last year and while unpacking it I noticed along with the HDMI, SCART and other sockets on the back it had a 9-pin socket labelled "RS232C IN CONTROL&SERVICE". I didn’t think that much of it at the time, but I remembered it last week while thinking about a couple of problems that had come up.

Tidy TV setup The first of these was that I had got home twice recently to find I’d left the TV turned on while I was at work, this was mainly because I use MythTV and I’d left it at the menu screen rather than turning the screen off as well. This had left shadow on the menu on the screen for a day or so afterwards (luckily no permanent damage as would have happened with a plasma or CRT TV).

The other point was from when we all first got hold of our Current Cost meters, there had been a lot of thought about how to work out exactly what appliances were on at any given time. While spotting when things like an electric water heater turned on was relatively easy, it was proving difficult to spot some of the lower power devices.

A plan started to form and I ordered a null modem cable from Amazon (£2.18 with free shipping) and went looking for some documentation on the protocol. The manual that came with the TV while being nearly an inch thick just covers the basics of how to plug it in and turn it on, but there was a CD-ROM with a much more detailed PDF document. The version for my TV is here. While searching round I found manuals for several other LG LCD/plasma TVs and they all seem to use the same basic protocol.

The protocol is relatively simple

[cmd1][cmd2] [setid] [data]

Where the cmd1 & cmd2 are 1 letter code, setid is for if you have multiple TVs connected to the same cable, the default id is 01 but you can change if needed, using 00 will work for all connected TVs. And data is a hex value of the option to pass the command.

The response from the TV looks like this for a success

[cmd2] [setid] OK[data]x

and like this for a failure

[cmd2] [setid] NG[data]x

The command to turn the TV on and off is "ka" so sending

ka 00 1

turns the TV on and sending

ka 00 0

turns it off. Most of the commands will reply with the current status if they are passed ff as the data. So sending

ka 00 ff

gets the following when the TV is off

a 00 OK0x

So now I had a way to turn the TV on and off along with checking its current status. The next step was to surface this some way and given the fascination we all seem to have with messaging, MQTT seemed like a good idea. A little bit of Java and the Java COMM API later and I had 2 topics TV/Commands & TV/Status.

I already have a topic that publishes if my mobile phone is in the flat by pinging it with Bluetooth. Combining this with the two new topics I can ensure that the TV is turned off when I leave. I’m also wondering if I should start to log the amount of time the TV is on, but I think the results may scare me a little…