World’s First Windows Phone Controlled Robot

Oscar Takes a Bow

Oscar, my tiny Micro Framework powered robot has become the other first robot to be controlled by a Windows Phone. Charlie Kindel was kind enough to take part in my demo and give the robot commands during the talk. Thanks for that.

I nearly didn’t make it work though, loading the wrong firmware into a device is never going to end well, but in the end all the components fitted together and a happy ending ensued. I’ll have more pictures, and the slide deck that explains how it all works, along with demo code, tomorrow.

Hardware Setup

This was the setup, you can see Oscar next to my laptop, the Micro Framework board I used as a web host is on the far left.  I also had my own router and WIFI access point so that I could get the phone onto my own private internet…

Fez Micro Robot Bottom

4390671176

If you are having bother positioning the support posts to hold your Fez Mini robot together you might find the above picture useful.  The PDF gives lots of good detail about how to fit the motors to the battery tray, but lining up the unit with the right screw holes on the base is a bit tricky. I think mine is right, at least the wheels seem straight enough for me. The back of the robot is at the bottom of the above picture.

Oh, and you don’t have to fit the line detectors where I have (just outside each wheel). This is part of an experiment I’m doing to find out how well grey scale line following can be made to work.

Geek Night Fun and Games

4389841760

This is a still from a very embarrassing video:

http://www.devdays.nl/Video.aspx?pid=75

I’m doing it again. Geek Night at Dev Days. This time I’m taking my little robot Jason and a bag full of sensors and bits and pieces. We are going to create some embedded devices on the fly and have some good old .NET Micro Framework fun and games. If you are coming to Dev Days 2010 at the end of March, then it would be great to see you. You can find out more here:

http://www.devdays.nl/GeekNight.aspx

Best Laid Plans of Mice and Robots

4344787264
Picture posed by model.

So, I had this plan to make a line following robot. I’d even figured out how to do the lines. The idea was to print track segments on A4 pages, and then laminate the pages and lay them on the floor. The robot would go from page to page and it would all work.

That was the plan.

So I drew out some track segments in Photoshop Elements, printed them out and then laminated them. Then, and only then,  (and this is the stupid part) did I get round to testing my track design with the robot sensors. Turns out that the line sensors can see white paper really well. Really, really well. I get 99% reflection when I put the robot on the white parts of the paper. Only problem is, I also get 99% reflection when I put the robot on black parts. This is not a problem with the laminate,  it seems that, as far as the sensor is concerned, black is most definitely not black. Robot fashion shows must be awfully dull.

Anyhoo, my line following plans were in danger of not being plans any more. Finally I had a brainwave. Carpet seems to give me only around 20% reflection, even through plastic. So I’ve now made some track parts that just have transparent sections where the dark bits should be. You can just see how this works in the corner section above. The green LED is lit because the sensor at the far side of the robot is on the white part.

And now I’ve hit another snag. The robot runs rather roughshod over the path sections. I was hoping they would be heavy enough to stay put when the robot goes over them, but it seems that Jason is rather heavy footed, and messes them up. I’ve now got to find some velcro, or something that will stop them getting moved around as the robot travels over them.

That’s for tomorrow though, I’m off to bed now.

A “Bustlectomy” for Jason the Micro Framework Robot

4341034089

I did a bit of surgery on my Fez Micro Framework Robot yesterday. I took off his “bustle” at the back. I say his bustle, because my Micro-Framework robot is now called Jason, in honour of the JSON framework I’m working on to give him simple two way communication with a host machine.

The bustle was fine, but it hung out over the back a bit, and I wanted to make him (it?) a bit leaner and meaner. The new slim line Jason has all the sensors on his nose. He has a range finder right at the front and a pair of line followers underneath and coloured LEDs he can use to tell the world how he feels. At the moment he zooms around the living room nearly bouncing off things. I must admit it is great fun building him and writing programs to control what he does. You can write any number of desktop apps, but there is something very satisfying about seeing your code make the robot rush up to a wall, notice it, spin round and then vanish under the sofa. I’ll put up some more construction details later, when I’ve finished playing…

