btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sat Apr 16, 2016 10:48 am

ScheissSchiesser wrote:Can somebody help me figure out why my motionPars.json file is not getting populated with the motion settings? This causes me to be unable to view/change the motion settings via the web interface.

I am having trouble determining which part of the RPi-Cam-Web-Interface code is responsible for doing that. It is probably something in the motion.php file, but I am having trouble understanding it. It might help to debug this problem if I could figure that out.

As it stands now, motionPars.json is an empty file. Bringing up the motion.php page via clicking on the "motion settings" button shows a blank page (no table), presumably because the motionPars.json file contains no data.

Any help/hints would be appreciated.
With standard RPi-Cam-Web-Interface installation and using external motion detection settings then the http api supported by motion is used to retrieve the /etc/motion/motion.conf data and display it in the motion.php table. The api is also used to modify values. motionPars.json doesn't come into it.

In /etc/motion/motion.conf there is a section that controls the API called HTTP based control. The installer should set that up to be
control_port 6642
control_localhost on
control_html_output off

This means queries are done on port 6642, only requests from same host are allowed, and responses are in a plain text format.

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sat Apr 16, 2016 10:53 am

slabua wrote:Another strange thing is this: at some point after 10.00, I manually stopped and restarted the timelapse. It has now continued beyond the 16.00 slot, without interruption. The preview icon currently shows a total of 212 frames (up to the slot of 16.00, indeed).
I think for some reason, at each scheduler slot, something happens with the preview, or the naming of files, though, each image gets saved on disk as per scheduler log.
That does sound like something is going wrong with naming or the association of files into a timelapse sequence which is done using the names of the files.

Could you post the names of the thumbnail image for the sequence, the last image that is part of the sequence and the next captured image that should have been included?

tianheng123
Posts: 13
Joined: Mon Aug 03, 2015 4:14 pm

Re: RPi Cam Web Interface

Sat Apr 16, 2016 8:36 pm

Hi ! I have been using this interface for over than 6 months.
Recently I got new RPi 3, and the interface runs so smooth on this model.

However, I am having the problem with all the buttons (taking photos/videos) and settings become non-responsive? Does anyone have similar problem?

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Sat Apr 16, 2016 8:58 pm

btidey wrote:
slabua wrote:Another strange thing is this: at some point after 10.00, I manually stopped and restarted the timelapse. It has now continued beyond the 16.00 slot, without interruption. The preview icon currently shows a total of 212 frames (up to the slot of 16.00, indeed).
I think for some reason, at each scheduler slot, something happens with the preview, or the naming of files, though, each image gets saved on disk as per scheduler log.
That does sound like something is going wrong with naming or the association of files into a timelapse sequence which is done using the names of the files.

Could you post the names of the thumbnail image for the sequence, the last image that is part of the sequence and the next captured image that should have been included?
Thumbnail name: tl_0042_0001_20160416_131638.jpg.t0042.th.jpg
Last frame included: tl_0042_0479_20160412_155957.jpg
First frame excluded: tl_0042_0480_20160412_160057.jpg
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sat Apr 16, 2016 9:50 pm

slabua wrote:
btidey wrote:
slabua wrote:Another strange thing is this: at some point after 10.00, I manually stopped and restarted the timelapse. It has now continued beyond the 16.00 slot, without interruption. The preview icon currently shows a total of 212 frames (up to the slot of 16.00, indeed).
I think for some reason, at each scheduler slot, something happens with the preview, or the naming of files, though, each image gets saved on disk as per scheduler log.
That does sound like something is going wrong with naming or the association of files into a timelapse sequence which is done using the names of the files.

Could you post the names of the thumbnail image for the sequence, the last image that is part of the sequence and the next captured image that should have been included?
Thumbnail name: tl_0042_0001_20160416_131638.jpg.t0042.th.jpg
Last frame included: tl_0042_0479_20160412_155957.jpg
First frame excluded: tl_0042_0480_20160412_160057.jpg
I have a theory as to what could cause this which is to do with video captures going on during time lapse sequences which could disrupt the association. I'll check that out tomorrow.

Edit: I have made a small adjustment to timelapse collection to make it more robust with video captures.

Cubytus
Posts: 135
Joined: Thu Dec 05, 2013 6:13 pm

Re: RPi Cam Web Interface

Sun Apr 17, 2016 12:12 am

Hello there,

