Page 1 of 1
Replicating HBControlMod.dll functionality
Posted: Sun Jan 28, 2007 7:30 pm
by roussell
Scott,
I have a Linux server that gathers various data from different sensors around the house and I would like to make that data more easily readable by HouseBot. Since I can't use HBControlMod.dll or HB_Control.exe in Linux I was wondering if you would share how it "talks" to the External Control device in Housebot. Basically, I would like to replicate the functionality of HBControlMod.dll in Linux and gain the ability to get and set parameters programatically in HB. I'm hoping it's as simple as opening a connection to the listening port, passing a password, and sending simple text commands to get and set data. Is there anything you're willing to share on this front or should I look for other alternatives?
Thanks in advance,
Terry
Posted: Sun Jan 28, 2007 11:45 pm
by Osler
roussell:
You could use the winsock control to create a TCP server that listens for the data from your linux box and then passes it to HouseBot in the Winsock_DataArrival event. You could parse the data within the event sub or just pass it enbloc to HouseBot and parse it in a script.
Osler
Posted: Mon Jan 29, 2007 8:14 am
by roussell
Thanks Osler, that is a possibility. I'd prefer to speak directly to HB though...if possible...
My HB server is an older PIII but has insane reliability. I attribute part of this to the fact that Scott's code is most excellent and HouseBot is the only thing running on the box. As this is the main "production" box for the house I try not to install extra stuff on it if it isn't needed. As a result - I have a workhorse Linux server that has pretty much everything (1-wire, weather station, A/D IO, "homemade" devices, etc) plugged into it. It logs everything it records into a MYSQL database and a series of scripts on the HouseBot server reads that DB and populates variables as needed. I would love to eliminate a step or two and have the Linux box talk directly with HB. I suppose I could write my own software device, but that would mean digging up Visual C++ from somewhere as I don't think the free express edition will write native win32 code. It would also mean duplicating functionality that is already present in the system and I'd rather not do that. So the best option from my perspective is to speak directly with the already-installed and proven External Control device. However, if Scott would rather not divulge how to talk to it, then I'll have to pursue other options. In that event I'll share whatever I develop with the rest of the community in case others have a similar need.
Thanks again for the suggestion.
Terry
Re: Replicating HBControlMod.dll functionality
Posted: Mon Jan 29, 2007 8:52 am
by ScottBot
roussell wrote:...I was wondering if you would share how it "talks" to the External Control device in Housebot.
The current protocol is a mixture of binary data that identifies message types and sizes, combined with the various message data. Although I don't mind sharing the protocol, it would be a pain to recreate a client to use it. I've been considering adding a more basic ASCII parallel that does all of the same things. This would allow you to do things from PHP, telnet, etc.
Actually... I think I'm going to add this to the Ver 3 list.
Posted: Mon Jan 29, 2007 10:43 am
by roussell
Thanks for the reply Scott. I may end up doing what Osler suggested and wrapping the current HB dll in with a winsock control (that seems to be the fastest route) and waiting on HBv3. I'll look at doing a plugin; although I'm comfy with C++ in Linux, win32 C++ seems a little foreign for some reason.
Question: Are you writing v3 in .NET or C++? All of my stuff is in C# in the Microsoft world so I would love the ability to do some .NET plugins when the new version comes around.
Thanks again!,
Terry
Posted: Mon Jan 29, 2007 11:01 am
by ScottBot
All C++. Sorry, the .net koolaid tasted funny to me