Jump to content


Photo
- - - - -

Open-Source Elk Interface


  • Please log in to reply
58 replies to this topic

#1 Grayson Peddie

Grayson Peddie

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 401 posts
  • Location:Altha, FL 32421
  • Software:Open Source Automation
  • Video:MythTV

Posted 20 November 2008 - 07:58 PM

Hi y'all! I don't know where to post this thread, but I thought I'd post it here. So anyway, here I go:

Since the week of developing the source code, I've been reading the Elk RS-232 documentation and I took my time to layout the code and I made the code as readable as possible. I structure the code so everything looks almost as consistant, and when done, I've written my simple keypad application designed to take advantage of the Elk interface DLL. When I say that I debugged my code, I've used DockLight to figure out what I did wrong and it turned out that I must use "\r\n" (CR-LF) as indicated in the RS-232 documentation. I've discovered that using SerialPort.WriteLine() does not work, so I have to write "\r\n" manually after the checksum calculator.

For Linux and Mac users out there, you can install Mono using your package manager (I prefer YAST under openSUSE 11 better than Synaptic Package Manager under Ubuntu, but to each their own). I have openSUSE 11 virtualized under Windows XP and I haven't tested it yet, so if you have Linux and have Mono installed, give it a try! ;)

One thing that I'd like to mention: I don't know what to name the Elk Interface (I couldn't use the word "my" since I want to put this up in the public domain (I did provide links to websites, such as Elk Products, SmartLabs, Z-Wave, including the others mentioned in the readme file).

So, attached below is the code and Windows DLL for Elk Interface.

I hope Elk does not mind when posting the source code in the public domain.

Updated to 0.2.0 from 0.1.0 instead of 0.1.1 due to name change and some code changes. Any code/name changes will probably have the minor version be up by one. :)

Update: Okay, renamed to I-Elk.net!

Updated file: 0.2.0 -> 0.2.3

(Please note: Today, November 23, is my birthday, so I won't be making any changes to my source code. See more information in a new post, located in second page.)

Attached Files


Edited by Grayson Peddie, 23 November 2008 - 01:46 AM.


#2 Spanky

Spanky

    Cocoonut

  • Manufacturers
  • PipPipPipPip
  • 2484 posts
  • Location:Shippensburg, PA USA
  • Experience:guru
  • Software:Custom
  • Hardware:Elk M1
  • Tech:X10-PLC, X10-RF, UPB
  • CCTV:ip
  • Phone:VoIP via ISP

Posted 20 November 2008 - 08:36 PM

Great job Grayson. Send me your email and I will send you the M1_SDK.exe to help in your debugging and testing.

Keep up the good work!

#3 Dan (electron)

Dan (electron)

    CocoonTech Admin

  • Admin
  • PipPipPipPip
  • 10870 posts
  • Twitter:@CocoonTech
  • Location:Cyber
  • Experience:guru
  • Software:EventGhost, HomeSeer
  • Hardware:Elk M1, Mi Casa Verde Vera, Ocelot
  • Tech:X10-RF, UPB, Z-Wave, ZigBee
  • Audio:AirPlay
  • Video:SageTV
  • CCTV:analog, ip, dvr
  • Phone:OBi100/110

Posted 20 November 2008 - 08:36 PM

my.Elk would have been such a great name, wish I thought of that! ;) Great job tho, and thanks for sharing!

#4 Grayson Peddie

Grayson Peddie

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 401 posts
  • Location:Altha, FL 32421
  • Software:Open Source Automation
  • Video:MythTV

Posted 20 November 2008 - 09:29 PM

Okay. Will my.Elk be okay? I don't know if there's any conflict with other names, though.

I'm okay without the M1_SDK.exe. The code I have in the zip folder does the same thing. ;)

Edited by Grayson Peddie, 20 November 2008 - 09:32 PM.


#5 Dan (electron)

Dan (electron)

    CocoonTech Admin

  • Admin
  • PipPipPipPip
  • 10870 posts
  • Twitter:@CocoonTech
  • Location:Cyber
  • Experience:guru
  • Software:EventGhost, HomeSeer
  • Hardware:Elk M1, Mi Casa Verde Vera, Ocelot
  • Tech:X10-RF, UPB, Z-Wave, ZigBee
  • Audio:AirPlay
  • Video:SageTV
  • CCTV:analog, ip, dvr
  • Phone:OBi100/110