after months I diceided to give RPi Cam Web interface another try. I followed the instructions in the wiki, having uninstalled the previous version, then re-cloned it. It is now version 6.0.38, running on Apache.

I can see the picture and record videos manually, but still can't change Motion settings. It always gives the message:
Motion not running. Put in detection state
I had a look at the Trouble shooting section, but nothing clearly covers this issue, which seems to be common.
Why does it fail? I would like to change the recording folder to a SSHFS-mounted one.

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sun Apr 17, 2016 8:33 am

Cubytus wrote:Hello there,

after months I diceided to give RPi Cam Web interface another try. I followed the instructions in the wiki, having uninstalled the previous version, then re-cloned it. It is now version 6.0.38, running on Apache.

I can see the picture and record videos manually, but still can't change Motion settings. It always gives the message:
Motion not running. Put in detection state
I had a look at the Trouble shooting section, but nothing clearly covers this issue, which seems to be common.
Why does it fail? I would like to change the recording folder to a SSHFS-mounted one.
In order to display and change the external motion settings, the motion process itself must be running as it then supports the web api used to get and change the settings kept in /etc/motion/motion.conf

If you get that message then the main web interface thinks that the motion process is not running and therefore telling you to activate motion detection which will start the motion process.

A few possibilities
1) You have not started motion detection.
2) You have started motion detection but the motion process is not actually running. You can check this by issuing the ps -A command from a terminal or ssh window. You should see motion listed as one of the processes.
3) The technique used by the web interface is not seeing motion running even though it is. Last time I checked this it was OK, but we have had to tweak this a couple of times when the OS changed. Try issuing pgrep motion from command line while motion is running. It should come back with a PID

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Sun Apr 17, 2016 8:35 am

tianheng123 wrote:Hi ! I have been using this interface for over than 6 months.
Recently I got new RPi 3, and the interface runs so smooth on this model.

However, I am having the problem with all the buttons (taking photos/videos) and settings become non-responsive? Does anyone have similar problem?
Can you describe non-responsive a bit more? Do you mean the buttons stop working altogether at some point, or that it slows down a lot? What state are they in then; is it capturing?

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Sun Apr 17, 2016 10:26 am

btidey wrote:
slabua wrote:
Thumbnail name: tl_0042_0001_20160416_131638.jpg.t0042.th.jpg
Last frame included: tl_0042_0479_20160412_155957.jpg
First frame excluded: tl_0042_0480_20160412_160057.jpg
I have a theory as to what could cause this which is to do with video captures going on during time lapse sequences which could disrupt the association. I'll check that out tomorrow.

Edit: I have made a small adjustment to timelapse collection to make it more robust with video captures.
Thanks, meanwhile I have updated my installation with the latest upstream code.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

egmontr
Posts: 7
Joined: Fri Jul 25, 2014 1:39 pm
Location: Munich, Germany

Re: RPi Cam Web Interface

Sun Apr 17, 2016 2:17 pm

On my website the RPi Cam Web Interface works very nice. The motion detection also.
Now what I want to do, is to set a time window for the motion detection. Say, start the motion detection at 6 AM to 6 PM. How can I do this?
I also thought to a cron job, but I don't know which script/daemon/service to start/stop.

Thanks.

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Sun Apr 17, 2016 2:25 pm

egmontr wrote:On my website the RPi Cam Web Interface works very nice. The motion detection also.
Now what I want to do, is to set a time window for the motion detection. Say, start the motion detection at 6 AM to 6 PM. How can I do this?
I also thought to a cron job, but I don't know which script/daemon/service to start/stop.

Thanks.
You can click on Edit schedule settings button, change the DayMode to Fixed times and set your times in the table below.
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

egmontr
Posts: 7
Joined: Fri Jul 25, 2014 1:39 pm
Location: Munich, Germany

Re: RPi Cam Web Interface

Sun Apr 17, 2016 2:32 pm

Thanks Salvatore,

I have the version v4.2.3. There I can not see that button. Is it possible to edit some file instead?
Or if I have to update, which is the best way?

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Sun Apr 17, 2016 2:39 pm

egmontr wrote:Thanks Salvatore,

I have the version v4.2.3. There I can not see that button. Is it possible to edit some file instead?
Or if I have to update, which is the best way?
You're welcome.
I would recommend to update, which would give you probably a lot more new features since then.
Not sure about the current installation process, I think it has been renewed since a while.
Probably you can find more information here http://elinux.org/RPi-Cam-Web-Interface ... structions
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

