Please login or register.

Login with username, password and session length

Author Topic: RecvAction and perl  (Read 13102 times)

grahamk

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 27
RecvAction and perl
« on: July 19, 2009, 10:23:11 PM »

Hi,
 I'd like to write a program in perl to monitor X10 commands and take action on them. For instance, I'd like to assign an X10 channel to a program that controls my stereo. Once I see a command on that X10 channel take action to turn volume up and down (with the dim commands), etc. I already know how to control the stero - just need to pick up the X10 commands.

 I have written perl that send commands, but cannot find the way to receive them.

Any tips greatly appreciated.

Graham
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: RecvAction and perl
« Reply #1 on: July 22, 2009, 10:05:12 AM »

I used to do everything in Perl up to a couple years ago.
But after a while, it got frustrating not being able to find examples of Perl code or anyone that used Perl.

I ended up switching to Visual basic 2008 express.
Everything is so much easier to do and there are lots of people that use it.
And of course, writing programs for windows machines is way easy in VB 2008

This is of course after you get a handle on VB coding.
It can be rough at first getting your brain to think in a new language.

I looked through my old Perl code programs I have here, but I could not find anything except send command stuff.

Monitoring X10 traffic is really easy with VB2008 code and I have lots of samples I can give you for that.

Not much help, just throwing out some info.
I loved Perl, but I had to ditch it.
Logged
W10 - CM15A - AHP 3.301 - i Witness - MyHouse online - Smart Macros - SDK using Visual Basic express 2008
My X10 page-> http://www.el34world.com/Misc/home/X10_0.htm

grahamk

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 27
Re: RecvAction and perl
« Reply #2 on: July 27, 2009, 07:25:45 PM »


OK - I'll bite. It'd be the 5th or 6th programming language I've learned, so what the heck.

Do you know if a VB program can run that is monitoring a CM15 and taking actions on what it sees without interfering with ActiveHome Pro? Can 2 programs be monitoring the same device at the same time?

If you wouldn't mind, I'd love to see a short code example that receives X0 commands...

Thanks!
 Graham
Logged

grahamk

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 27
Re: RecvAction and perl
« Reply #3 on: July 28, 2009, 11:17:31 AM »


I spent a couple hours with VB2008 Express and it's fairly straightforward. I have the functionality I need in the program I've been writing - now just need to play with making it slicker. Reminds me of programming X Windows Motif Widget set. ;-)

Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: RecvAction and perl
« Reply #4 on: July 29, 2009, 08:03:24 AM »

Nice, I think you will end up loving how easy they have made windows programming in VB 2008.

I started in about 1978 doing basic on Commodore PETS and Commodore buisness machines
Did a bit of IBM assembly language and 8080 assembly. (can't remember the chip number)
Perl was the next language I learned.
and  now VB2008.

I already had an example project that will monitor X10 traffic and display the traffic in a text box.
It also has buttons for turning on and off X10 devices and doing a query on a device.

It has a button to send the app to the system tray. click on the tray icon to bring it back.
It has an example of how the timer function works.

Just have a look at the commented code sections and you will be on your way

download and extract the zip file below, click on the .sln file to open the project in VB2008 express.
http://www.el34world.com/Misc/home/Files/X10Monitor.zip

I have another very elaborate X10 program I wrote that monitors traffic, monitors module states, takes actions based on motion sensors that trigger Powerfllash modules, etc
I have another one that monitors Dallas one wire sensors and and can turn on fans, etc in my greenhouse based on sensor readings

You can do just about anything if you can read a sensor of some sort and then control an X10 device based on that reading.

I don't use AHP pro anymore, only to add new modules to my cm15a. Everything works better if you add your modules to AHP and then download the changes to the cm15a. At that point, I exit AHP and don't use it.
Your programs and AHP can run at the same time no problem if you want to.
« Last Edit: July 29, 2009, 08:14:50 AM by EL34 »
Logged
W10 - CM15A - AHP 3.301 - i Witness - MyHouse online - Smart Macros - SDK using Visual Basic express 2008
My X10 page-> http://www.el34world.com/Misc/home/X10_0.htm

grahamk

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 27
Re: RecvAction and perl
« Reply #5 on: July 29, 2009, 07:15:25 PM »

Awesome thanks.

Sounds like we may be doing similar things - I have whole house fans that I turn on when the outside temp is lower than the inside. I would love to monitor the temperature and soil moisture in my greenhouse, but my weather station isn't expandable. The 1 wire temp monitor is new to me. Any advice for a good place to start researching those?

Thanks again for the help!!

Graham
Logged

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: RecvAction and perl
« Reply #6 on: July 29, 2009, 08:46:39 PM »

Here's my one wire page
http://www.el34world.com/Misc/home/OneWireWeather.htm

here's the forum for the guy that has the hardware
http://www.cocoontech.com/forums/index.php?s=73b35d77937018d178212fdbda987b17&showforum=41

here's the link to the chip maker
http://www.maxim-ic.com/products/1-wire/

Dallas one wire stuff is really cool and super reliable
Way more reliable than X10 hardware.

let me know if you have any questions

see ya
Doug
Logged
W10 - CM15A - AHP 3.301 - i Witness - MyHouse online - Smart Macros - SDK using Visual Basic express 2008
My X10 page-> http://www.el34world.com/Misc/home/X10_0.htm

EL34

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 278
    • My X-10 projects
Re: RecvAction and perl
« Reply #7 on: July 30, 2009, 10:44:44 AM »

here's another link
This is my Green house experiment page.

I control fans by reading soil and air temps using Dallas one wire and X10
http://www.el34world.com/Misc/Solar/Solar1.shtml
Logged
W10 - CM15A - AHP 3.301 - i Witness - MyHouse online - Smart Macros - SDK using Visual Basic express 2008
My X10 page-> http://www.el34world.com/Misc/home/X10_0.htm
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.