Monday, 24 November 2014

C3Pi is innocent, Flora not so much, and more Shrrimps are on the way.

I took C3Pi to the Elephant and Castle Mini Maker Faire a few days ago, but had to leave early since he suddenly stopped working.

At the time I blamed a loss of battery power, and thought that he'd wiped the file system on his SD card. Various holdups meant that I have only just been able to try to fix the problem which turns out to be rather simpler.

C3Pi has two controllers on board: a Raspberry Pi model B+ does the thinking, and a Teensy 3.1 controls his motors. The Pi B+ uses a micro SD card but when I removed it the card was even more micro than usual: half the card had been broken off!

I have no idea how this happened but poor old C3PI is off the hook. He's now back in action with a newly-flashed SD card and will soon be getting the first of a series of upgrades.

I mentioned that I had only just been able to get around to investigating the problem. I spend several days after the Faire learning about wearable electronics. I'd been asked if I could help with a wearables workshop at last Saturday's Southend Raspberry Jam, and as I knew next to nothing about the Adafruit Flora or Gemma I got some hardware and started to tinker.

I run Linux on my workstation and laptop and I soon found that Linux is the poor relation when it comes to programming Gemma and Flora. I can program Gemma using my workstation, but the laptop does not see the device at all, and neither sees the Flora. Nonetheless I managed to get enough code working to feel prepared.

Alas, on the day I was very poorly and had to stay at home. My friends at Southend
seem to have forgiven me as we're now planning a Shrimping It! worksop in February. More details soon.

Thursday, 20 November 2014

Wearable electronics with Gemma and Flora

From Wembley to Southend

Adafruit Gemma
This evening I'm off to Createspace in Wembley to work on some wearable electronics. I'm helping with a wearable electronics workshop at this weekend's Southend Raspberry Jam, and I need to practice!

I've been to several Raspberry Jams at Southend, and thoroughly enjoyed them. There's always a strong local presence as well as a group of regular visitors from further away. Great talks and workshops - whether you're an beginner at making things or an old hand, you'll find interesting and helpful people.


Createspace is my nearest maker space. I've been to the London Hackspace, which is awesome, but it takes me a while to get there from home. Createspace has an impressive collection of facilities and is much easier for me to get to. They have open nights, and there's a regular meetup for electronic hackers.

Gemma and Flora

Tonight I'll be experimenting with Adafruit's Gemma and Flora. Gemma is tiny; Flora is a little larger, but adds support for I2C. Both are supported by a specially configured version of the Arduino IDE which is available from the Adafruit Website.

My goal tonight is just to get familiar with the available libraries and get a simple proof-of-concept working. Once I feel comfortable I have a little project in mind. More details soon.

Advice, please!

I'm looking forward to helping at this Saturday's workshop but I'm a slightly nervous novice :)

If you have any tips or gotchas, do please tell me about them in a comment! I'd really appreciate it.

Saturday, 15 November 2014

C3Pi - Fun and Frustration at the Elephant and Castle

C3Pi from above

I went along this morning to the Elephant and Castle Mini Maker Faire to introduce C3Pi to some of my fellow makers.

The event was extremely well organised and I had no problem finding my desk and setting up. Before long C3Pi was running through his paces - fairly limited at the moment, as he still has no sensors and is controlled by a very simple command line interface.

That's about to change, thanks to Joe Walnes' brilliant websocketd - more details below.

In spite of his limited repertoire C3Pi soon made new friends and performed admirably. It's always a little nerve-wracking when he runs on a desktop. He has been known to get over-excited and career off in unexpected directions, but this morning he behaved himself...

Power problems

... until just before lunchtime, that is.

I'm still not certain what happened, but I think C3Pi's batteries ran low. What I know is that the ssh session connecting my laptop to the Pi suddenly started behaving strangely, and C3Pi's file system was completely corrupted.

There's quite a lot of work needed to recreate the file system and I had to take C3Pi home to repair the damage. Next time I'll prepare and take a backup SD card! I'll also trying out the Pi UPS which is designed to avoid just this sort of problem. By then C3Pi should aslo have a proper web interface.

A web interface using websocketd

I've wanted to provide a web interface to C3Pi for a while, but never got around to it. I am currently experimenting with a browser interface using websockets, based around Joe Walnes' websocketd interface.

websocketd makes it incredibly easy to web-socket enable any program that reads from standard input and/or writes to standard output.

There's an easy-to-follow example in the 10 second tutorial, with more detail in the 10 minute tutorial.

The software is really easy to install. It's a single, small stand-alone executable, with versions available for WIndows, OSX and Linux. The Linux versions include one for ARM processors and websocketd runs well on the Pi.

If you want a really simple way to control or observe stuff via a web browser, take a look at websocketd. Recommended.