Author Topic: LPT port irrigation control  (Read 11578 times)

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: LPT port irrigation control
« Reply #15 on: March 10, 2009, 05:09:51 pm »
ok guys, just an update. After talking with Hari on IRC we decided that using there are much better alternatives to use than the LPT port.
Downsides to LPT port are:
1. no plug and play
2. Limited # of relays
3. I am not completely sure about this but I during a power outage I believe that the relay will stay open
4. newer computers generally dont come with LPT ports

So after considering all of this I believe that a USB relay board might be the way to go even though they are more expensive. However I went ahead and ordered a LPT relay board anyway just for learning and experimentation. I have already managed to get this board working under the KDE desktop using some scripts and crontab for automation. I also have hacked together a web interface that has buttons to open and close individual relays. My issue at this point is that for some reason LMCE will not trigger my scripts to send commands to the relay board. The script calls on a program that is written in C and uses the I/Operm function so I am thinking that it might be some sort of permissions issue.
Anyway, if I can figure out how to get LMCE to properly fire off these scripts I was thinking about using this relay board to control my speaker distribution block. I can just do some soldering and wire the relay board in place of the manual on/off switches for the different speaker zones in my house and I think I will be able to turn the different zones on/off with buttons in LMCE. so instead of spending $1000 on some audio matrix I will have $70 (4 zone speaker distribution block) $40 (LPT relay board) =$110


colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: LPT port irrigation control
« Reply #16 on: March 10, 2009, 09:52:41 pm »
krys - are you using a GSD for this and the Ruby snippets used to fire off the scripts?

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: LPT port irrigation control
« Reply #17 on: March 10, 2009, 10:27:18 pm »
I have tried the GSD and ruby snippets, the command gets passed along just fine, however nothing happens (I used the xset dpms force off command to verify that the template was working) I also tried putting the commands into a script and calling the script from the test button on the media scenario page on the web admin. The script I built to run xset dpms force off worked from the web admin page, the script for my relay board would not. Both scripts work flawlessly when run at a terminal (without using sudo).

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: LPT port irrigation control
« Reply #18 on: March 10, 2009, 10:47:09 pm »
and the GSD log file doesn't say anything? wonder how you would getting logging out from a Ruby script, at least to confirm that the snippet actually gets executed? I guess you could do an echo redirection to a file...

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: LPT port irrigation control
« Reply #19 on: March 10, 2009, 10:59:49 pm »
I forgot to mention that on the media scenario/ timed event per Thoms instruction I made App server the device and used the spawn application command. In the #13 blank I put the path and name of the script that I wanted to run. I launched TailDCERouter.sh and verified that when I hit the "test"  button that the app server tried to launch my script which it did, just nothing happened. I also set it to launch Amarok just as a test and it worked, thats why I think it may be some sort of a permissions issue with LMCE and something specific in my C program. (but then again I am just guessing)

cfernandes

  • Guru
  • ****
  • Posts: 359
    • View Profile
    • my company web site
Re: LPT port irrigation control
« Reply #20 on: May 29, 2009, 12:55:37 pm »
Hello guys ,

from brazil   

http://www.rogercom.com.br/pparalela/Dsp32es.htm

simple circuit to control   32 dispositivs  and monitor 32  sensors ! 

very simple to build !