PDA

View Full Version : Mike... Need help with IM code using multiple webcams...



Kerryp24
January 10th, 2006, 02:27 PM
Mike
Below is some test code I'm playing with that trys to take pictures from multiple webcams when an event occurs.

I don't get any errors, and in fact the print statements imply that IM knows how many devices I have and what they are. BUT....
When it takes the pictures, it actually takes two pictures from the first device.

I unpluged the first device and reran and it only takes one picture from the (former) second device.

Any ideas about what I need to change to make it work with multiple cameras?

Thanks

Kerryp24
January 10th, 2006, 02:51 PM
Mike

Never mind...

I found my problem.

I had to change the line of code that read:

print(dev:Connect(0))

to

print(dev:Connect(i))

You need to specify the device number when you do the connect.

NOW, I have two cameras taking pictures when my X10 PIR sends it's ON event.

Next step is to associate a different device with each webcam.
Then, depending on the event, a different camera will take a series of snapshots.
Oh, and it will send me an email (once I figure out how to use, socket.smtp :wink: ), when it has taken pictures.

jackisidore
September 10th, 2006, 06:55 AM
NOW, I have two cameras taking pictures when my X10 PIR sends it's ON event.

Next step is to associate a different device with each webcam.
Then, depending on the event, a different camera will take a series of snapshots.
Oh, and it will send me an email (once I figure out how to use, socket.smtp :wink: ), when it has taken pictures.

Exactly what I as looking for (grabbing a picture from my webcam and send an email. The email part isn't the problem (I think). I tried your lua code but it needs an imlua library. Where can I find this library??