Page 106 of 204

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 10:17 pm
by btidey
harlock74 wrote: 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!
If you are seeing the settings on the motion page then that indicates that motion can read them OK and can feed them back to the web page via its interface.

If you change a value and press Save and the setting doesn't get preserved then that is most likely because motion can't write the new values back to /etc/motion/motion.conf because of permission problems.

When motion is running it should be running under the user www-data. You can check that by issuing the command

Code: Select all

ps -Af
That shows all the processes running with details. You should see motion in the list with www-data on the left. If it has a different user then check the user for raspimjpeg which should also be www-data. If that is not then something is wrong with the start up in rc.local as that starts the process with www-data.

Now check the permission of the motion.conf file with

Code: Select all

sudo ls -l /etc/motion
You should see an entry like
-rw-rw-r-- 1 motion www-data 24064 Jul 2 12:04 motion.conf

That shows that this file is owned by www-data which has read/write permissions on this file

If yours is different then something has gone wrong with the install as it should have set these.

You can fix it by

Code: Select all

sudo chown www-data:www-data /etc/motion/motion.conf
sudo chmod 664 /etc/motion/motion.conf

Re: RPi Cam Web Interface

Posted: Fri Jul 03, 2015 10:46 pm
by harlock74
btidey wrote:

Now check the permission of the motion.conf file with

Code: Select all

sudo ls -l /etc/motion
You should see an entry like
-rw-rw-r-- 1 motion www-data 24064 Jul 2 12:04 motion.conf

That shows that this file is owned by www-data which has read/write permissions on this file
Hi Robert,
Many thanks for coming back to me.

I have checked that and everything looks OK to me:

Code: Select all

$ sudo ls -l /etc/motion
total 40
-rw-rw-r-- 1 pi   www-data 23484 Jul  3 00:11 motion.conf
I am just thinking to re-install everything from scratch. I don't have any issues with the other two RPi's. Indeed I can edit the motion.conf file. Go and figure!

Thanks again for looking at it!

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 1:05 am
by slabua
btidey wrote: 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
In my second shot the configuration is the same as the first one but lacking of only the leading spaces, so the date starts at the beginning of the first line, then the spaces between date and time push the time up to that point.
Thanks, I'll keep an eye on that other thread, too.

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 6:07 am
by slabua
btidey wrote: 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.
I've reproduced the issue, and maybe I can explain better what happens if my previous posts were a bit confusing.
The annotation doesn't ever change randomly, but when using an annotation with leading spaces, after reopening the web interface, the annotation field is filled with data read from uconfig, but without being able to read the leading spaces contained in the file itself. So the problem is that the web page eats the leading spaces.

EDIT: Perhaps the issue lies in the function makeInput of index.php and how it reads the values to fill the fields in index.php itself?

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 9:38 am
by btidey
slabua wrote:
btidey wrote: 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.
I've reproduced the issue, and maybe I can explain better what happens if my previous posts were a bit confusing.
The annotation doesn't ever change randomly, but when using an annotation with leading spaces, after reopening the web interface, the annotation field is filled with data read from uconfig, but without being able to read the leading spaces contained in the file itself. So the problem is that the web page eats the leading spaces.

EDIT: Perhaps the issue lies in the function makeInput of index.php and how it reads the values to fill the fields in index.php itself?
Ok. Yes. I had misunderstood and thought you meant it was jumping around.

Yes. It's quite possible that when index reads the uconfig values it is stripping spaces. I'll check that out.

Edit: Reading config files is in config.php and it is trimming values. I could probably avoid the trim as it is fairly safe given that these values are written by the program.

Edit2: Change made. Leading space preserved when reading values from uconfig

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 9:53 am
by slabua
I have another question, this time about the motion config file and the scheduler.
I have not quite understood the relation between on_event_start, on_event_end in the motion config file and the Motion Start and Motion Stop fields in the daily periods of the scheduler.

1. At first, I thought that if those two parameters in motion.conf are set, the recording is triggered even when the two fields in the scheduler are empty (and that's what indeed happens, so there shouldn't be the need to populate those two fields with ca 1 and ca 0 - Period Start serves to enable/disable the whole motion capturing).

2. Then, I tried commenting out those two parameters in motion.conf, and use ca 1 and ca 0 in the scheduler because I thought that would trigger the recording by piping instead of by reading motion.conf. Am I correct? Because it doesn't seem to work for me.

Of course those two fields in the scheduler can be used to also capture an image upon motion start, and so on, but my question is peculiar to the redundancy of the start/stop recording commands upon motion detection.
If my assumption 2. is correct, then I would prefer, for instance, keeping motion.conf clean from those options and only use the scheduler.

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 9:54 am
by slabua
btidey wrote:Edit2: Change made. Leading space preserved when reading values from uconfig
Great, thank you : )

