Page 105 of 210

Re: another use for RPi Cam Web Interface

Posted: Tue Jun 30, 2015 6:31 pm
by jbeale
boomlikethat wrote:if there's a set of instructions on how you got to that demo video point with OpenCV, let me know. It really is cool, good work!
I started a new thread on this subject, to avoid derailing this one.

Re: RPi Cam Web Interface

Posted: Wed Jul 01, 2015 10:07 am
by btidey
Olegg had made a useful pull request adding support for a second camera if using the compute module not a standard Pi.

I have added this with a slight tweak so it is hidden for normal Pi users who won't see any difference.

The raspimjpeg config has a new variable (camera_num). This is 0 by default which means first camera and hide the selection. 1 and 2 select the first or second camera and expose a new camera setting on the main page to allow switching between them.

Re: RPi Cam Web Interface

Posted: Wed Jul 01, 2015 10:50 am
by Gary Littlemore
### Feature Request ###

I've now had motion running constantly for 3 days, so as you can imagine I've got 387 motion videos and the used space is 61.8% of 29135 (MB). At some point I'm going to hit 100% if I don't remove files and if motion isn't turned off

Could options be created to be able to:

a) When hit (Value)%, start to automatically delete the oldest file(s)
b) Delete file(s) between from (Date, Time) - to (Date, Time) e.g. from (2015-06-29, 00:01) - to (2015-06-29, 23:59)

Re: RPi Cam Web Interface

Posted: Wed Jul 01, 2015 11:06 am
by rmjspa
As far I know that feature is already there. But I am not sure.

However in my opinion it is not a good Idee to write constantly the motion clips to an SD card. Sooner or later the SD card will fail. I am trying since a few days to write the motion clips to an attached USB stick with no luck. I used the way in wiki.

Is there any one out there who hat more luck?

Re: RPi Cam Web Interface

Posted: Wed Jul 01, 2015 3:06 pm
by miraaz
rmjspa wrote:As far I know that feature is already there. But I am not sure.

However in my opinion it is not a good Idee to write constantly the motion clips to an SD card. Sooner or later the SD card will fail. I am trying since a few days to write the motion clips to an attached USB stick with no luck. I used the way in wiki.

Is there any one out there who hat more luck?
Yes i have. I write clips in to external usb HDD. and working fine.
Right now i develop in installer possibility change location where clips saved but there more problems. Main problem is installer already have to lot of yes no questions. Right now i think maby is smart in install time do basic default configuration. Extra tweak options going already in to new option "configure" where we can change port; where clips saved and so on.
Yes that is correct SD cards not last long when constantly overwriting.

Re: RPi Cam Web Interface

Posted: Wed Jul 01, 2015 6:57 pm
by btidey
Gary Littlemore wrote:### Feature Request ###

I've now had motion running constantly for 3 days, so as you can imagine I've got 387 motion videos and the used space is 61.8% of 29135 (MB). At some point I'm going to hit 100% if I don't remove files and if motion isn't turned off

Could options be created to be able to:

a) When hit (Value)%, start to automatically delete the oldest file(s)
b) Delete file(s) between from (Date, Time) - to (Date, Time) e.g. from (2015-06-29, 00:01) - to (2015-06-29, 23:59)
Check out scheduler purge features. One can set a duration on a recording so that it is purged after this time and one can also set purging if space drops below a value or recordings go above a value. I haven't manually deleted a recording on one of my cameras in over a month now.