4341036295

Resources from Rob

4326495458

A couple of new resource postings you might have missed:

  • Find out how to load images into your Flash/Chumby programs here.
  • Find out how to reset your TinyCLR Micro Framework device if it has got stuck here.

I’ve just about got my JSON serialiser working to send and receive JSON structured messages between the Micro Framework robot and another machine. When I’ve got the whole thing sorted I’ll post all the source. It lets you create message frameworks and then push status information between two systems.

.NET Micro Framework and the Fez Robot

4305559419

Robot in Red

My robot arrived today. It is from TinyCLR, who are (I think) part of  GHI Electronics.  They have released a whole new set of boards based on Version 4.0 of the .NET Micro Framework. The boards are branded as FEZ (Short for "Freakin' Easy!") and there is even a picture of a Fez on the board itself. There are two FEZ boards, the FEZ Domino which is pin compatible with an Arduino and the FEZ Mini which is compatible with the Basic Stamp device.  Both of these new devices use a single chip implementation of the Micro Framework.

I’ve been saying for ages is that what we need is a set of boards and components that use the .NET Micro Framework, are sensibly priced and well supported. It seems that GHI agree, since that is what they have done. They’ve also produced a free book which you can download to find out how to use the framework. This is a nice introduction to the technology and to the Fez platform.  I’ve not had time to do much with the new hardware just yet. But I did manage to assemble the robot and make it try to jump off the desk. 

4306303450

Robot in Blue

In the future I’m going to start putting some projects up on my Micro Framework pages as I play more with this lovely system.

Marking and the Micro Framework

4292786606

Spent a big chunk of today (like yesterday and the day before) marking exam scripts. However, I did find time to upgrade my system to the .NET Micro Framework version 4.0. This platform is getting really interesting just now, with some fantastic hardware coming out and a whole set of great new features for embedded developers. I’ve been a fan of the framework ever since I saw one of my C# programs running on a device the size of my fingernail.

Much more fun than marking.

Nick of Time

Is the art of good planning where you have everything ready months in advance and just watch the deadline arrive with cool detachment? Or is it when you have things finished just in time, and finish within minutes of the due date?

I always try to aim for the first one, but then end up doing the second. But the good news is that the book is now complete and the Dare to Dream Different video is now with Microsoft.

And now I’ve no idea what to do with myself.

Making Movies

I quite like programming. You can take an idea and just make it happen. And every now and then you end up making something much more wonderful than you thought it would be when you started.

Making videos seems quite different to this. You start off with all the ideas OK, but when you try to film them you end up with something quite different you then have to hammer into some kind of shape, and you don’t end up anywhere near where you started.

However, both do have one thing in common, in that they seem to take twice as long as you thought, even if you you allow for this.

My original plan was to make a video in one 10 minute take. The batteries in the camera were up for this, but they turned out to be the only thing that was. And I have always regarded myself as a natural video performer, but this is unfortunately not how the camera sees me.

Anyhoo, Ian came round with Andy as cameraman and we managed to get a good chunk of video “in the can” as the professionals call it. The only problem was that for the group shot of “Team Building” as we call ourselves (well, I thought it was funny) the camera exposure seemed to have gone a bit awry, in that all you could see of me and Ian was eyes and teeth. And they are not necessarily our best features.

So I’ve made a rough cut of a few bits and pieces and we have having a reshoot of some scenes tomorrow. I know how Steven Spielberg feels now.

.NET Micro Framework Dare to Dream Different UI

The .NET Micro Framework Dare to Dream Different competition round closes on Friday. We have to have a working prototype and a video of it working, all ready by 11:59 PST. So this seemed like a good time to build the product.

Actually, we’ve been working on it for some time, getting the sensor class design sorted and the physical sample sensors built up, but the User Interface needed to be built, and so I started that today.

3532672103

The first menu display. The touch buttons work too!