Posted 20 November 2008 - 09:49 PM

As long as myDotSoft.com doesn't mind ...

#6 Grayson Peddie

Grayson Peddie

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 401 posts
  • Location:Altha, FL 32421
  • Software:Open Source Automation
  • Video:MythTV

Posted 20 November 2008 - 10:09 PM

As long as myDotSoft.com doesn't mind ...



I guess I'll change the name, them. Thanks.

Please mention the website ahead of time. so I don't have to rename too many times. I guess I'll choose I-Elk.net then.

Okay, enough changing the name. I don't know of something unique in the code I've written just to think of a unique name, as long as it serves its purpose. I'm just here to contribute my source code to the public domain -- open source community and the world of home automation. *sigh*

Edited by Grayson Peddie, 20 November 2008 - 10:31 PM.


#7 icellama21

icellama21

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 301 posts

Posted 20 November 2008 - 11:24 PM

I am new to this forum so I am not sure what the community is like. Maybe you guys can offer some advice on an idea I have.

I have an iphone interface for the Elk M1 that I have written and have been using(via the iphone SDK). It has a level of capability somewhere between the two eKeypad versions. The code itself is very basic, probably a day of development and a day or two of testing(over a period of time). I have been reading about interest for an iphone interface and am tempted to offer it as open source and look into submitting the collective output to apple every few months or so.

The problem is there exists a commercial version(eKeypad). I could not in clear conscience charge for a product with so little code and no real IP (it essentially resembles an intro comp-sci project, just polls data and moves it around, etc). Nor would I plan on supporting it. I am a firm believer in open-source initiatives and the power of collective innovation/support. I look at it as the difference between star office and MS office. Similar capabilities, different price points, very different marketing/target/support.

Is anyone interested in such an idea? As far as I can tell there is no license associated with the Elk RS-232 protocol(or at least not when I downloaded it, let me know if this is not true), and the app source would have to be protected with a GPL-like license to prevent it from being commercialized. I hesitate because I do not want to harm any commercial innovation being done via eKeypad, but I am also eternally grateful for the wonderful (and often very complex) applications out there under freeware/shareware/open-source licenses.

Anyhow, just my thoughts. At this point I am leaning against this because I don't think there are enough mac/iphone developers who would be interested. The last thing I want to do is offer a free product just to compete with eKeypad. If I have the time I'd like to build an open-source elkRM for MacOS, that might be a better future path and won't take too long thanks to the interface builder.

#8 nov0798

nov0798

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 530 posts
  • Location:Dumfries, VA
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1
  • Tech:UPB, 1-Wire
  • Phone:VoIP via ISP

Posted 20 November 2008 - 11:28 PM

Since I dont know code, what does this do?

Thanks

#9 Grayson Peddie

Grayson Peddie

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 401 posts
  • Location:Altha, FL 32421
  • Software:Open Source Automation
  • Video:MythTV

Posted 20 November 2008 - 11:30 PM

I cannot afford an iPhone or iPod Touch. Sorry.

However, if you have a Mac with Mono running, you can compile the source code and construct your iPhone-liked web application for your iPhone. I don't know if there's a mobile version of Mono, aka Mono Compact Framework, for your iPhone.

I just like to try to keep my thread from being iPhone-centric, even if I'm open-minded. ;)

Since I dont know code, what does this do?

Thanks


If you know C#, VB.net, or Managed C++, you can use this DLL and create your own home automation application in Visual Studio. It allows your home automation application (when developed) to communicate with Elk.

Edited by Grayson Peddie, 20 November 2008 - 11:37 PM.


#10 icellama21

icellama21

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 301 posts

Posted 20 November 2008 - 11:41 PM

I am more interested in your thoughts on the commercial/open-source balance in home automation. Very few of the basic control apps out there(not including the more complex packages that are essentially fancy wrappers with hundreds of drivers/interfaces) are more complex that simple freeware applications that have been around for 20 years.