The base technology of USB Flash and SD is very similar. There are differences between manufacturers with some having better levelling and wear protection. Obviously if the media is on the OS SD then a full failure can mean a re-install. I have been using Sandisk SD on Raspberries for over 2 years now and not had a failure so far.

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 10:21 am
by slabua
What am I supposed to see in this page to edit motion settings?
Maybe do I have some files with either the wrong path inside, permissions or user:group that needs to be fixed?

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 10:52 am
by slabua
slabua wrote:What am I supposed to see in this page to edit motion settings?
Maybe do I have some files with either the wrong path inside, permissions or user:group that needs to be fixed?
I figured it out. I was using the directive "control_authentication" which RPi Cam Web Interface is not able to workaround, so I had to disable it :\
Is there any way to make it work?

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 11:02 am
by btidey
slabua wrote:What am I supposed to see in this page to edit motion settings?
Maybe do I have some files with either the wrong path inside, permissions or user:group that needs to be fixed?
You should see a table of motion settings that you can edit and save.

This table is built by using the motion API that responds to http requests on port 6642

This is set up in the default motion.conf file in /etc/motion/motion.conf

Code: Select all

############################################################
# HTTP Based Control
############################################################

# TCP/IP port for the http server to listen on (default: 0 = disabled)
control_port 6642

# Restrict control connections to localhost only (default: on)
control_localhost on

# Output for http server, select off to choose raw text plain (default: on)
control_html_output off
A blank table suggests that motion is running otherwise you would get a warning, but that motion is not responding to this port or cannot read its config file.

Check the motion.conf file is OK and can be read by motion. It should be owned by www-data.

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 11:17 am
by btidey
slabua wrote:
slabua wrote:What am I supposed to see in this page to edit motion settings?
Maybe do I have some files with either the wrong path inside, permissions or user:group that needs to be fixed?
I figured it out. I was using the directive "control_authentication" which RPi Cam Web Interface is not able to workaround, so I had to disable it :\
Is there any way to make it work?
OK. You added a username / password onto the motion control port. That will block the web site from picking up the settings and there is currently no support for this. It would need to be added in motion.php and then one gets into a spiral of where you configure that.

The thinking here was that we set by default control_localhost on which means that this port and API can only be accessed by processes running on the local host Pi which is making it relatively secure anyway.

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 11:23 am
by btidey
A question has been raised that we don't explicitly install php-cli which is true. I find on my machines that this has got installed anyway but I wanted to check if this was OK. If somebody could open up a cmd and try php --version on a machine with just basic install then it should return a version message if the cli is working.

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 1:55 pm
by Gary Littlemore
btidey wrote:
Gary Littlemore wrote:### Feature Request ###

I've now had motion running constantly for 3 days, so as you can imagine I've got 387 motion videos and the used space is 61.8% of 29135 (MB). At some point I'm going to hit 100% if I don't remove files and if motion isn't turned off

Could options be created to be able to:

a) When hit (Value)%, start to automatically delete the oldest file(s)
b) Delete file(s) between from (Date, Time) - to (Date, Time) e.g. from (2015-06-29, 00:01) - to (2015-06-29, 23:59)
Check out scheduler purge features. One can set a duration on a recording so that it is purged after this time and one can also set purging if space drops below a value or recordings go above a value. I haven't manually deleted a recording on one of my cameras in over a month now.

The base technology of USB Flash and SD is very similar. There are differences between manufacturers with some having better levelling and wear protection. Obviously if the media is on the OS SD then a full failure can mean a re-install. I have been using Sandisk SD on Raspberries for over 2 years now and not had a failure so far.
I've got configured:

PurgeSpace_ModeEx [Min Space %]
PurgeSpace_Level [15] (Available)

Is that all I need to do to stop it going no lower than 15% and it will automatically delete the oldest file first?

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 3:08 pm
by btidey
Gary Littlemore wrote:
I've got configured:

PurgeSpace_ModeEx [Min Space %]
PurgeSpace_Level [15] (Available)

Is that all I need to do to stop it going no lower than 15% and it will automatically delete the oldest file first?
Yes. With those setting then every Management_Interval (default 1 hour). It will check the media and delete files as necessary starting with the oldest until there is at least 15% of the volume storage available.

There will be log events when it does purges.

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 3:16 pm
by Gary Littlemore
btidey wrote:
Gary Littlemore wrote:
I've got configured:

PurgeSpace_ModeEx [Min Space %]
PurgeSpace_Level [15] (Available)

Is that all I need to do to stop it going no lower than 15% and it will automatically delete the oldest file first?
Yes. With those setting then every Management_Interval (default 1 hour). It will check the media and delete files as necessary starting with the oldest until there is at least 15% of the volume storage available.

There will be log events when it does purges.
Great thanks

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 9:13 pm
by harlock74
btidey wrote:A question has been raised that we don't explicitly install php-cli which is true. I find on my machines that this has got installed anyway but I wanted to check if this was OK. If somebody could open up a cmd and try php --version on a machine with just basic install then it should return a version message if the cli is working.
Hi Robert,

There we go:

Code: Select all

$ php --version
PHP 5.4.41-0+deb7u1 (cli) (built: Jun  7 2015 23:27:41) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
after a fresh raspbian install. Looking good.

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 10:53 pm
by harlock74
Hi Robert,

Just to let you know that I was not able to change any values from the 'Edit Motion Settings' page. This has been happening with Google Chrome and Safari.

The odd thing is that I have tried, for istance, to edit in the /etc/motion/motion.conf the line

Code: Select all

 on_motion_detected mail -s “WebCam Motion Detected” my@email.co.uk
but to not avail. I mean when I get back to the 'Edit Motion Settings' page, the value 'none' is still shown in the field 'on_motion_detected '.

When you get a chance could you please have look at it?

Many thanks for that!

PS:All sorted, a simple reboot did the trick. Working like a charm, as expected!

Re: RPi Cam Web Interface

Posted: Thu Jul 02, 2015 11:52 pm
by netromaster
Installing the package from the pi, i was prompted for a username and password.
could i please get the log in details? thanks a million! 8-)

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 7:26 am
by Edih
hi , I am trying to install RPi cam web interface for a usb attached camera , I have followed all the steps listed on your blog,
I keep getting error alerts when I access my IP on a browser. It comes with an alert " error in raspiMJPeg...,restart whole RPi"
Any ideas what could be wrong ?

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 8:00 am
by btidey
netromaster wrote:Installing the package from the pi, i was prompted for a username and password.
could i please get the log in details? thanks a million! 8-)
Not quite sure where you were prompted for username and password. By default we do not use extra username and password.

You log into the pi in the normal fashion (default pi:raspberry). When you install RPi_Cam_Web_Interface one of the questions asked is whether you want to turn on Web security. If you answer No then after the install you can freely browse to the Pi host address to access the camera system. If you answer Yes the it will ask for the username and password which you want to use. The install then sets up the Apache Web server so that you will be prompted for a username and password when you try to access the web site. You use the same values you entered during the install. This helps control access particularly if you plan to make the web site accessible from the internet by port forwarding.

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 8:00 am
by slabua
btidey wrote: OK. You added a username / password onto the motion control port. That will block the web site from picking up the settings and there is currently no support for this. It would need to be added in motion.php and then one gets into a spiral of where you configure that.