tianheng123
Posts: 13
Joined: Mon Aug 03, 2015 4:14 pm

Re: RPi Cam Web Interface

Mon Apr 18, 2016 9:24 am

btidey wrote:
tianheng123 wrote:Hi ! I have been using this interface for over than 6 months.
Recently I got new RPi 3, and the interface runs so smooth on this model.

However, I am having the problem with all the buttons (taking photos/videos) and settings become non-responsive? Does anyone have similar problem?
Can you describe non-responsive a bit more? Do you mean the buttons stop working altogether at some point, or that it slows down a lot? What state are they in then; is it capturing?

The buttons (record video start record image timelapse start ) stop working all at once, and also the configure (resolutions, brightness, etc.) does not work.

I just freshly turned on the machine and I am not taking any image previously.

Thank you for replying.

User avatar
slabua
Posts: 95
Joined: Tue Sep 11, 2012 7:00 pm
Contact: Website

Re: RPi Cam Web Interface

Mon Apr 18, 2016 6:08 pm

slabua wrote:
btidey wrote:
slabua wrote:
Thumbnail name: tl_0042_0001_20160416_131638.jpg.t0042.th.jpg
Last frame included: tl_0042_0479_20160412_155957.jpg
First frame excluded: tl_0042_0480_20160412_160057.jpg
I have a theory as to what could cause this which is to do with video captures going on during time lapse sequences which could disrupt the association. I'll check that out tomorrow.

Edit: I have made a small adjustment to timelapse collection to make it more robust with video captures.
Thanks, meanwhile I have updated my installation with the latest upstream code.
I have changed the settings of the scheduler. This way, I got 12h of recording, with 720 frames as expected but,
Screenshot from 2016-04-18 20-03-04.png
Screenshot from 2016-04-18 20-03-04.png (18.17 KiB) Viewed 3223 times
the log shows something strange again:

Code: Select all

{2016/04/18 20:00:05} Capturing image
[2016/04/18 20:00:06] New period detected 9
[2016/04/18 20:00:06] Send tl 0
{2016/04/18 20:01:05} Capturing image
{2016/04/18 20:02:05} Capturing image
{2016/04/18 20:03:06} Capturing image
The capture didn't actually stop.
And the buttons are indeed:
Screenshot from 2016-04-18 20-06-08.png
Screenshot from 2016-04-18 20-06-08.png (8.84 KiB) Viewed 3223 times
Salvatore La Bua - www.slblabs.com
DICGIM - University of Palermo, Italy

ScheissSchiesser
Posts: 9
Joined: Wed Mar 23, 2016 2:48 pm

Re: RPi Cam Web Interface

Mon Apr 18, 2016 7:58 pm

btidey wrote:
ScheissSchiesser wrote:Can somebody help me figure out why my motionPars.json file is not getting populated with the motion settings? This causes me to be unable to view/change the motion settings via the web interface.

I am having trouble determining which part of the RPi-Cam-Web-Interface code is responsible for doing that. It is probably something in the motion.php file, but I am having trouble understanding it. It might help to debug this problem if I could figure that out.

As it stands now, motionPars.json is an empty file. Bringing up the motion.php page via clicking on the "motion settings" button shows a blank page (no table), presumably because the motionPars.json file contains no data.

Any help/hints would be appreciated.
With standard RPi-Cam-Web-Interface installation and using external motion detection settings then the http api supported by motion is used to retrieve the /etc/motion/motion.conf data and display it in the motion.php table. The api is also used to modify values. motionPars.json doesn't come into it.

In /etc/motion/motion.conf there is a section that controls the API called HTTP based control. The installer should set that up to be

Code: Select all

control_port 6642
control_localhost on
control_html_output off
This means queries are done on port 6642, only requests from same host are allowed, and responses are in a plain text format.
This did it! Thank you for the helpful response.

I want to point out that I am using motion 3.2.12, and it seems that the configuration settings are different in this version than what is assumed in RPi-Cam-Web-Interface installer, and indeed your post. For instance, my motion.conf file has the following settings instead:

Code: Select all

webcontrol_port 6642
webcontrol_localhost on
webcontrol_html_output off
I had to manually change a bunch of settings a while back to port the configuration file to the motion-3.2.12 settings' names, so I probably erroneously changed them (I had the control port disabled).

Perhaps the installer could detect the motion version and use the correct naming convention. I would be happy to submit a PR on github if that is something desirable (though I make no claims about my ability to actually figure out how to do that!).

