Page 2 of 2

Re: surveillance camera through PI

Posted: Tue Jun 18, 2013 8:52 pm
by Sp4rKy
maybe it doesn't like the netcam_userpass.

You can try passing the password in the URL. Quick google on found this one for different options on the URL (the .cgi ones worked for me along with user and password - I didn't use the netcam_userpass):
http://www.ispyconnect.com/man.aspx?n=dbpower

Also, in my configuration I have 'http://' in front of the IP - not sure if that makes any difference though

Re: surveillance camera through PI

Posted: Tue Jun 18, 2013 9:27 pm
by cpu2007
Thank you very much

You are great.
It worked lol

so, as you mentioned, the reason behind it not working was probably because it doesn't like the netcam_userpass parameter.

I thought these parameters were for motions and motion then process them in its own way.
Anyway the url I've used is as follow:

http://192.168.0.178/videostream.cgi?us ... e&pwd=pass

and now when I use 192.168.0.16:8088 I can see the stream video.

Now all it's left is to be able to customize motion detection.

Is there a motion interface that can be used or it's all through the conf file?
I am asking this because I want to know if is possible to apply motion detection to a or multiple specific areas and if there's a movement in those areas then trigger the whole video recording.

Re: surveillance camera through PI

Posted: Wed Jun 19, 2013 9:05 am
by willip5
Is there a motion interface that can be used or it's all through the conf file?
I am asking this because I want to know if is possible to apply motion detection to a or multiple specific areas and if there's a movement in those areas then trigger the whole video recording.
The interface is enabled using the control_port setting, just set it to the next port you are using for the video stream, you can then access all the controls in your browser, also set control_localhost=off to access the controls from another machine. If you want to write them back to the conf file don't forget to select the write option before shutting motion down. Both these settings must go in the .conf file NOT the thread file

The motion detection area is set with area_detect.

A great place for Motion config settings and all the documentation is the MIT site http://www.mit.edu/activities/anime/arc ... guide.html

Re: surveillance camera through PI

Posted: Wed Jun 19, 2013 9:38 am
by cpu2007
Thank you. I will be looking through the link you've provided, it seems very useful.

It looks like that when I write motion in the command line, even if video0 has been commented it, its still tries to load it for some reason and because of it, it keeps saying unsuccessful;although the webcam can still be accessed through pi.

Another thing I've noticed is that when there's a motion in front of the camera, the system shuts and I can't access the ip cam through pi,unless I restart the service.

Any idea what this might be caused by?

Re: surveillance camera through PI

Posted: Wed Jun 19, 2013 11:13 am
by willip5
It looks like that when I write motion in the command line, even if video0 has been commented it, its still tries to load it for some reason and because of it, it keeps saying unsuccessful;although the webcam can still be accessed through pi.

Another thing I've noticed is that when there's a motion in front of the camera, the system shuts and I can't access the ip cam through pi,unless I restart the service.
1. Looks like it is using another motion.conf or thread1 file. If you are only using one camera is is simpler to put all the settings in the .conf file and get rid of the thread file so there is one less thing to worry about.

How are you running motion? and where is the .conf file? stick them both into a directory, change the name of the .conf file a little to perhaps motionip.conf then run motion from that directory with

Code: Select all

./motion -n -c motionip.conf
This should then ensure that Motion is using the correct .conf file

2. As a non coder I would suspect your power supply for the second problem, there are an awful lot of poor supplies around and they do not all supply the current printed on them, I use an RS one which works well.

I am currently running Motion on a Pi with MMAL camera and the dozencrows mods
http://www.raspberrypi.org/phpBB3/viewt ... 43&t=44966
and it works very well, much better quality than the IP camera, only problem is I don't have a waterproof housing for the pi + cam.

Re: surveillance camera through PI

Posted: Wed Jun 19, 2013 2:01 pm
by cpu2007
I will try the instruction you've given on the .conf files once I get home. Thanks

When you say power supply, do you mean the one of the IP camera or the one of the Rpi?
In both cases, I don't see how can this be related. The reason why I am saying this is because:
After the crash I can still access my rpi remotely and I can still access the ip camera directly using the direct url. The only thing I can't connect to is to the motion url ip:8088; and this only happens after there has been a motion in front of the ip camera, if there's no motion then I can see the stream video through the motion URL.

Re: surveillance camera through PI

Posted: Wed Jun 19, 2013 3:08 pm
by willip5
After the crash I can still access my rpi remotely and I can still access the ip camera directly using the direct url. The only thing I can't connect to is to the motion url ip:8088; and this only happens after there has been a motion in front of the ip camera, if there's no motion then I can see the stream video through the motion URL.
When you said crash I assumed the Pi had crashed, so what crashed?
When this happens is Motion still running?
Does Motion create a movie file?
What does the Motion log file say?
Does Motion have write permission to the directory it is trying to create the movie file to?

Pete

Re: surveillance camera through PI

Posted: Wed Jun 19, 2013 3:42 pm
by cpu2007
I am not exactly sure what crashed but I have reason to believe that is motion that has crashed.
1) 192.168.0.16 is the ip of my rpi and I access it through ssh
2) 192.168.0.178 is the ip of my ip camera
3)192.168.0.16:8088 is the URL i use to access my ip camera through motion.