The thinking here was that we set by default control_localhost on which means that this port and API can only be accessed by processes running on the local host Pi which is making it relatively secure anyway.
Thanks for the clarification. Yes, I was also using motion independently, so I guess I'll make two config files and let this use the one which sets control_localhost on.

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 8:07 am
by slabua
Is there any known issue in handling annotations with leading spaces?
The picture shows my current working setting, though sometimes the leading spaces disappear (I haven't tested yet which cases broke it, whether the use of the web interface or the likes).

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 9:50 am
by btidey
slabua wrote:Is there any known issue in handling annotations with leading spaces?
The picture shows my current working setting, though sometimes the leading spaces disappear (I haven't tested yet which cases broke it, whether the use of the web interface or the likes).
There is not a specific problem with leading spaces. However, from the look of it you are adding on a lot of spaces at the start to force to the right, and a lot of spaces in the middle to force a wrap to second line and also to position to the right. That means you maybe exceeding the maximum length of annotation string. The web side and raspimjpeg allow up to 253 characters to be handled. The MMAL camera layer can restricts this further. I believe initially this was 64 characters, then got extended up to 128. Testing with latest v4 shows that it can now handle the maximum we can throw at it. If you have an older OS version then a rpi-update may help.
Annotation.jpg
Annotation.jpg (18.97 KiB) Viewed 3493 times

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 10:05 am
by slabua
btidey wrote:There is not a specific problem with leading spaces. However, from the look of it you are adding on a lot of spaces at the start to force to the right, and a lot of spaces in the middle to force a wrap to second line and also to position to the right. That means you maybe exceeding the maximum length of annotation string. The web side and raspimjpeg allow up to 253 characters to be handled. The MMAL camera layer can restricts this further. I believe initially this was 64 characters, then got extended up to 128. Testing with latest v4 shows that it can now handle the maximum we can throw at it. If you have an older OS version then a rpi-update may help.
Thanks for the reply, yes I add leading spaces and spaces in the middle, but still within the limits.
My issue is actually simpler than it sounds, I suppose. Basically, the annotation line I set, at some point changes from my previous screenshot, to this. Everything is still fine, only the leading spaces are removed, as if the web interface (or the config file created from it) would need some kind of   space, or maybe a way to enclose it in quote marks (I'm just throwing it there, I don't know the details).

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 10:49 am
by btidey
slabua wrote:
btidey wrote:There is not a specific problem with leading spaces. However, from the look of it you are adding on a lot of spaces at the start to force to the right, and a lot of spaces in the middle to force a wrap to second line and also to position to the right. That means you maybe exceeding the maximum length of annotation string. The web side and raspimjpeg allow up to 253 characters to be handled. The MMAL camera layer can restricts this further. I believe initially this was 64 characters, then got extended up to 128. Testing with latest v4 shows that it can now handle the maximum we can throw at it. If you have an older OS version then a rpi-update may help.
Thanks for the reply, yes I add leading spaces and spaces in the middle, but still within the limits.
My issue is actually simpler than it sounds, I suppose. Basically, the annotation line I set, at some point changes from my previous screenshot, to this. Everything is still fine, only the leading spaces are removed, as if the web interface (or the config file created from it) would need some kind of   space, or maybe a way to enclose it in quote marks (I'm just throwing it there, I don't know the details).
The web interface just passes the annotation template string as it exists through to the raspimjpeg process whenever you change it so it isn't dynamically involved. The raspimjpeg process interprets the string for every jpeg live image requested. The processed string just gets sent into the MMAL annotation call.

At the moment I don't see any place where the number of spaces would change on our side.

Is the date in your second shot wrapped on to the second line? That would imply that maybe it is the wrapping logic of the Annotation process could be sensitive to the content. It is always a bit risky to rely on spaces to control this sort of thing as I suspect Annotation was intended as a 1 liner and you are relying on side effects.

It might be worth posting the question in the thread viewtopic.php?f=43&t=97929

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 6:27 pm
by harlock74
harlock74 wrote:Hi Robert,

Just to let you know that I was not able to change any values from the 'Edit Motion Settings' page. This has been happening with Google Chrome and Safari.

The odd thing is that I have tried, for istance, to edit in the /etc/motion/motion.conf the line

Code: Select all

 on_motion_detected mail -s “WebCam Motion Detected” my@email.co.uk
but to not avail. I mean when I get back to the 'Edit Motion Settings' page, the value 'none' is still shown in the field 'on_motion_detected '.

When you get a chance could you please have look at it?

Many thanks for that!

PS:All sorted, a simple reboot did the trick. Working like a charm, as expected!
Hi Robert,

Unfortunately I have been experiencing the same issue today. I can't change any values at all. I tried to reboot but to no avail.

Is there anything I can check?

Thanks a lot!