A new concept in collaborative development

From LinuxMCE
Revision as of 17:47, 5 June 2006 by Wikiadmin (Talk | contribs) (Imported document)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007. In general any information should apply to LinuxMCE. However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.

Pluto introduces 2 new software programs--GSD and sqlCVS--which together greatly simplify collaborative development. In a smart home environment, there are thousands upon thousands of relatively simple devices that all have proprietary protocols for controlling them. Many high-end TV's and stereos have rs232 controls, which work much better than infrared. Plus there are lots of other devices with RS232, RS485 or Ethernet ports, like pool controls, sprinkler systems, alarm panels, lighting controls, etc.

For example, call the manufacturers of high-end TV's with RS232 ports. They will confirm that if they want their TV to work nicely in a smarthome system, they have to ship one TV to http://www.crestron.com">Crestron</a> and another to <a href="http://www.amx.com (the two leading smarthome providers), where C++ coders start writing new software drivers. These drivers then need to be compiled, and the resulting binaries distributed to dealers. It's a terribly expensive and burdensome process.

Further, it means that only software programmers can write new device drivers. Yet, these drivers are really very simple--usually just sending/receiving some characters across a com or network port. So, we wanted a new approach that made it easy for non-programmers to add support for new devices, and that whenever one person added a new device, every other Pluto user would immediately have access to it without downloading or compiling anything.

So, to add support for a new device, all you do is go into the Pluto Admin web site, click a 'new device' button, and then check off what commands that device knows how to implement (like 'on', 'off', 'skip forward', 'set temperature', etc'), what events it fires (like 'track changed', 'power is off', etc.), and what data parameters it needs.

The GSD wizard then presents a simple web form with a text box for each of the commands. Type in each box the command to send the device when it needs to execute that command. For example, to turn on a Denon Receiver you send it the string PWON followed by a carriage return. Just put: <$"PWON\r"$> in the input box next to the "ON" command. If the protocol is more complicated, GSD includes an embedded Ruby language processor. Ruby is a very comfortable yet powerful high-level OO language. Using the snippets of embedded Ruby code you can do almost anything. Even very complex, bi-directional automation systems, like EIB, are done with the same GSD system. Since the whole process is very structured, this ensures all devices are uniform and interchangeable. The structure, protocol and Ruby snippets you create are stored in are automatically stored in a local database on your Core.

This is where the 2nd piece of the puzzle comes in: sqlCVS. If you leave the check box "Share my I/R and GSD devices with other", then sqlCVS will keep your database synchronized a central sqlCVS server. If you know programming with source control programs like CVS or SVN, sqlCVS essentially does the same thing with a database that those programs do with source code. It features atomic commits, tracks ownership at the record-level, gives us at Pluto a control panel to monitor all activity on the database and rollback or correct bad data.

Together GSD and sqlCVS make adding and sharing smart home device drivers an automatic and trivial task. Since Pluto keeps all devices isolated, a total newbie can experiment knowing he can't do anything to break Pluto. Adding new devices is a simple fill-in-the-blanks process. And without doing anything, automatically all Pluto users can share the same database of devices.