Author Topic: Slowly getting a bit of a clue about LMCE, some questions about D-Bus  (Read 1630 times)

davidsmoot

  • Regular Poster
  • **
  • Posts: 28
    • View Profile
So I'm starting to wrap my head around what LMCE is. Here's my concept of LMCE, correct me if I am wrong.

The core of LMCE is the DCErouter that is basically a "post office".  Open source applications like Xine, Myth, Asterisk, etc have a LMCE "wrapper" that interfaces them to the DCERouter.
This wrapper can do multiple things:
  • create messages to be passed into DCErouter
  • register for messages that it is interested in receiving
  • respond to messages it receives by making the wrapped application do something

So LMCE at its simplest is a framework for automating the interaction of various standalone open source applications.  Asterisk and Xine were never designed to work together to pause a movie when the phone rings.  But that can happen through LMCE. LMCE creates wrappers for both applications. The Xine wrapper registers with DCERouter and says he wants to know when a phone call message is received by DCERouter.  The wrapper for Asterisk registers with DCERouter and says I am going to create phone call messages. When the phone call happens, the wrapper around asterisk creates a message that is passed to DCERouter and then to the Xine Wrapper. The Xine Wrapper then makes Xine pause the movie.  Is that roughly correct?

So in theory, D-Bus could provide a lot of this functionality if the "wrapped" applications built in support correct?  Could / does DCERouter interact over D-Bus?  Probably would be PITA to handle the registration process.

So what are the pros and cons of LMCE versus D-Bus for this type of event driven message passing?  I know LMCE was up and working before D-Bus was mature so it had mature functionality first.  Plus D-Bus support has to be built into the application where the wrapper model can be applied after the fact. But the wrapper model means LMCE has to lag behind upstream development to make sure the integration is correct, right?  Plus D-Bus is application specific where LMCE is more "event driven", you can send messages directly to xine or asterisk using D-bus but there is not a generic D-Bus API for registering for all home security events?

I want to play with some of this home automation stuff but I'm really not a big media consumer (at least not TV / Movies anyway) and I'm trying to figure out which framework makes more sense.  LMCE is much more mature but if I want a new wrapper, I write it or pay someone to write it.  If I use something like D-Bus then it becomes more likely that hardware and software will be supported out of the box in the future.  Or maybe a middle path of building a D-Bus plug-in for DCERouter where the two protocols could interact?

David

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5501
  • DOES work for LinuxMCE.
    • View Profile
Your assessments are roughly correct, however, you should spend more time studying the architecture. We have a lot more infrastructure than what DBUS offers.

DCE is much more attuned to what we need to do, mostly because the messages it intends to send are abstracted and shared across all of the devices on the bus, and adding new commands is more difficult, this encourages re-use.

We have a lot of tools that take the data in our database, and create C++ skeletons to create new devices, as well as update the other bits of C++ that the system uses so that you can do things like reference the device via constants, etc. This is not available on DBUS.

As with all messaging systems, you can create interfaces between the different message busses. This is the essence of the different "Interface" devices. Just spend some time making a simple DCE device, so you can understand what is going on, look at and study the code.

-Thom

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4459
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
It seems to me that with D-Bus you'd be starting basically from scratch... yeah in principle you could build something with it that could communicate with Amplifiers, temperature sensors, lighting controllers, sun blind actuators, garage doors, BluRay players, PVR's & STB's and all the other myriad devices that LinuxMCE and its DCE devices already can control and get data from.

If thats a hill you want to climb then I say get climbing!

However if you want to explore the connected device world that LinuxMCE already inhabits... a world where all of these types of devices and more are already in use and already have an environment wrapped around them that enables you to build this stuff at a high-level... then why re-invent the wheel?

Just my 2c worth...

All the best


Andrew
Andy Herron,
Convergent Home Technologies Ltd

Read My Blog; http://ellipticalcurve.com

Contact me for Smart Home consulting advice here;
@herron on Twitter, inquiries@ellipticalcurve.com via email or PM me here.