Edit: hm, it doesn't seem to work. If I stop the camera, then I click again start camera, the leading spaces are gone again. Is this beyond the reading by the web page?

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 11:30 am
by btidey
slabua wrote:
btidey wrote:Edit2: Change made. Leading space preserved when reading values from uconfig
Great, thank you : )

Edit: hm, it doesn't seem to work. If I stop the camera, then I click again start camera, the leading spaces are gone again. Is this beyond the reading by the web page?
Yes. I just tested stopping and starting web interface but I think raspimjpeg may be trimming strings on start up as well. Of course people can manually edit the main raspimjpeg config and I was trying to avoid getting things like leading spaces contaminating other strings like file templates if a user is careless entering stuff. I don't want to start getting into quotes at this stage so maybe I just make annotation a special case as I think that is the only string where this may matter.

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 11:41 am
by btidey
slabua wrote:I have another question, this time about the motion config file and the scheduler.
I have not quite understood the relation between on_event_start, on_event_end in the motion config file and the Motion Start and Motion Stop fields in the daily periods of the scheduler.

1. At first, I thought that if those two parameters in motion.conf are set, the recording is triggered even when the two fields in the scheduler are empty (and that's what indeed happens, so there shouldn't be the need to populate those two fields with ca 1 and ca 0 - Period Start serves to enable/disable the whole motion capturing).

2. Then, I tried commenting out those two parameters in motion.conf, and use ca 1 and ca 0 in the scheduler because I thought that would trigger the recording by piping instead of by reading motion.conf. Am I correct? Because it doesn't seem to work for me.

Of course those two fields in the scheduler can be used to also capture an image upon motion start, and so on, but my question is peculiar to the redundancy of the start/stop recording commands upon motion detection.
If my assumption 2. is correct, then I would prefer, for instance, keeping motion.conf clean from those options and only use the scheduler.
In the original scheme motion sent commands straight into the raspimjpeg pipe (FIFO). These were then ca 1 and ca 0. When the scheduler was introduced a second pipe was introduced (FIFO1) that scheduler monitors. This is used by scheduler to accept motion trigger requests from either the external motion program or the internal motion detector built into raspimjpeg. These requests are simple 1 (start) and 0 (stop) as they are just a signal to the scheduler. It then decides what to do with these and can send for example ca 1 and ca 0 onto the raspimjpeg pipe (FIFO) for just simple video start and stop.

So in the normal set up motion echos just 1 and 0 to FIFO1 for start and end triggers into the scheduler and it then determines the configured actions which can include multiple commands according to the set up, time of day etc.

One can choose to bypass the scheduler altogether and set motion up to send the original ca 1 and ca 0 straight into raspimjpeg. You lose the flexibility of the scheduler and it also won't work with the raspimjpeg internal motion detector as this is programmed to send triggers to the scheduler.

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 12:01 pm
by btidey
btidey wrote:
slabua wrote:
Edit: hm, it doesn't seem to work. If I stop the camera, then I click again start camera, the leading spaces are gone again. Is this beyond the reading by the web page?
Yes. I just tested stopping and starting web interface but I think raspimjpeg may be trimming strings on start up as well.
raspimjpeg now skips trimming annotation strings.

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 12:03 pm
by slabua
@btidey Thanks for explaining about motion, it's all clear now : )
And yes please, if the use of quotes is possible/necessary at least for the annotation case, it would be nice~

- going to pull from repo now, thanks a lot!

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 4:34 pm
by miraaz
harlock74 wrote:
btidey wrote:

Now check the permission of the motion.conf file with

Code: Select all

sudo ls -l /etc/motion
You should see an entry like
-rw-rw-r-- 1 motion www-data 24064 Jul 2 12:04 motion.conf

That shows that this file is owned by www-data which has read/write permissions on this file
Hi Robert,
Many thanks for coming back to me.

I have checked that and everything looks OK to me:

Code: Select all

$ sudo ls -l /etc/motion
total 40
-rw-rw-r-- 1 pi   www-data 23484 Jul  3 00:11 motion.conf
I am just thinking to re-install everything from scratch. I don't have any issues with the other two RPi's. Indeed I can edit the motion.conf file. Go and figure!

Thanks again for looking at it!

You installed using old buggy installer. That bug already fixed now.
viewtopic.php?p=782205#p782205

btidey that code not fix that bug! User mast be motion not www-data. www-data have group rights but still cant edit motion.conf

Code: Select all

sudo chown www-data:www-data /etc/motion/motion.conf
sudo chmod 664 /etc/motion/motion.conf
Fix is:

Code: Select all

sudo chown motion:www-data /etc/motion/motion.conf

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 4:42 pm
by miraaz
harlock74 wrote:
btidey wrote:

Now check the permission of the motion.conf file with

Code: Select all

sudo ls -l /etc/motion
You should see an entry like
-rw-rw-r-- 1 motion www-data 24064 Jul 2 12:04 motion.conf

That shows that this file is owned by www-data which has read/write permissions on this file
Hi Robert,
Many thanks for coming back to me.

I have checked that and everything looks OK to me:

Code: Select all

$ sudo ls -l /etc/motion
total 40
-rw-rw-r-- 1 pi   www-data 23484 Jul  3 00:11 motion.conf
I am just thinking to re-install everything from scratch. I don't have any issues with the other two RPi's. Indeed I can edit the motion.conf file. Go and figure!

Thanks again for looking at it!
harlock74 you motion.conf have wrong owner "pi" mast be "motion"
-rw-rw-r-- 1 motion www-data <- OK
-rw-rw-r-- 1 pi www-data <-NOT OK

Re: RPi Cam Web Interface

Posted: Sat Jul 04, 2015 6:11 pm
by harlock74
miraaz wrote:
harlock74 wrote:
btidey wrote:

Now check the permission of the motion.conf file with

Code: Select all

sudo ls -l /etc/motion
You should see an entry like
-rw-rw-r-- 1 motion www-data 24064 Jul 2 12:04 motion.conf

That shows that this file is owned by www-data which has read/write permissions on this file
Hi Robert,
Many thanks for coming back to me.

I have checked that and everything looks OK to me:

Code: Select all

$ sudo ls -l /etc/motion
total 40
-rw-rw-r-- 1 pi   www-data 23484 Jul  3 00:11 motion.conf
I am just thinking to re-install everything from scratch. I don't have any issues with the other two RPi's. Indeed I can edit the motion.conf file. Go and figure!

Thanks again for looking at it!
harlock74 you motion.conf have wrong owner "pi" mast be "motion"
-rw-rw-r-- 1 motion www-data <- OK
-rw-rw-r-- 1 pi www-data <-NOT OK

Hi miraaz,

Sorry my mistake. Thanks for pointing that out. That did the trick indeed!

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 6:50 am
by slabua
I made a little change to the preview.php page, adding a combo box to choose whether to display both images and videos, only images or only videos.

The rationale behind it is that, usually, I prefer to sort the thumbs in descending order, but having the videos also along, they would always show before the images per naming convention.

If it's useful I'll push it to the repo.

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 8:59 am
by btidey
slabua wrote:I made a little change to the preview.php page, adding a combo box to choose whether to display both images and videos, only images or only videos.

The rationale behind it is that, usually, I prefer to sort the thumbs in descending order, but having the videos also along, they would always show before the images per naming convention.

If it's useful I'll push it to the repo.
Yes. It sounds good. Push it.

The other filter I had thought might be useful but haven't got around to doing was a Day selector for say the last week plus All. Probably would want to be made relative like today, yesterday, 2 days ago etc.

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 9:24 am
by slabua
btidey wrote: Yes. It sounds good. Push it.

The other filter I had thought might be useful but haven't got around to doing was a Day selector for say the last week plus All. Probably would want to be made relative like today, yesterday, 2 days ago etc.
It's up.

Yes, that may be useful too.

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 4:16 pm
by Gary Littlemore
WOW Just upgraded, the upgrade script has all changed :-)

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 4:21 pm
by miraaz
Gary Littlemore wrote:WOW Just upgraded, the upgrade script has all changed :-)
Nice you like it :). More upgrades coming soon ;).

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 4:59 pm
by Gary Littlemore
miraaz wrote:
Gary Littlemore wrote:WOW Just upgraded, the upgrade script has all changed :-)
Nice you like it :). More upgrades coming soon ;).
Has the Wiki been updated with what all the options do?

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 5:41 pm
by Gary Littlemore
In the 'Download Videos and images' I've now got strange text that's appeared since upgrading...
image.jpg
image.jpg (30.26 KiB) Viewed 2608 times

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 7:23 pm
by btidey
Gary Littlemore wrote:In the 'Download Videos and images' I've now got strange text that's appeared since upgrading...
image.jpg
Sorry. I left some debug in. Fixing now.

Edit Fixed

Re: RPi Cam Web Interface

Posted: Sun Jul 05, 2015 8:10 pm
by Gary Littlemore
Could the filter that's always at the bottom of the page be moved to the top?
image.jpg
image.jpg (12.67 KiB) Viewed 2578 times

Tweaks to speed up streaming

Posted: Tue Jul 07, 2015 10:36 am
by southafricanrob
Hi,
I'm using the default settings and have pretty slow and choppy video on a decent speed wifi network. I have tried tweaking some settings but nothing really has much of an impact. Any suggestions on which settings will have the most impact to get a nice smooth video stream?

Re: RPi Cam Web Interface

Posted: Tue Jul 07, 2015 2:22 pm
by jussi24
btidey wrote:Olegg had made a useful pull request adding support for a second camera if using the compute module not a standard Pi.
That's highly interesting. I thought of it since the first cam module I bought. Are there more information available? I know about a second CSI port that is available on the Broadcom chip. Is it identical in connectivity and (GPU-) features? How is double displaying/preview and other things realized in raspimjpeg? What about GPU-limitations when processing both streams simultaneously? Or is it a switching (either/or) concept?