1

I'm trying to get a pi happening as an IP camera, using a CSI camera module. I'd like to minimise CPU usage. I don't need motion detection, just to dump an image from the camera onto the network where another server will do things with it. Any pointers on how to achieve this? Most guides use the 'motion' software but that's designed for motion detection - can the motion detection there be disabled? Is it possible to have the software on the pi only capture images when a network client is connected?

1 Answer 1

2

I use a simple PHP script to call a bash script to grab a picture and serve it back in PHP. I can call this bash script to grab an image any time I want one or auto refresh, send to mysql, convert to video, ect.

install a web server

sudo apt-get install apache2 

Dont forget to set some permissions, also chmod +x everything and set permissions of you html dir

sudo usermod -a -G video $(whoami) sudo chmod 777 /dev/vchiq 

webcam.php

<?php $result = exec("/bin/bash /var/www/html/take_image.sh"); echo $result; $file = './webcam.jpg'; $type = 'image/jpeg'; header('Content-Type:'.$type); header('Content-Length: ' . filesize($file)); readfile($file); ?> 

take_image.sh

raspistill -q 90 -w 640 -h 480 -t 60 -o /var/www/html/webcam.jpg 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.