The device will be entirely touch screen controlled, with no need for buttons at all. I’m building the display components on the fly rather than having pre-rendered graphics. The device seems plenty fast enough to do this, and I’m caching the components once I’ve drawn them. (If I run out of memory I might need to rethink this, but I only solve problems when they are problems, and not before).

I’m using a combination of events from the touchscreen and background timer to get a responsive display that is easy to use. So far it seems to be going OK. Once I get the components working I’ll post the code.

JSON and the Micro Framework

Our entry to the Dare To Dream Different competition is coming along nicely. We’ve spent a goodly chunk of today working on how we are going to pass messages from the Micro Framework device and the server it is attached to. Number one son suggested using JavaScript Object Notation, or JSON.

We could have used XML, but this has always struck me as a rather verbose way to pass data. JSON on the other hand is nice and tight, and has the benefit that its entire syntax can be expressed on a single web page. We are presently writing a set of JSON classes for the Micro Framework. This is actually proving to be quite fun (there might be ready-written versions out there but I quite like writing my own versions of these kinds of things, just to keep my hand in).

If you are interested in a beautifully simple way to express a design for data structures you should take a look at this page and see how the author has done it. I’m also thinking that if you are looking for an exercise for your programming smarts you might want to create a library of classes that will read and write data in this form.

Once I’ve got ours working and I’m happy with it I’ll post it out there so that the Micro Framework can use this rather neat data structure.

Splendid Sunday

This is turning out to be an excellent weekend. Went out for a superb meal at Fudge yesterday and spent this morning making things work that work (actually, number one son wrote most of the code – I see myself as more of an ideas man).

We now have multiple sensors talking to our .NET Micro Framework device and the next thing is to build the emulation environment and interface the actual sensor electronics.

This seemed as good a time as any to take a break and watch a dodgy James Bond movie, and so we did. There was no particular agreement on who was the best Bond, I think your choice says as much about your generation as it does your taste, but there seemed to be no doubt who was the worst, with Roger Moore coming out on top.

I think the film was “For Your Eyes Only”, but they made a whole bunch of anonymous Bond films in the eighties, and it could have been any one of them. It did have some hilarious “Hi-Tech” bits, where Bond could be seen manhandling what looked like RL-02 disk packs on a Digital Equipment machine (which as I remember provided a whole 20Mbytes of storage). Bond then spent some time sitting in red lighting doing something fatuous with a really old display, before going out and failing to get killed by idiot assassins.

Ideal Sunday afternoon fare.

First, Update the Firmware

Did some work on our Micro Framework project today which will be our entry into the Dare To Dream Different competition. We are creating an “Anything Bad” alarm system with nifty remote sensors. The sensors are based on the XBee ones that we got supplied with the competition hardware, and they work a treat.

Eventually.

First thing we did was build some test remote sensors:

3384045935

This turned out to be easy enough, although I did solder 20 pins rather than four, which took a bit longer than it needed to…

Anyhoo, the next thing to do was configure the XBee devices. This was harder, in that nothing seemed to work. We were giving the correct commands and everything, but the device was complaining every time. A bit of searching got us the answer. We found a blog post with the revealing message “To get the devices to work you must upgrade the firmware”. I’m not sure why a company would ship a product which doesn’t work out of the box, but then again, welcome to the world of hardware development.

After the upgrade things went swimmingly. We reached a point where I could press a button on the device above and have a program on another machine notice this. Wonderful.

Portugal DevDays 09 Demo Code and Presentation on SkyDrive

I’m using the fancy new Windows Live SkyDrive to share out my presentation and the demo programs from yesterday:

  • You can find the presentation here.
  • You can find the demo programs here.

SkyDrive is actually rather neat. You can attach it to your Windows Live account and it gives you 5GBytes of storage which you can use for public or private data storage.

Pictures from Portugal

I’ve noticed that one way to get really good photographs is to go to nice places and take pictures of them. I’ve lost count of the number of lovely shots I’ve seen in photo books with captions like “The Rice Fields on the mountains of Jokarta look lovely just after dawn”. In this respect, Portugal is a definite win. It has this fantastic light.

