Friday, March 13, 2009

Talk to your .NET MF device with Live Messenger

Some months ago I was working on a Live Messenger or Google Talk integration in an Web application. Before trying to implement all at my own I started playing with imified. imified is really cool! You can register an account and imified will send you arriving messages as a simple http POST request. As html output you return the text you want to reply.

Using my simple Webserver for .NET Micro Framework you are able to build steps and reply to the chat partner.

imageLook at this example:

context.Response.ContentType = "text/html; charset=UTF-8";
switch (context.Request.Form["step"])
{
    case "1":
        context.Response.Write("Hi, what's your name?");
        break;
    case "2":
        context.Response.Write("Hello " +
                     HttpServerUtility.HtmlEncode(
                               context.Request["value1"]) + "!");
        break;
}

This example will say "Hi, what’s your name?" when you start chatting with the account. If you enter your name and press enter the account will reply with "Hello" and your entered text.

I put my Google Talk account interactive [at] bot.im and Live Messenger account imified [at] schwarz-interactive.de in the HttpConsole demo application. Simple add the corresponding account to your favorite messenger and talk to my Tahoe-II board. It will tell you i.e. the temperature in my kitchen using the XBee modules from Digi.

Looking forward hearing from you what you think about this way talking to a .NET Micro Framework device.

1 comment:

celiker said...

Hi Michael,
it is very difficult with out "imified", because MSNP is a bit complicated.

This is a good idea really :)