tianheng123
Posts: 13
Joined: Mon Aug 03, 2015 4:14 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 7:52 am

tianheng123 wrote:
btidey wrote:
tianheng123 wrote:Hi ! I have been using this interface for over than 6 months.
Recently I got new RPi 3, and the interface runs so smooth on this model.

However, I am having the problem with all the buttons (taking photos/videos) and settings become non-responsive? Does anyone have similar problem?
Can you describe non-responsive a bit more? Do you mean the buttons stop working altogether at some point, or that it slows down a lot? What state are they in then; is it capturing?

The buttons (record video start record image timelapse start ) stop working all at once, and also the configure (resolutions, brightness, etc.) does not work.

I just freshly turned on the machine and I am not taking any image previously.

Thank you for replying.
Hi, It seems like that if I go into debuggin mode, i can use this buttons.
However, once i am out, the buttons malfunctions.

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 9:37 am

ScheissSchiesser wrote: I want to point out that I am using motion 3.2.12, and it seems that the configuration settings are different in this version than what is assumed in RPi-Cam-Web-Interface installer, and indeed your post. For instance, my motion.conf file has the following settings instead:

Code: Select all

webcontrol_port 6642
webcontrol_localhost on
webcontrol_html_output off
I had to manually change a bunch of settings a while back to port the configuration file to the motion-3.2.12 settings' names, so I probably erroneously changed them (I had the control port disabled).

Perhaps the installer could detect the motion version and use the correct naming convention. I would be happy to submit a PR on github if that is something desirable (though I make no claims about my ability to actually figure out how to do that!).
Motion did change its parameter names which was one of the reasons why Jessie installs were different from Wheezy ones. The names I showed were from an older Wheezy install.

The install script now lets motion create its own motion.conf file so that its names are correct. It then dynamically alters just the values it needs to in oder to make it work with the rets of the camera set up.

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 9:56 am

slabua wrote: I have changed the settings of the scheduler. This way, I got 12h of recording, with 720 frames as expected but,
Screenshot from 2016-04-18 20-03-04.png
the log shows something strange again:

Code: Select all

{2016/04/18 20:00:05} Capturing image
[2016/04/18 20:00:06] New period detected 9
[2016/04/18 20:00:06] Send tl 0
{2016/04/18 20:01:05} Capturing image
{2016/04/18 20:02:05} Capturing image
{2016/04/18 20:03:06} Capturing image
The capture didn't actually stop.
And the buttons are indeed:
Screenshot from 2016-04-18 20-06-08.png
The log indicates that the scheduler did the right thing in sending a time lapse stop (tl 0) but raspimjpeg didn't obey that for some reason which I don't understand at the moment.

Can you see whether that happens each time?

Edit: This is what I got for a quick test

Code: Select all

{2016/04/19 10:58:36} Change: tl_interval = 150
[2016/04/19 11:00:07] New period detected 7
[2016/04/19 11:00:07] Send tl 1
{2016/04/19 11:00:07} Timelapse started
{2016/04/19 11:00:20} Capturing image
{2016/04/19 11:00:35} Capturing image
{2016/04/19 11:00:50} Capturing image
{2016/04/19 11:01:05} Capturing image
{2016/04/19 11:01:20} Capturing image
{2016/04/19 11:01:35} Capturing image
{2016/04/19 11:01:50} Capturing image
{2016/04/19 11:02:05} Capturing image
{2016/04/19 11:02:20} Capturing image
{2016/04/19 11:02:36} Capturing image
{2016/04/19 11:02:51} Capturing image
{2016/04/19 11:03:06} Capturing image
{2016/04/19 11:03:21} Capturing image
{2016/04/19 11:03:36} Capturing image
{2016/04/19 11:03:51} Capturing image
{2016/04/19 11:04:06} Capturing image
{2016/04/19 11:04:21} Capturing image
{2016/04/19 11:04:36} Capturing image
{2016/04/19 11:04:51} Capturing image
[2016/04/19 11:05:04] New period detected 8
[2016/04/19 11:05:04] Send tl 0
{2016/04/19 11:05:04} Timelapse stopped

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 10:54 am

tianheng123 wrote: Hi, It seems like that if I go into debuggin mode, i can use this buttons.
However, once i am out, the buttons malfunctions.
That sounds a bit like the std out is filling up somewhere. Normally it should be redirected to /dev/null. What method did you use to install the software?

tianheng123
Posts: 13
Joined: Mon Aug 03, 2015 4:14 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 11:11 am

