Difference between revisions of "Programmer's Guide"

From LinuxMCE
Jump to: navigation, search
(Introduction to the LinuxMCE Architecure: changed voice to that of LinuxMCE rather than pluto..)
(Is LinuxMCE a stand-alone software product, or a development platform?: LinuxMCEify)
Line 35: Line 35:
 
*[[Automated_Builder]]
 
*[[Automated_Builder]]
  
==Is LinuxMCE a stand-alone software product, or a development platform?==
+
== Why LinuxMCE? ==
  
LinuxMCE is sold commercially as a complete turnkey appliance. To the end user it appears to be 1 single application with 1 common user interface. From a developer's standpoint, however, LinuxMCE is actually a platform for developing smart home modules that all work together.  Much of the top-level functionality is provided by a variety of open source projects. LinuxMCE adds it's own home automation engine, UI front-end, configuration web site, and the heart of it all, [[LinuxMCE Libraries DCE]], which allows this collection of devices and software projects to work together as a seamless whole.
+
The goal of LinuxMCE is to create a Linux distribution that presents a common user interface and orchestrates all the numerous OSS applications that make up a home PC in the 21st century home. To the end user it should appear to be one single application with a single user interface. Unlike Pluto, LinuxMCE is primary mission is not to be a platform for developing "smart home modules that all work together"; but, we hope to benefit from this work at Pluto and elsewhere by making sure our DCERouter is 100% compatible with theirs. We are trying to do something bigger than an Asterisk distro or a MythTV distro, we're combining many applications into an integrated whole. But we're doing this the UNIX way, using a messaging protocol over sockets so that these applications can still be developed independently and added and removed from LinuxMCE as desired by the end user.
  
In many cases, a LinuxMCE DCE device is just a thin wrapper for another open source project.  The wrapper's job is to launch the open source project with the right parameters, forward incoming commands to it, and fire DCE events in response to triggers within it.  We added DCE wrappers for the projects Asterisk (pbx telephone switch), Linphone (SIP software telephone) and Motion (surveillance video capture). In most cases, no modifications to the open source project were needed since the project already contained a mechanism for feeding it commands.
+
The functionality in LinuxMCE is provided by a variety of open source projects and it's our mission to make them work together. LinuxMCE uses the GPL home automation engine and UI front-end developed by Pluto, the GPL PVR developed by the MythTV folks, the GPL phone system Asterisk originally developed by Mark Spencer at Digium, the GPL Xine program, etc. All of these have disparate histories and development roadmaps, the DCERouter combines them into a whole, but the wrappers need to be kept up to date as these applications develop and hopefully we can get some of these applications to talk directly to the DCERouter in the future.
  
The software is completely modular and we offer a wealth of development tools, like code generators, design tools, a rapid development module for adding new devices (GSD), our own messenging platform and a ton of general-purpose libraries.  Our GSD+sqlCVS is an entirely [[A new concept in collaborative development]] for quickly adding support for communicating with external equipment.  If you're a developer, you can add to LinuxMCE, or even remove our modules and use LinuxMCE as a platform to do something else entirely.
+
The DCE message router and the controllers for the various applications are modular by nature which means you can just modify small module at a time and compile and test it in the system quickly. Right now (10-10-07), the build system is a little cumbersome because we inherited it from a commercial company that paid their developers and could expect them to learn a custom build system, but one of the immediate development goals is to switch to a more traditional OSS build system so any developer can just jump in and start making changes using a simple "make; sudo make install" for the whole distribution or just one program or library within the whole.
  
 
==LinuxMCE allows projects to work together==
 
==LinuxMCE allows projects to work together==

Revision as of 16:42, 10 October 2007

Introduction to the LinuxMCE Architecure

LinuxMCE includes hundreds of scripts and utilities that were forked from Pluto's linux distribution in 2006. Pluto wrote these to create a 'turn it on and press play' appliance, rather than a traditional software application.