Get a Dianemo License: http://forum.linuxmce.org/index.php?topic=8880.msg100221#msg100221
Follow us on Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

Sales & Info:
http://www.dianemo.co.uk

davidsmoot

  • Regular Poster
  • **
  • Posts: 28
    • View Profile
Thanks, that is the kind of information I was looking for.

Do the wrappers have to be wrappers?  Let's say I wrote a simple GUI program to control my sprinkler system through an Arduino.  Could I make my application have DCERouter support built in?

The more I learn about LMCE, the more it rocks. I was (irrationally) worried about having my LMCE core lag behind the latest ubuntu stuff.  In the past I've been so cramped my tinkering system had to be my server and my playground for all my projects.  I could not afford the clutter and cabling to have one box dedicated to one task and another box to another.  But I realized my new house is literally twice the square footage as my old one so I can afford to dedicate one box to LMCE.

However since the LMCE box will be the gateway device connected to my cable modem with a public IP address, I still want to do a few non standard things like SSH, SVN, OpenVPN, etc.  I'll figure it out I'm sure.

Now I'm working on figuring out my voip options...  looks like my N900 has a SIP client built in so this should be fun.
David
« Last Edit: April 08, 2010, 04:21:39 pm by davidsmoot »

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5501
  • DOES work for LinuxMCE.
    • View Profile
You're thinking about it wrong. stop it. :P :)

If you wish to create something to control your sprinkler system, don't make a GUI, just specify the type of device it is, the commands it needs to respond to, the events it needs to emit, any information it needs to be able to function, and the plug and play information.

Then, you can run DCEGen to generate a C++ stub. Fill in the blanks. There, instant DCE device.

The information to do this is all over the wiki, man.

-Thom

valent

  • Guru
  • ****
  • Posts: 380
    • View Profile
    • /kernel_reloaded/
I was thinking about the exact same question about DBus and DCERouter. Also I'm interested with bringing arduino into play. Hope to get one soon, so you will hear about it  when I get it ;)

Any what is the best way to connect arduino and linuxmce? Is it possible to do it wirelessly?
LinuxMCE - If it was easy, everybody would be doing it!!
My setup - http://wiki.linuxmce.org/index.php/User:Valent

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5501
  • DOES work for LinuxMCE.
    • View Profile
Dude, I swear, do you have a brain in there at all?

Read the developers guide.

Thom

valent

  • Guru
  • ****
  • Posts: 380
    • View Profile
    • /kernel_reloaded/
Dude, I swear, do you have a brain in there at all?

Read the developers guide.

Thom

Dude what is your problem? Why you always have to use that tone? Sex deprivation? If you have to vent please don't do it in the forum.