I can access the 3rd ip which is live only when motion is running. however if motion is detected then something crashes and I can't access the third ip but I can still access the 1st and 2nd ip.

I believe what you said about the permission might be the cause. I remember yesterday when crashes were happening, I checked the target_dir directory but there were no videos.
I'll check the permissions to see if that is what is causing the issue.

Re: surveillance camera through PI

Posted: Wed Jun 19, 2013 3:55 pm
by willip5
If you set up and run Motion under a /home/pi/motion directory as above then you should not have any permission problems and it is a lot easier to work with than sudoing about. See if you can get it to save some files.

Pete

Re: surveillance camera through PI

Posted: Thu Jun 20, 2013 2:02 pm
by Sp4rKy
Also check your /var/log/syslog - it might get a better understanding on what is going on.

What userid is motion running under? Make sure your motion directory has write access for that user.

Re: surveillance camera through PI

Posted: Sun Jun 23, 2013 7:46 pm
by cpu2007
ok I have changed the permissions of the folder motion which is in /etc/motion ; I've changed the rights using chmod 777
However the problem still persists. I've moved the motion folder somewhere else but it wasn't working any more so I put it back to the location where it was before.

I have also checked the syslog file but there's nothing that suggest me what is wrong with it:

here's the log:

Code: Select all

Jun 23 19:40:43 raspberrypi motion: [0] Processing thread 0 - config file /etc/motion/motion.conf
Jun 23 19:40:43 raspberrypi motion: [0] Processing config file /etc/motion/thread1.conf
Jun 23 19:40:43 raspberrypi motion: [0] Motion 3.2.12 Started
Jun 23 19:40:43 raspberrypi motion: [0] Created process id file /var/run/motion/motion.pid. Process ID is 9003
Jun 23 19:40:43 raspberrypi motion: [0] Motion running as daemon process
Jun 23 19:40:43 raspberrypi motion: [0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
Jun 23 19:40:43 raspberrypi motion: [0] Thread 1 is from /etc/motion/thread1.conf
Jun 23 19:40:43 raspberrypi motion: [1] Thread 1 started
Jun 23 19:40:43 raspberrypi motion: [0] motion-httpd/3.2.12 running, accepting connections
Jun 23 19:40:43 raspberrypi motion: [0] motion-httpd: waiting for data on port TCP 8083
Jun 23 19:40:43 raspberrypi motion: [1] Resizing pre_capture buffer to 1 items
Jun 23 19:40:43 raspberrypi motion: [1] Started stream webcam server in port 8088

Re: surveillance camera through PI

Posted: Thu Jul 04, 2013 9:47 am
by cpu2007
it keeps crashing, does anyone thing there's something wrong or an error shown in the log?
it looks fine to me.

Re: surveillance camera through PI

Posted: Fri Jul 05, 2013 11:38 am
by SirLagz
cpu2007 wrote:it keeps crashing, does anyone thing there's something wrong or an error shown in the log?
it looks fine to me.
Run motion as a user until it crashes, then it should spit something out when it dies

Re: surveillance camera through PI

Posted: Tue Sep 10, 2013 6:23 pm
by dmoura
cpu2007: how many fps are you getting from the ip camera? what is the video resolution?
Thanks!