btidey wrote:
tianheng123 wrote: Hi, It seems like that if I go into debuggin mode, i can use this buttons.
However, once i am out, the buttons malfunctions.
That sounds a bit like the std out is filling up somewhere. Normally it should be redirected to /dev/null. What method did you use to install the software?
I followed the one outlined at : http://elinux.org/RPi-Cam-Web-Interface
same as what i did before on RPi 2b

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 4:56 pm

tianheng123 wrote: I followed the one outlined at : http://elinux.org/RPi-Cam-Web-Interface
same as what i did before on RPi 2b
There are 2 install methods described there.

The original method
./RPi_Cam_Web_Interface_Installer.sh install

and the new method which eLinux recommends
./install.sh

If things go wrong with an install the install.sh method is the one I can directly support.

Cubytus
Posts: 135
Joined: Thu Dec 05, 2013 6:13 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 6:44 pm

btidey wrote: In order to display and change the external motion settings, the motion process itself must be running as it then supports the web api used to get and change the settings kept in /etc/motion/motion.conf

If you get that message then the main web interface thinks that the motion process is not running and therefore telling you to activate motion detection which will start the motion process.

A few possibilities
1) You have not started motion detection.
Indeed, it wasn't started. Now when I click the "Edit Motion settings" button, I don't have this message anymore, but a blank page with buttons on top:
Captura de pantalla 2016-04-19 a las 14.35.25.png
Captura de pantalla 2016-04-19 a las 14.35.25.png (18.15 KiB) Viewed 2920 times
2) You have started motion detection but the motion process is not actually running. You can check this by issuing the ps -A command from a terminal or ssh window. You should see motion listed as one of the processes.
It is in fact listed near the bottom of the output:

Code: Select all

16212 ?        00:00:04 motion
3) The technique used by the web interface is not seeing motion running even though it is. Last time I checked this it was OK, but we have had to tweak this a couple of times when the OS changed. Try issuing pgrep motion from command line while motion is running. It should come back with a PID
This is confirmed, I get 16212 by said command.

Meybe the parameters should get a plain-English explanation of what they are? Not everybody is familiar with the Motion program.

Meanwhile, why do I get this blank page?

btidey
Posts: 1626
Joined: Sun Feb 17, 2013 6:51 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 9:35 pm

Cubytus wrote:Indeed, it wasn't started. Now when I click the "Edit Motion settings" button, I don't have this message anymore, but a blank page with buttons on top:


Meybe the parameters should get a plain-English explanation of what they are? Not everybody is familiar with the Motion program.

Meanwhile, why do I get this blank page?
The motion set up is now detecting that external motion is running OK, but you get the blank page.

This means that the web interface is not successfully retrieving the motion.conf settings via the motion API.

The installer changes a few items in the /etc/motion/motion.conf file to make this work. In particular, these items are important.

webcontrol_port 6642
webcontrol_localhost on
webcontrol_html_output off

If you used the regular install.sh install method these should be already set up. If they are not then edit them to these values.

RPi Cam Web only uses the external motion process to provide start and stop motion triggersand the parameters are fairly well commented in the motion.conf file. There is also a good guide at http://www.lavrsen.dk/foswiki/bin/view/ ... ileOptions

My preference is to use the alternative internal motion detection facility which uses the vector differencing capability of the camera support directly. This bypasses the motion process altogether and has a simpler set up.

User avatar
Trixster
Posts: 261
Joined: Sat Jul 07, 2012 3:53 pm

Re: RPi Cam Web Interface

Tue Apr 19, 2016 10:06 pm

Has anyone got Dropbox-Uploader working correctly with the scheduler? I want to upload the jpg which is created by a video into dropbox. I've setup Dropbox-Uploader as per the instructions on the raspi.tv website.

I have a script in /var/www/html/macros called dropbox.sh with the following contents:

#!/bin/bash
/bin/bash ./dropbox_uploader.sh upload /var/www/html/media/*.jpg Photo

running this from the console works nicely, however when I put ca 0;sy dropbox.sh into the relevant Motion Stop field in the scheduler the script doesn't seem to execute as I would expect. The jpg isn't uploaded to dropbox and using Top the dropbox script doesn't seem to be completing - it just sits there chewing up cpu cycles.

Any ideas why it might not be working? all the permissions are setup correctly (www-data is the owner) and the locations of the relevant files are correct as far as i can tell.

Return to “Camera board”