Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 3rd, 2012, 01:18 AM
Rootjim Rootjim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 4 Rootjim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 27 sec
Reputation Power: 0
Interfacing Perl to monitor a motion detector?

I've been acquainted with Perl in the past.. primarily for parsing text. I want to monitor and log the output of (1 or 2) motion detectors via Perl on my Linux PC. (I expect I'll have to condition the detector's output to be 'appropriate' for a PC port, maybe even one-shot it for a pulse.) I wonder if I should use a serial or parallel port? I'll want to log, with date, the events to a file, then sleep for about a minute then continue polling. Just a command line script, no GUI. I have Linux Mint9 on a PC of the DDR2 era. The Linux runs from a thumb drive. Serial or Parallel? Am I asking for trouble?
Thx, Rootjim

Reply With Quote
  #2  
Old August 3rd, 2012, 08:01 AM
Axweildr's Avatar
Axweildr Axweildr is offline
'fie' on me, allege-dly
Click here for more information.
 
Join Date: Mar 2003
Location: in da kitchen ...
Posts: 12,874 Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)Axweildr User rank is General 81st Grade (Above 100000 Reputation Level)  Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1Folding Points: 162285 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 2 Weeks 1 Day 20 h 28 m 56 sec
Reputation Power: 6421
Send a message via Google Talk to Axweildr
Orkut
I'd have thought the motion detectors would already comply with some standard comms library? Have you purchased these detectors yet?

Another option might be X10 or Insteon kit, there are CPAN sources for this, I've not worked with them though.
__________________
--Ax
without exception, there is no rule ...
Handmade Irish Jewellery
Targeted Advertising Cookie Optout (TACO) extension for Firefox
The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones


09 F9 11 02
9D 74 E3 5B
D8 41 56 C5
63 56 88 C0
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
-- Jamie Zawinski
Detavil - the devil is in the detail, allegedly, and I use the term advisedly, allegedly ... oh, no, wait I did ...
BIT COINS ANYONE

Reply With Quote
  #3  
Old August 4th, 2012, 05:12 AM
Rootjim Rootjim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 4 Rootjim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by Axweildr
I'd have thought the motion detectors would already comply with some standard comms library? Have you purchased these detectors yet?

Another option might be X10 or Insteon kit, there are CPAN sources for this, I've not worked with them though.


Hello, and thank you.. The detectors are being delivered. They aren't 'wireless' detectors such as X10 types, (which I also have) they are hybrid; PIR and microwave, to reduce false detections. I want to them to give me a look at each day's 'genuine' motion around my premises. Then I can search DVR camera results for that time frame to see if it was deer etc. My DVR's "motion detection" (visual only) is constantly being tripped by moths, birds, and reflections of passing autos.
I believe the output of the detector is either/both of NC or NO contacts, or a 12v level. I was wanting to convert that output on a breadboard to an appropriate voltage (and isolation) such that it could present a 1 or a 0 on a port. I dearly want to connect a computer to "the outside world" hopefully without a proprietary type of protocol.

Reply With Quote
  #4  
Old August 4th, 2012, 09:27 AM
keath's Avatar
keath keath is offline
!~ /m$/
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: May 2004
Location: Reno, NV
Posts: 4,085 keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 6 h 51 m 10 sec
Reputation Power: 1809
I believe that communicating over a serial port or parallel port implies a certain intelligence on both sides of the cable. (And parallel is so ancient let's just talk about serial.)

A perl script can communicate with a serial device (stackoverflow), but that still implies something on the other end will respond to your requests for information.

And ideally, rather than you continuously polling for information, there would be a microprocessor on the other end that could recognize hardware interrupts and initiate the conversation when it had data to share.

So I recommend you check out Arduino and see if that would work for you. The boards appear to be inexpensive, and the software is available for all operating systems.

Edit: perl and arduino

Last edited by keath : August 4th, 2012 at 09:30 AM.

Reply With Quote
  #5  
Old August 4th, 2012, 10:44 PM
Rootjim Rootjim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 4 Rootjim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 27 sec
Reputation Power: 0
Arduino?

That looks very interesting.. It might enable me to do more than log events. Thanks for the tip and a more stable alternative to my thoughts. This seems like the 'right' way to do what I want. I've seen the name Arduino while browsing but had no idea what it was. I hope to reply with an update on my project.
Thank you for the assistance!

Reply With Quote
  #6  
Old August 11th, 2012, 07:45 PM
Rootjim Rootjim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 4 Rootjim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 27 sec
Reputation Power: 0
Ordered an arduino uno R3

Just an update.. I'm getting an Arduino Uno R3. As you probably know, it features a micro-P designed for a small proprietary C environment, and it looks as though it can be set up to port information to Perl. If this works I may have a new hobby! I'm already dusting off my O'Reilly books to revisit what I thought I remembered about Perl. They say your memory is the second thing to go.. I forgot what was first. Thanks!
--Rootjim

An Update: I have the Uno and have it up on my Mint 10 Linux box. Looks like a Datalogger shield and some input into the digital pins might be all it takes to do my motion sensor task. There are already other things I have in mind for the Arduino. Looking good, and Thanks for the direction... and Axweilder too.. I didn't know that the motion sensors complied with a standard Comm library. There are wireless dual-tec models which I overlooked because I didn't think they were compatible with my console. Thanks, and I may be back with Perl questions..
---rootjim

Last edited by Rootjim : August 18th, 2012 at 03:58 AM. Reason: UPDATE

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Interfacing Perl to monitor a motion detector?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap