UPnP gateway; first working sample

The UPnP gateway now gets to a point that might even justify a pre-release, finally! It can be started from a batch file and configured to run one or more drivers. Capable of publishing dozens of UPnP devices simultaneously (be it as sub-devices)

A driver template is included so new drivers can quickly be setup. A fully functional xplrfx driver is included as well as 3 demo drivers. All c code is now compiled for distribution, no more development/debug libraries required. Continue reading

HackersNL talk on home automation and Lua

So yesterday, I gave a talk on home automation at HackersNL in Utrecht, nice and friendly audience and plenty of new ideas.

I’ve uploaded the slideset, available here (downloaded 1642 times). Furthermore some additional comments and links;

  • Home automation site; check out bwired.nl, awesome. Nothing to add to that.
  • Bwired also has a generic home automation forum, not specifically related to a server product.
  • xPL and all its related info can be found on the xPL project site
  • For the internet-of-things there is a great open source project started by Sierra-Wireless. It is being run under the Eclipse umbrella and already delivered some nice results. Check out Koneki (LDT and OMA), Mihini and Paho.

UPnP forum logo
For a start with UPnP there is a lot of documentation on the forum pages. But there is no real shortcut to UPnP, but here’s where to start

  • To get a feel of what it can do, download the UPnP Developer Tools (runs on .NET, so might also work on Mono, but never tried). Use the DeviceSpy utility to examine some of your own devices and fiddle with the actions (Tip: right-click on a service and subscribe to events). Also give the included “Network Light” sample application a try (to fiddle with from Device Spy).
  • Read the UPnP Device Architecture 1.1 document (UDA), even if you don’t make it through, focus on sections;
    • 1 Discovery (introduction only)
    • 2 Description (introduction only)
    • 2.3 Device Description
    • 2.5 Service Description
    • 3 Control (introduction only)
    • 4 Eventing (introduction only)
  • Browse the device and service specifications. Start with “Lighting Controls_1” which are fairly easy to read, and once you get the concept of those try something more challenging like the Media Server/Renderer stuff.

It was a fun evening, thanks for the invitation guys! If you have any questions or want some more info, just drop a message below.

 

 

UPnP gateway; third proof of concept

It’s been a while, but some major additions have been made to the UPnP gateway engine. Previously the engine would parse xml description files to generate objects. Now it includes both an xml factory and a device factory that generate everything on the fly.

The code now includes a BinaryLight and a DimmableLight (both standardized DCPs), they are based on standardized services SwitchPower and Dimming (also included). Implementing a fully functional DimmableLight device now only takes 4 lines of code; Continue reading

All new UPnP gateway concept; a scriptable UPnP engine

Today I finished the first working sample of the new UPnP gateway I’ve been working on, a major milestone! Stepped out of .NET and changed to platform independent code and libraries. Punished myself with hardcore C, multi-threading and multi-platform all at once, but it all seems to start working now.

 

So what is it?

Its a Lua scripting engine, glued to the pupnp library. Lua is a small, fast and very portable dynamic scripting language and pupnp is a portable UPnP library. This creates an engine that will run on any platform (Windows, Mac, Linux, or even embedded on a NAS or your wifi router), while at the same time allowing users/developers to write code in Lua. So it takes away the need to do all the complex stuff in hardcore C, threading, platforms, etc. The Lua scripts will simply run on all platforms, unmodified.

Continue reading

Fixing the UPnP stack issues

The last few days I spent some time fixing the .NET UPnP stack to be more resilient. The stack itself it pretty ok, but the problem is that you do not have control over all the other UPnP devices out there. If these are faulty and don’t play by the rules, you can either ignore them (what the UPnP stack did until now) or try and handle only those parts that are ok.

Supporting for the UPnP gateway showed that several devices would simply not show up. Some fiddling with other UPnP tools and the debug facilities showed that the devices had faulty description xml’s (bad UPnP implementations by their vendors). The cases were the Grace Digital tuner and the Vera home automation box (the Grace Digital has a firmware update, beta, available that fixes the issue)

I had to take a pretty steep dive into the code to fix all the undelying elements. What happened was that the code for parsing device and service xml’s only had exception handling on the highest level. This means that you get either all or nothing. Continue reading