3294980112

Cranes on the skyline

3294980232

The way into the hotel. Pity the fountains were turned off, but you can’t have everything.

portugal10

The venue this year was the Instituto Superior Tecnico at Taguspark, right opposite the Microsoft Portugal offices.  I like doing sessions in Portugal. I always get a great audience. The session was all about the .NET Micro Framework, and how you can take over the world using it.

3294980700

I said I’d put a picture of you all up after the session. Here you all are.

3294980926

Playing with the toys afterwards…

3294981064

Now, that’s some kind of font…

3294155851

Outside the building.

I got back last night and staggered into bed. I’d been away just about 24 hours or so and spent 8 of those in the air. But it was all great fun. Thanks to Microsoft Portugal for setting it up.

I’ll be putting the sample code and the presentation up on my blog tonight.

Burning Fingers with the .NET Micro Framework

Spent some of today soldering. I’m not as good at it as I used to be. Or perhaps things have got smaller. Either way, I was very pleased to see a red LED flashing at the end of my efforts. It meant that I hadn’t destroyed the power regulator chip.

I was soldering pins into one of these. They are a very neat connector that take Xbee radio devices and allow them to fit onto standard plugboards. We are using these as part of our Dare To Dream Different competition entry and we want to connect some sensors.

Having carefully soldered around 20 pins I then discovered that I only actually needed to connect to around four of them. Oh well, I suppose the practice was good for me.

Clusty to the Rescue

I’ve spent bits of today trying to get my .NET Micro Framework devices to work. For some reason I want to take my smallest PC away with me next week to Portugal, and this has meant a certain amount of heartache.

The PC is an Advent netbook. I bought it earlier this year and I love it to bits. It arrived running Windows XP, and I’ve just put the beta version of Windows 7 on it. This turned out to be really easy. I just plugged in an external DVD drive, tweaked the BIOS to make it boot from the DVD and then booted from the Windows 7 disk. I did a brand new install, wiping out the original operating system and, of course, removing the recovery partition. I don’t do things by halves, me.

The installation was smooth and surprisingly quick. The only problem was that I had to find my way to the RealTek site to locate and install the WIFI drivers, but once I did that I had the machine on the campus network with very little fuss.

That was a week ago. Since then I’ve installed Microsoft Office 2007, Visual Studios 2005 and 2008, Photoshop Elements and a bunch of other programs, all of which seem to work fine. Unfortunately, when I tried to install the USB drivers for some of my .NET Micro Framework devices, things started to get a little tricky.

The drivers that were supplied with the hardware didn’t work. I read somewhere that Windows 7 refuses to install drivers that have not been signed, and so I did some digging and found that there is magic that is supposed to switch this off.

Unfortunately it didn’t seem to work for me. I did a lot more digging and kept hitting brick walls, trying increasingly more complex searches for the drivers that it seemed like I needed and not finding anything. By lunchtime I’d resigned myself to taking my heavy old Toshiba away with me.

Then I remembered Clusty. This is a clustering search engine that I’ve used in the past to good effect.  You get your search results nicely categorised, which makes finding your way through them must easier.  I fed in the same search string that I’d been using unsuccessfully on Google and it came back with a list of hits that made it very easy to find just what I wanted. And it worked. So it looks like I’ll be writing code for tiny devices on a tiny device, which I guess is just how it should be.

Team Building Gets The Hardware

I got a lovely surprise today. The hardware for our Micro Framework entry turned up. And it is wonderful. It is one of the latest Tahoe II boards from Device Solutions. I installed the drivers, plugged it into the laptop and got my first program working in minutes.

3220357728

My first program just displays a picture of the team (as well it might). Next step is to see if I can get the touch screen going, then I'm going to play with the Zigbee wireless networking(we also got a Zigbee adapter for the PC) and interface some sensors and, and, and.....

Good thing I've finished my marking.