Cool, I'm definaly interested in the script. I found a way to trigger the serial port. If i put a multimeter to test continuity between CS (pin 6 i think) and pin 5 which is ground and watch /proc/tty/driver/serial, a CS shows up in that file. I wonder if i could just watch this file for that change and have the script trigger the record based off of that.
On 7/6/05, Jason Fried <[EMAIL PROTECTED]> wrote: > Man I dont know the pin layout anymore, but just connect the send and > receive pins and you can write data across it. > you can figure that out by some google searching. > > The thing is in linux you need to initalize the port, i never figured > that out, but minicom will do it for you. > If you want my perl script, email me i'll send it to you > The script can be made sensitive enough to know within a .01seconds if > the button is down > > > Adam Melancon wrote: > > >Is there a way that I could possibly have the script monitor > >/proc/tty/driver/serial > >I guess I should be asking if there is a way to connect two pins > >through the button hooked up to the serial port that would change the > >values in /proc/tty/driver/serial so that I could monitor that file > >and if a change occured, it would fire off a script to start > >recording, and then when the button is released it would change > >/proc/tty/driver/serial back to normal and stop recording? > > > >This is the closest I've come so far to finding any answers via the > >almighty google. > >------------------- > >#/bin/bash > >while true > >do > > read LINE < /dev/tty0S > > echo $LINE > >done > >------------------- > >http://www.easysw.com/~mike/serial/index.html > >------------------- > >http://www.linuxselfhelp.com/HOWTO/Serial-HOWTO.html > >------------------- > > > >On 7/6/05, -ray <[EMAIL PROTECTED]> wrote: > > > > > >>It can definitely be done. We are doing something similar right now to > >>log when an operator goes through Brad's office to leave the computer room > >>(they're not supposed to). Using a simple foil switch nailed to the door > >>frame. > >> > >>I originally wrote a C program to do it about 7 years ago. The basic > >>premise is open the serial port, write 2 bytes, then read them back. If > >>the read fails, the switch is open. If the read succeeds, the switch is > >>closed. Wait a few ms, then do it again. > >> > >>Jason Fried (he's on the list) has all the info on our current setup...he > >>may even remember which pins trigger the switch. If he's not too busy > >>slacking, he can probably post more info. > >> > >>ray > >> > >> > >>On Wed, 6 Jul 2005, Adam Melancon wrote: > >> > >> > >> > >>>I have a small project that I'm working on in my spare time and it > >>>involves a big red button (picture the ones from arcade game cabinets) > >>>attached to the serial port. > >>>Now keep in mind, I'm no programmer, but I'm pretty good at bash scripts. > >>>Is there a simple way that I can have a bash script monitor the serial > >>>port for this button to be pressed and then trigger a function within > >>>the script. > >>> > >>>Basically what this will be is a linux box with a webcam and a mic and > >>>this button, and when the button is pressed, it will have ffmpeg > >>>capture 30 seconds of audio and video to an avi file and then wait for > >>>another press of the button. > >>>It would be ideal if somehow I could also have a red led go on during > >>>capture too. > >>> > >>>There is no real use that I have for this at the moment, it's just > >>>something I'm doing to see if it can be done. > >>> > >>>Does anyone have a simple solution to my serial port quandry? > >>> > >>>Thanks! > >>> > >>> > >>> > >>> > >>> > >>-- > >>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > >>Ray DeJean http://www.r-a-y.org > >>Systems Engineer Southeastern Louisiana University > >>IBM Certified Specialist AIX Administration, AIX Support > >>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > >> > >> > >>_______________________________________________ > >>General mailing list > >>[email protected] > >>http://brlug.net/mailman/listinfo/general_brlug.net > >> > >> > >> > > > > > > > > > > > _______________________________________________ > General mailing list > [email protected] > http://brlug.net/mailman/listinfo/general_brlug.net > -- Adam Melancon Work: http://www.lafayette.lib.la.us