I'm reading lots of stuff, haven't read developers guide hope to do it soon. Currently having some hardware issues, and rebuilding everything from scratch :( Two days just went out of the window.
LinuxMCE - If it was easy, everybody would be doing it!!
My setup - http://wiki.linuxmce.org/index.php/User:Valent

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Dude, I swear, do you have a brain in there at all?

Read the developers guide.

Thom

Dude what is your problem? Why you always have to use that tone? Sex deprivation? If you have to vent please don't do it in the forum.

I'm reading lots of stuff, haven't read developers guide hope to do it soon. Currently having some hardware issues, and rebuilding everything from scratch :( Two days just went out of the window.

Since you had to ask... His problem is apparently a whiney little postwhore who obviously has nothing better to do then to keep reviving old threads that died months ago.  WTF do you actually expect here, developers coming over to your house every night to read you a chapter of the developers guide before bedtime?  We are not here to entertain you (or make you rich for that matter), try to get that through your thick skull please.
"Change is inevitable. Progress is optional."
-- Anonymous


valent

  • Guru
  • ****
  • Posts: 380
    • View Profile
    • /kernel_reloaded/
Dude, I swear, do you have a brain in there at all?

Read the developers guide.

Thom

Dude what is your problem? Why you always have to use that tone? Sex deprivation? If you have to vent please don't do it in the forum.

I'm reading lots of stuff, haven't read developers guide hope to do it soon. Currently having some hardware issues, and rebuilding everything from scratch :( Two days just went out of the window.

Since you had to ask... His problem is apparently a whiney little postwhore who obviously has nothing better to do then to keep reviving old threads that died months ago.  WTF do you actually expect here, developers coming over to your house every night to read you a chapter of the developers guide before bedtime?  We are not here to entertain you (or make you rich for that matter), try to get that through your thick skull please.


Sarcastic, sure I can take that, but atleast be a little helpful. Nope, just ignore me until I get upto speed, but don't try to throw me and others that aren't up to your developers standards.

Are you frustrated if somebody starts LinuxMCE business and donates back to the project? WTF?
LinuxMCE - If it was easy, everybody would be doing it!!
My setup - http://wiki.linuxmce.org/index.php/User:Valent

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2421
    • View Profile
    • ago control
should be easy to write a DCE device for serio (http://www.sparkfun.com/commerce/product_info.php?products_id=9521)

What I don't like is that it only supports polling for status.. but that should be easy to extend on the arduino side.

br Hari
rock your home - http://www.agocontrol.com home automation

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2421
    • View Profile
    • ago control
and while we are talking about dbus, afaik it is a local bus, DCE works over the network..

br Hari
rock your home - http://www.agocontrol.com home automation

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Dude, I swear, do you have a brain in there at all?

Read the developers guide.

Thom

Dude what is your problem? Why you always have to use that tone? Sex deprivation? If you have to vent please don't do it in the forum.

I'm reading lots of stuff, haven't read developers guide hope to do it soon. Currently having some hardware issues, and rebuilding everything from scratch :( Two days just went out of the window.

Since you had to ask... His problem is apparently a whiney little postwhore who obviously has nothing better to do then to keep reviving old threads that died months ago.  WTF do you actually expect here, developers coming over to your house every night to read you a chapter of the developers guide before bedtime?  We are not here to entertain you (or make you rich for that matter), try to get that through your thick skull please.


Sarcastic, sure I can take that, but atleast be a little helpful. Nope, just ignore me until I get upto speed, but don't try to throw me and others that aren't up to your developers standards.

Are you frustrated if somebody starts LinuxMCE business and donates back to the project? WTF?

Oh it's help you want, silly me I must have missed that through the derogatory remarks at Thom's address.  Well here's a hint: try not annoying key people in this project that much, their contributions are a lot more valuable than any donations you could ever make. 

Anything else I can do you for?

"Change is inevitable. Progress is optional."
-- Anonymous


valent

  • Guru
  • ****
  • Posts: 380
    • View Profile
    • /kernel_reloaded/
Dude, I swear, do you have a brain in there at all?

Read the developers guide.

Thom

Dude what is your problem? Why you always have to use that tone? Sex deprivation? If you have to vent please don't do it in the forum.

I'm reading lots of stuff, haven't read developers guide hope to do it soon. Currently having some hardware issues, and rebuilding everything from scratch :( Two days just went out of the window.

Since you had to ask... His problem is apparently a whiney little postwhore who obviously has nothing better to do then to keep reviving old threads that died months ago.  WTF do you actually expect here, developers coming over to your house every night to read you a chapter of the developers guide before bedtime?  We are not here to entertain you (or make you rich for that matter), try to get that through your thick skull please.


Sarcastic, sure I can take that, but atleast be a little helpful. Nope, just ignore me until I get upto speed, but don't try to throw me and others that aren't up to your developers standards.

Are you frustrated if somebody starts LinuxMCE business and donates back to the project? WTF?

Oh it's help you want, silly me I must have missed that through the derogatory remarks at Thom's address.  Well here's a hint: try not annoying key people in this project that much, their contributions are a lot more valuable than any donations you could ever make. 

Anything else I can do you for?



Sure no problem, but if they provoke me and be just rude for no reason they will get back same mesure ;)
LinuxMCE - If it was easy, everybody would be doing it!!
My setup - http://wiki.linuxmce.org/index.php/User:Valent