You can access the camera board on /dev/video0 by running the command:
sudo modprobe bcm2835-v4l2
This will have to be run on every boot of the device. Or you can put modprobe bcm2835-v4l2 in /etc/rc.local to make it run on every boot automatically.
To enable motion to run as a daemon on startup do the following:
and change start_motion_daemon=no to start_motion_daemon=yes
Next enable motion by entering the following at the command line:
sudo systemctl enable motion
You can confirm motion is running by checking the output from the following command:
Gotcha! For testing I started motion with sudo motion -b. Therefore, /var/log/motion/motion.log was written with root:root. After removing /var/log/motion and reboot, the motion-daemon was up and running and had the permission to write to the log.
My answer is in two parts, one for motion detection and another for SMS. A project like this has two components: hardware and software. Detecting motion is the hardware part and everything else is software.
To detect movement, get a motion sensor. I use the Parallax PIR Motion Sensor: Amazon affiliate link here. The sensor has 3 pins: GND, ...
Motion usually creates it's own user called motion and when you run motion as daemon, this user is used.
I suggest you change the group of the folder and make the folder group-writeable so that both you (user: pi) and motion (group:motion) will be able to read and write to that directory without making it world-readable.
1) Change the group of ...
There's a simple way to do it with VLC, this post explains step by step how to do it, in few words this is the way you do it:
After having the camera fully set and ready to be used(connected and enabled), now you need to download the package that will perform the live streaming functionality, getting it is as simple as just executing this command in your ...
Finally! I found it after almost two months after trying out every minor change in configuration and peripherals/accessories every day. It turned out to be a USB extension cable issue. I was using a 3 meter USB extension cable, which was not having noise filter. When I replaced the same with 5 meter cable with Noise Filter on both sides, everything works ...
You should look to v4l2loopback in order to allow to open "twice" a V4L2 device.
1 - It will allow to create a virtual video device using :
sudo apt-get install v4l2loopback-dkms
sudo modprobe v4l2loopback video_nr=10
This will add a new device /dev/video10
2 - Next you will need to copy the real device (/dev/video0) to the virtual one (/dev/video10) ...
What I did was:
1) Removed Motion from Raspberry Pi using
sudo apt-get --purge remove motion
2) Disabled Raspberry Pi Camera in raspi-config and rebooted the Pi
3) Installed fswebcam using
sudo apt-get install fswebcam
4) Tried capturing a photo with it using
fswebcam -r 640x480 --no-banner image3.jpg
5) It worked!! Then Installed ...
There are three ways to fix the problem. All are really the same, just from different angles. That is to make sure that the user starting motion has the access permission to write into the /var/log/motion/ directory. First could just make that user the owner of the directory. And give the owner write access. The second would be start the daemon using root ...
I found the solution to my problem, and I almost don't want to post it because I feel like such an idiot. But for the better of the community I think it is important that this thread is answered just incase another idiot has the same problem I did.
So, my WPUT script looked like this:
on_picture_save wput −−binary −−remove−source−files ftp://USERNAMEHERE@...
The standard motion dosn't work with the RPI camera. There is a variant called motion-mmal in development which works with the RPI camera
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=44966&p=379561#p374790 is a forum chat on setting it up
http://www.codeproject.com/Articles/665518/Raspberry-Pi-as-low-cost-HD-surveillance-camera this is a guide on ...
Have a search on ebay for "i2c rtc"
There are plenty of very inexpensive ones based on the DS1307 battery included!
I've connected one of these previously, but I don't think I posted the code anywhere yet. I'll add it to this answer when I find it.
The other chip is an AT24C32 flash memory that you can ignore.
Yes this is possible, though will require some study and perserverance, and a single RPI is likely not sufficient in CPU bandwidth (though this is by no means proven and multiple PIs could be federated to provide the needed capacity).
Motion is insufficient for this task, being merely a motion detection program.
What I would recommend is investigating ...
Would you believe it, I actually had some success last night in this area!
I changed the ; mmalcam_control_params value to mmalcam_control_params -ex sports -ev 25 --shutter 256000 the auto_brightness on the brightness 255 the contrast 1 the saturation 5 and the hue 0.
I also found that jpgs performed better than movies so set output_pictures on and ...
Check out this thread:
With the updated binary you can get 15FPS on the live stream. If you set output_pictures ON, you can collect up to 15 jpgs per second. Then just use ffmpeg to convert to AVI. Viola!
Found the solution myself.
For future reference, here is the solution:
The page http://RPI.IP:CONFIGPORT/0/action/snapshot already executes the necessary code to make a snapshot. Calling this page (e.g. cURL) then enables you to take a snapshot when desired.
simple web-camera + "motion" software (you may install it with 'sudo apt-get install motion') should take care about the first part of the question. motion has plenty of parameters in the configuration file, you may run external scripts when the motion is detected.
the second part of your question (re: SMS) will require internet connection and subscription ...
Remove the FORM element completely (as the markup from exmaple doesn't even conform to HTML specifications). So it looks something like this, in its simplest form.
//Import jquery here
<img src= "http://192.168.15.22:8081/?action=stream" width="800" height="460"/>
<input id="left_button" type="button"...
as per the comments in the motion.conf
# The mini-http server listens to this port for requests (default: 0 = disabled)
Motion will still monitor the frames on the camera, after all it is looking for motion. But with the webcam server disabled no data will be "served" anywhere.
I seem to have got it working by placing sudo modprobe bcm2835-v4l2 in the start section of /etc/init.d/motion and commenting out #export LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so
see the below code:
if check_daemon_enabled ; then
if ! [ -d /var/run/motion ]; then
You are wasting your time trying to get Motion to work reliably on the PI. Others have tried and it will disconnect from your cam after an hour or 2. This happened to me as well. Requests to the author of Motion to fix the bugs resulted in nothing
A short Google search for Device doesn't support VIDIOC_G_STD gave these two links:
Raspberry Pi • View topic - Motion errors for RPi camera
Unable to open video device · Issue #147 · ccrisan/motioneyeos
The first page suggests:
Check for ls /dev/video*, no output means your camera is not connected properly or driver is missing
If a camera is recognized, ...
If they are USB cameras... you can preview the stream on demand using any software you like.. as long as you say which USB device you are using.
You could even use a desktop application to take screenshot or short videos. Since you can use a desktop you could use any remote desktop program you like to join and view the files or video.
You can also create ...
Welcome to stack exchange!
Use the sudo and chmod commands. to give the everyone(the default user) access to the folder, simply change into the directory(folder) the folder is in using the command line(terminal), and type
sudo chmod a+rwx foldername
replace foldername with the image folder. This should work, if it doesn't, let me know!
In addition to the answer from @p4ulmac you get the pid with ps -e | grep motion. If you like to control your services with systemd then there is no need to handle with the pid. You can simply:
rpi ~$ sudo systemctl reload motion.service
and check with:
rpi ~$ systemctl status motion.service
You need to use 3 axes accelerometer to sense which side of your cube is facing up. Accelerometers sense the gravity g and the acceleration due to motion.
Eg. when you roll dice, one of the axis will face down towards earth, let us assume positive x-axis exactly facing downwards, so the sensor will sense g along its positive axis which will be +9.8m/s^2, now ...