This guide explains the architecture of the main C++ code. There is Doxygen documentation for all the scripts and utilities that make up the pluto distribution here. We'll create our own Doxygen documentation soon...

LinuxMCE uses a modular architecture. The heart of LinuxMCE, the 'main application' DCERouter is nothing but a general-purpose message router. It has absolutely no code relating to any of LinuxMCE's functionality--it just relays messages between "Devices". The functionality of LinuxMCE is entirely in separate programs (aka "Devices") which all run independently and communicate with each other by passing messages through DCERouter over sockets. There can be hundreds of these "Devices" in a smart home, that do all sorts of things. As shown in the diagram below, many of LinuxMCE's devices are actually 'wrappers' we have written for existing open source programs to allow them to work together seamlessly in a LinuxMCE system. For example, the wrapper for Asterisk that sends event messages to DCERouter whenever a phone call comes in, and receives command messages when it is time to place a call. How the wrapper communicates with the open source program depends on that project. For example, the Asterisk wrapper communicates with Asterisk over a socket. It is really a translator converting messages from its socket connection with DCERouter into messages from its socket connection with Asterisk. The wrapper for the Xine media player links in Xine's own library and calls Xine functions directly, while the wrapper for MythTV communicates via a special telnet interface.

[Need diagram of software modules here].

Since here are literally thousands of home automation components and pieces of A/V equipment that require controlling with serial port, USB and Ethernet LinuxMCE communicates with these using GSD. It's fast and simple to use and it can be used to support lighting control systems, climate and pool systems, external devices like IR blasters, cameras, etc.

Programmer's Guide Sections

Why LinuxMCE?

The goal of LinuxMCE is to create a Linux distribution that presents a common user interface and orchestrates all the numerous OSS applications that make up a home PC in the 21st century home. To the end user it should appear to be one single application with a single user interface. Unlike Pluto, LinuxMCE is primary mission is not to be a platform for developing "smart home modules that all work together"; but, we hope to benefit from this work at Pluto and elsewhere by making sure our DCERouter is 100% compatible with theirs. We are trying to do something bigger than an Asterisk distro or a MythTV distro, we're combining many applications into an integrated whole. But we're doing this the UNIX way, using a messaging protocol over sockets so that these applications can still be developed independently and added and removed from LinuxMCE as desired by the end user.

The functionality in LinuxMCE is provided by a variety of open source projects and it's our mission to make them work together. LinuxMCE uses the GPL home automation engine and UI front-end developed by Pluto, the GPL PVR developed by the MythTV folks, the GPL phone system Asterisk originally developed by Mark Spencer at Digium, the GPL Xine program, etc. All of these have disparate histories and development roadmaps, the DCERouter combines them into a whole, but the wrappers need to be kept up to date as these applications develop and hopefully we can get some of these applications to talk directly to the DCERouter in the future.

The DCE message router and the controllers for the various applications are modular by nature which means you can just modify small module at a time and compile and test it in the system quickly. Right now (10-10-07), the build system is a little cumbersome because we inherited it from a commercial company that paid their developers and could expect them to learn a custom build system, but one of the immediate development goals is to switch to a more traditional OSS build system so any developer can just jump in and start making changes using a simple "make; sudo make install" for the whole distribution or just one program or library within the whole.

LinuxMCE allows projects to work together

By allowing these various projects to work together seamlessly, many new features and benefits are now possible. For example, if there's a security breach in your house, the lights and TV's in the house come on automatically using our home automation DCE device interfaces, and the security pn pad appears on all the Windows webpads and PDA's. After 30 seconds a menacing video plays for the burglar using Xine, while the surveillance cameras monitored by Motion feed a live video to your mobile phone over GPRS. Hit 'Talk' on the phone and Xine suspends, passing control to Linphone which makes a call using Asterisk to your mobile phone with the audio piped through the stereo so you can shout at the intruder and let him know you're watching him from a remote location and calling. To the end-user, it works seamlessly, like 1 cohesive whole, but in reality, what LinuxMCE did is enable a bunch of existing applications to work together.