There seems to be a trend toward commercialization/high-cost solutions instead of DIY programming/customization. I took a quick look at homeseer and CQC and understand why they are so popular, no need to create tons of data structures and read protocol specs all day! However, I am wondering if there is an active programming community working on this as a hobby and looking for a less-closed solution. This thread is really the first I've seen so far of open-source in home automation. I found a couple of code fragment and older source files out there, but nothing active so far.

I'm not too preferential to the iphone, I just happen to have a stable app already running.

#11 Grayson Peddie

Grayson Peddie

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 401 posts
  • Location:Altha, FL 32421
  • Software:Open Source Automation
  • Video:MythTV

Posted 21 November 2008 - 12:07 AM

Hmm... Interesting. So is it true that home automation and open-source does not mix? I'm just wondering about that.

I tried HomeSeer, but I can't afford it. But now that I got Elk interface working (partially tested), I'm hoping to build a home automation application with a plug-in interface, like adding the Elk interface (that I've made), Insteon, etc. and be able to communicate with each other, like if the security system is armed in Vocation mode, randomize the level of lights in a regular interval and have it off during night time.

Let's try to keep this thread specific to Open-Source Elk Interface. I don't want my thread to go off-track.

#12 Work2Play

Work2Play

    Cocoonut

  • -=Gold Supporter=-
  • 4960 posts
  • Location:Colorado
  • Experience:guru
  • Software:Elve
  • Hardware:Elk M1, RUC-01
  • Tech:X10-RF, UPB, RadioRA2
  • Audio:AirPlay
  • Video:XBMC
  • CCTV:ip, dvr
  • Phone:3CX, Asterisk, FreePBX, Grandstream, Ooma

Posted 21 November 2008 - 02:50 AM

Sounds like a Good Job is in order, Greyson... I wanted to do the same, and bought a MacBook Pro to play, but time is the one thing I don't have... I'd love to play with your source one day when I have time though.

#13 Grayson Peddie

Grayson Peddie

    Dedicated Cocooner

  • Registered
  • PipPipPip
  • 401 posts
  • Location:Altha, FL 32421
  • Software:Open Source Automation
  • Video:MythTV

Posted 21 November 2008 - 03:15 AM

Heh... It's Grayson. :(

Thanks!

Don't forget to install Mono for your Mac OS X before you compile the source code in MonoDevelop. You might want to create a project called "I-Elk.net" just to keep the naming consistent with the Windows version (but not mandatory. :)). If you find any errors, please let me know.

Edited by Grayson Peddie, 21 November 2008 - 03:19 AM.


#14 hobbes487

hobbes487

    Cocooner

  • Registered
  • PipPip
  • 69 posts

Posted 21 November 2008 - 04:13 AM

Hmm... Interesting. So is it true that home automation and open-source does not mix? I'm just wondering about that.

I tried HomeSeer, but I can't afford it. But now that I got Elk interface working (partially tested), I'm hoping to build a home automation application with a plug-in interface, like adding the Elk interface (that I've made), Insteon, etc. and be able to communicate with each other, like if the security system is armed in Vocation mode, randomize the level of lights in a regular interval and have it off during night time.

Let's try to keep this thread specific to Open-Source Elk Interface. I don't want my thread to go off-track.


I agree with you about most home automation software being too expensive, but there are free options out there. I use vCrib, which is completely free. It has support for a lot of HA protocols like insteon and x10. It is set up to be able to have other interfaces added like your elk interface. The creator has recently released an SDK to make it easy for developers to make add-on interfaces. vCrib is a complete HA solution like HomeSeer, but its free! I am currently developing a Z-Wave client for it and a web interface. I'm sure it would not be hard to take your elk interface and connect it to vCrib.

#15 fjc

fjc

    Newbie

  • Registered
  • Pip
  • 6 posts

Posted 21 November 2008 - 06:53 AM

This looks fantastic - I'm new to Elk (and haven't even ordered mine yet - I'm still researching). Does this work specifically with a computer that's connected directly to the Elk via serial port? How much more work do you think it'd be if it were connecting via the Elk add-in ethernet board?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users