CharlyDelta
Posts: 44
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Thu Nov 16, 2017 5:50 am

btidey wrote:
Wed Nov 15, 2017 4:15 pm
CharlyDelta wrote:
Wed Nov 15, 2017 2:53 pm

Thank you for your response, Btidey.

We are 5 'operators' with USB keys and we go on the site to manually transfer videos and delete the others not used. But, the thunbnail timelapse is very vulnerable to being deleted by distraction. How can I configure it to be untouchable?
There is no specific configuration for this at the moment. To work out what might work here I need to understand a bit more what untouchable means and what the possibilities are.

I assume the problem is that you are manually maintaining the recordings by deleting unwanted videos and still images, and want to prevent inadvertent deletion of the time lapse recordings, but I guess these need to be removed at some point.

One of the issues here are that are multiple ways recordings can be removed.

a) Delete icon on the thumbnail view
b) Delete selected after selecting thumbnails
c) Delete button after a recording is displayed in larger playback box after clicking on thumbnail
d) Delete All button (after a confirmation)

It is quite tricky to add a confirmation dialog specific to lapse recordings onto the first three as this is only known back at the server after the request has been made.

Here are a few possibilities that might help.

1) Write protect lapse thumbnail and images after capture. This would hard protect them from accidental deletion and also automatic purging but there would be no obvious way from the web side to 'release' them. This could be achieved today by using a simple macro.

2) Add an extra filter option to the list on the preview screen. This currently does Videos and Images, Videos Only, Images Only where Images includes both singles and time lapse. It would be possible to have a Hide lapses so that the lapse thumbnails would not be shown and therefore couldn't be deleted from that filtered view except by Delete All

3) Add an extra setting so that any delete action back at the server is ineffective for time lapse recordings. There wouldn't be any obvious effect at the client other than the lapse recording remains. So for example, if a video and time lapse were selected and deleted then the video would go and the time lapse remain. The setting would need to be cleared prior to any time lapse deletions needed. Note that Delete All bypasses this but has the confirm check anyway.

The other thing to think about is whether the schedule purge system can be used to do at least some of this stuff fairly automatically. One can set retention hours separately for video, image and time lapse and arrange that storage space is always available but give extra priority to lapse recordings.

Let me know what might work and I'll see what may be possible.
Hello Btidey;

Indeed, the Time-lapse icon must not be erasable by anyone other than me.

Option 1 seems to me the easiest to do and I can easily access the system through SSH.


Thank you for your help.

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

Re: RPi Cam Web Interface

Thu Nov 16, 2017 12:59 pm

CharlyDelta wrote:
Thu Nov 16, 2017 5:50 am

Hello Btidey;

Indeed, the Time-lapse icon must not be erasable by anyone other than me.

Option 1 seems to me the easiest to do and I can easily access the system through SSH.


Thank you for your help.
OK. I did a check to make sure Option 1 would work.

The PHP unlink mechanism used to delete files only checks the permissions of the folder rather than the file permissions which seems odd to me. So just removing file permissions does not protect the files at the moment.

I have added a further check in latest version so the delete operation will be ignored OK if the file permission of a thumbnail is read only.

So for option 1 a macro can be used. The easiest form would be to use an end_img.sh macro

This gets fired for every image and has a parameter of the image name so the macro would need to
a) check it was a time lapse image (could look for tl_ if used in image name)
b) See if is the first of a sequence (see if thumbnail exists)
c) Remove write permission on thumbnail file

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

Re: RPi Cam Web Interface

Thu Nov 16, 2017 4:45 pm

btidey wrote:
Thu Nov 16, 2017 12:59 pm

This gets fired for every image and has a parameter of the image name so the macro would need to
a) check it was a time lapse image (could look for tl_ if used in image name)
b) See if is the first of a sequence (see if thumbnail exists)
c) Remove write permission on thumbnail file
Here is my version of a suitable end_img.sh macro

Code: Select all

#!/bin/bash
if [[ $1 == *"tl_"* ]]; then
 list=( $1*.th.jpg )
 thumb="${list[-1]}"
 if [[ $thumb != *"*"* ]]; then
  chmod 444 $thumb
 fi
fi
Note that macro files must be chown to belong to www-data and given execution permissions

yozza
Posts: 8
Joined: Sun Oct 28, 2012 9:07 pm

Re: RPi Cam Web Interface

Thu Nov 16, 2017 9:50 pm

btidey wrote:
Tue Nov 14, 2017 10:11 pm
yozza wrote:
Tue Nov 14, 2017 8:17 pm
I am sure this is addressed in the forum but I cannot identify the best way to do this. I want to control some IR LEDs connected via GPIO 23 and 24 on my PI and would like to have buttons added to the RPi Cam Web interface to enable me to turn them on and off, could someone point me in the right direction please. Thanks
The web interface supports the Pilight control if the pilight_off file is renamed to pilight_on. This actually adds RGB light controls under the camera settings.

This does not do exactly what you want but provides a model for how to add this type of functionality, and you can use similar code to do what you want.

Several things need to be done.

1) Add button control to the index.php. If for example you want a button next to the capture controls then this would need to be added in the <div id="main-buttons"> part of index.php

2) Button needs to have an on_click function to fire a php process on the server (e.g. irLight.php) It needs to have the state of the button as an argument so that the server knows whether to turn IR on or off

3) The irLight.php needs to extract the argument and then perform the appropriate GPIO commands to action the irLEDS. You may add user www-data to the users who are permitted to interact with GPIO
thanks for your help on this I have managed to create the button but I had created my control functions as python scripts and tried to execute these from the on-click function with no success, I guess this means on_click has to have an html function to call. I have tried to create a php function but to date have failed, should I be embedding this function in index.php or creating a seperate php file. My two different styles of attempt are below, any help would be appreciated -
<div id="secondary-buttons" class="container-fluid text-center">
<input id="LEDon_button" type="button" value="IR LED on" onclick="IRled(1);" class="btn btn-primary">
<input id="LEDoff_button" type="button" value="IR LED off" onclick="/sbin/IRled.py(0);" class="btn btn-primary">
</div>

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

Re: RPi Cam Web Interface

Thu Nov 16, 2017 10:46 pm

yozza wrote:
Thu Nov 16, 2017 9:50 pm

thanks for your help on this I have managed to create the button but I had created my control functions as python scripts and tried to execute these from the on-click function with no success, I guess this means on_click has to have an html function to call. I have tried to create a php function but to date have failed, should I be embedding this function in index.php or creating a seperate php file. My two different styles of attempt are below, any help would be appreciated -
<div id="secondary-buttons" class="container-fluid text-center">
<input id="LEDon_button" type="button" value="IR LED on" onclick="IRled(1);" class="btn btn-primary">
<input id="LEDoff_button" type="button" value="IR LED off" onclick="/sbin/IRled.py(0);" class="btn btn-primary">
</div>
The button on_click function is executed within the client environment not at the server. It normally references a javascript function which can then send something to the server which in turn can then run commands like the python GPIO functions.

Probably the easiest way to do this is to utilise the existing client support for sending commands to the raspimjpeg process (send_cmd). One of these commands is 'sy macroname' which will execute an existing macro file stored in the web macros folder. Normally this will be bash scripts but they could run a python command.

So to summarise

1) In the button include something like onclick="send_cmd('sy gpio.sh')"

2) Create a gpio.sh file that does what you want or runs the python program. Put it under macros. Ensure it is owned by www-data and has execution rights

Code: Select all

sudo chown www-data:www-data gpio.sh
sudo chmod 777 gpio.sh

yozza
Posts: 8
Joined: Sun Oct 28, 2012 9:07 pm

Re: RPi Cam Web Interface

Fri Nov 17, 2017 2:13 pm

btidey wrote:
Thu Nov 16, 2017 10:46 pm
yozza wrote:
Thu Nov 16, 2017 9:50 pm

thanks for your help on this I have managed to create the button but I had created my control functions as python scripts and tried to execute these from the on-click function with no success, I guess this means on_click has to have an html function to call. I have tried to create a php function but to date have failed, should I be embedding this function in index.php or creating a seperate php file. My two different styles of attempt are below, any help would be appreciated -
<div id="secondary-buttons" class="container-fluid text-center">
<input id="LEDon_button" type="button" value="IR LED on" onclick="IRled(1);" class="btn btn-primary">
<input id="LEDoff_button" type="button" value="IR LED off" onclick="/sbin/IRled.py(0);" class="btn btn-primary">
</div>
The button on_click function is executed within the client environment not at the server. It normally references a javascript function which can then send something to the server which in turn can then run commands like the python GPIO functions.

Probably the easiest way to do this is to utilise the existing client support for sending commands to the raspimjpeg process (send_cmd). One of these commands is 'sy macroname' which will execute an existing macro file stored in the web macros folder. Normally this will be bash scripts but they could run a python command.

So to summarise

1) In the button include something like onclick="send_cmd('sy gpio.sh')"

2) Create a gpio.sh file that does what you want or runs the python program. Put it under macros. Ensure it is owned by www-data and has execution rights

Code: Select all

sudo chown www-data:www-data gpio.sh
sudo chmod 777 gpio.sh
Thanks again for your help and apologies for not being able to resolve this myself. Have created the gpio.sh that does what I need, and initially tried to execute with an argument, the log file seemed to indicate it was executing but nothing happened, so I created separate gpio_on.sh and gpio_off.sh and again they appear to execute from the log but nothing happens. My GPIO commands require to be at elevated level, so I have sudo'ed them to ensure they execute. They all work from the command line, do you have any suggestions - I tried putting in test statements but didn't get anywhere with that .
$ tail scheduleLog.txt
{2017/11/17 13:24:17} Executing macro /var/www/html/macros/gpio.sh 0 &
{2017/11/17 13:24:19} Executing macro /var/www/html/macros/gpio.sh 1 &
{2017/11/17 13:24:20} Executing macro /var/www/html/macros/gpio.sh 0 &
[2017/11/17 13:50:43] Logged in user::
[2017/11/17 13:50:43] UserLevel 6
{2017/11/17 13:50:45} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:50:48} Executing macro /var/www/html/macros/gpio_off.sh &
{2017/11/17 13:50:50} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:55:12} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:55:14} Executing macro /var/www/html/macros/gpio_off.sh &
how can I prove these are executing?

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

Re: RPi Cam Web Interface

Sat Nov 18, 2017 9:43 am

yozza wrote:
Fri Nov 17, 2017 2:13 pm

Thanks again for your help and apologies for not being able to resolve this myself. Have created the gpio.sh that does what I need, and initially tried to execute with an argument, the log file seemed to indicate it was executing but nothing happened, so I created separate gpio_on.sh and gpio_off.sh and again they appear to execute from the log but nothing happens. My GPIO commands require to be at elevated level, so I have sudo'ed them to ensure they execute. They all work from the command line, do you have any suggestions - I tried putting in test statements but didn't get anywhere with that .
$ tail scheduleLog.txt
{2017/11/17 13:24:17} Executing macro /var/www/html/macros/gpio.sh 0 &
{2017/11/17 13:24:19} Executing macro /var/www/html/macros/gpio.sh 1 &
{2017/11/17 13:24:20} Executing macro /var/www/html/macros/gpio.sh 0 &
[2017/11/17 13:50:43] Logged in user::
[2017/11/17 13:50:43] UserLevel 6
{2017/11/17 13:50:45} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:50:48} Executing macro /var/www/html/macros/gpio_off.sh &
{2017/11/17 13:50:50} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:55:12} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:55:14} Executing macro /var/www/html/macros/gpio_off.sh &
how can I prove these are executing?
You can prove a macro is executing by putting something simple in it
like

Code: Select all

echo 'test' >> /var/www/html/macrotest.txt
Every time it executes it should put a new 'test' line in that file.

You can't do sudo commands from the macros normally. The www-data user doesn't have sudo permissions.

You probably have to add user www-data to the group that has gpio permissions.

Something like

Code: Select all

sudo usermod -a -G gpio www-data
If you need to do a specific sudo command then you can add that to /etc/sudoers.d/

yozza
Posts: 8
Joined: Sun Oct 28, 2012 9:07 pm

Re: RPi Cam Web Interface

Sat Nov 18, 2017 12:05 pm

btidey wrote:
Sat Nov 18, 2017 9:43 am
yozza wrote:
Fri Nov 17, 2017 2:13 pm

Thanks again for your help and apologies for not being able to resolve this myself. Have created the gpio.sh that does what I need, and initially tried to execute with an argument, the log file seemed to indicate it was executing but nothing happened, so I created separate gpio_on.sh and gpio_off.sh and again they appear to execute from the log but nothing happens. My GPIO commands require to be at elevated level, so I have sudo'ed them to ensure they execute. They all work from the command line, do you have any suggestions - I tried putting in test statements but didn't get anywhere with that .
$ tail scheduleLog.txt
{2017/11/17 13:24:17} Executing macro /var/www/html/macros/gpio.sh 0 &
{2017/11/17 13:24:19} Executing macro /var/www/html/macros/gpio.sh 1 &
{2017/11/17 13:24:20} Executing macro /var/www/html/macros/gpio.sh 0 &
[2017/11/17 13:50:43] Logged in user::
[2017/11/17 13:50:43] UserLevel 6
{2017/11/17 13:50:45} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:50:48} Executing macro /var/www/html/macros/gpio_off.sh &
{2017/11/17 13:50:50} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:55:12} Executing macro /var/www/html/macros/gpio_on.sh &
{2017/11/17 13:55:14} Executing macro /var/www/html/macros/gpio_off.sh &
how can I prove these are executing?
You can prove a macro is executing by putting something simple in it
like

Code: Select all

echo 'test' >> /var/www/html/macrotest.txt
Every time it executes it should put a new 'test' line in that file.

You can't do sudo commands from the macros normally. The www-data user doesn't have sudo permissions.

You probably have to add user www-data to the group that has gpio permissions.

Something like

Code: Select all

sudo usermod -a -G gpio www-data
If you need to do a specific sudo command then you can add that to /etc/sudoers.d/
Brilliant, thanks for your help and the great cam web interface you have developed.

As you pointed out it was a user group permission issue.

Thanks.

TorstenS
Posts: 4
Joined: Sun Nov 19, 2017 6:32 pm

Re: RPi Cam Web Interface

Sun Nov 19, 2017 6:35 pm

Small typo found in index.php, line 146.

old:

Code: Select all

$mTable .= "<input type='button' value='OK' onclick=" . '"send_macroUpdate' . "($m,'$macro')" . '";></TD></TR>';
fixed:

Code: Select all

$mTable .= "<input type='button' value='OK' onclick=" . '"send_macroUpdate' . "($m,'$macro')" . ';"></TD></TR>';

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

Re: RPi Cam Web Interface

Mon Nov 20, 2017 9:36 am

TorstenS wrote:
Sun Nov 19, 2017 6:35 pm
Small typo found in index.php, line 146.

old:

Code: Select all

$mTable .= "<input type='button' value='OK' onclick=" . '"send_macroUpdate' . "($m,'$macro')" . '";></TD></TR>';
fixed:

Code: Select all

$mTable .= "<input type='button' value='OK' onclick=" . '"send_macroUpdate' . "($m,'$macro')" . ';"></TD></TR>';
Thanks. Updated now with that corrected.

TorstenS
Posts: 4
Joined: Sun Nov 19, 2017 6:32 pm

Re: RPi Cam Web Interface

Mon Nov 20, 2017 7:25 pm

Hmm, still wrong in git. Please take a closer look at the " sign near end of the line as I wrote before.

Found some other issues and would like to ask first if its welcome to post some diffs to forum.

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

Re: RPi Cam Web Interface

Mon Nov 20, 2017 8:16 pm

TorstenS wrote:
Mon Nov 20, 2017 7:25 pm
Hmm, still wrong in git. Please take a closer look at the " sign near end of the line as I wrote before.

Found some other issues and would like to ask first if its welcome to post some diffs to forum.
Hopefully corrected OK now.

If you have other issues then you can raise issues in the git repositories which makes it easier to track, or if you have forked then you can submit pull requests directly

Web code and installers https://github.com/silvanmelchior/RPi_C ... ace/issues
raspimjpeg process code https://github.com/roberttidey/userland/issues

If they are of general interest and others can contribute then by all means raise them here.

TorstenS
Posts: 4
Joined: Sun Nov 19, 2017 6:32 pm

Re: RPi Cam Web Interface

Tue Nov 21, 2017 6:58 pm

Thanks for the links!

Not an git expert user here so i think its better not touching this but post diff only because there is not much:

Code: Select all

diff --git a/www/index.php b/www/index.php
index 78a06bb..8a6a61e 100644
--- a/www/index.php
+++ b/www/index.php
@@ -476,6 +476,7 @@
                            <td>MP4 Boxing mode :</td>
                            <td><select onchange="send_cmd('bo ' + this.value)"><?php makeOptions($options_bo, 'MP4Box'); ?></select></td>
                         </tr>
+			<tr>
                            <td>Watchdog, default interval 3s, errors 3</td>
                            <td>Interval <?php makeInput('watchdog_interval', 3); ?>s&nbsp;&nbsp;&nbsp;&nbsp;Errors <?php makeInput('watchdog_errors', 3); ?>
                            <input type="button" value="OK" onclick="send_cmd('wd ' + 10 * document.getElementById('watchdog_interval').value + ' ' + document.getElementById('watchdog_errors').value)">
diff --git a/www/uPresetsN-IMX219.html b/www/uPresetsN-IMX219.html
index bb309e2..0073549 100644
--- a/www/uPresetsN-IMX219.html
+++ b/www/uPresetsN-IMX219.html
@@ -1,6 +1,6 @@
 <option value="1920 1080 30 30 3280 2464">Select option...</option>
 <option value="1920 1080 30 30 3280 2464">N-IMX219-30fps-Full HD 1080p 16:9</option>
-<option value="3280 2464 15 3280 2464">N-IMX219-15fps-Full Chip 2959 X 1944 4:3</option>
+<option value="3280 2464 15 15 3280 2464">N-IMX219-15fps-Full Chip 2959 X 1944 4:3</option>
 <option value="1640 1232 40 40 3280 2464">N-IMX219-40fps-Max View 1640 X 1232 4:3</option>
 <option value="1640 922 40 40 3280 2464">N-IMX219-40fps-Max View 1640 X 922 16:9</option>
 <option value="1280 720 90 90 3280 2464">N-IMX219-90fps-HD 720p 16:9</option>
diff --git a/www/uPresetsP-IMX219.html b/www/uPresetsP-IMX219.html
index be7242d..476e911 100644
--- a/www/uPresetsP-IMX219.html
+++ b/www/uPresetsP-IMX219.html
@@ -1,6 +1,6 @@
 <option value="1920 1080 25 25 3280 2464">Select option...</option>
 <option value="1920 1080 25 25 3280 2464">N-IMX219-30fps-Full HD 1080p 16:9</option>
-<option value="3280 2464 15 3280 2464">N-IMX219-15fps-Full Chip 2959 X 1944 4:3</option>
+<option value="3280 2464 15 15 3280 2464">N-IMX219-15fps-Full Chip 2959 X 1944 4:3</option>
 <option value="1640 1232 40 40 3280 2464">N-IMX219-40fps-Max View 1640 X 1232 4:3</option>
 <option value="1640 922 40 40 3280 2464">N-IMX219-40fps-Max View 1640 X 922 16:9</option>
 <option value="1280 720 90 90 3280 2464">N-IMX219-90fps-HD 720p 16:9</option>
Hope this helps.

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

Re: RPi Cam Web Interface

Tue Nov 21, 2017 9:39 pm

TorstenS wrote:
Tue Nov 21, 2017 6:58 pm
Thanks for the links!

Not an git expert user here so i think its better not touching this but post diff only because there is not much:

Hope this helps.
Thanks for those. I have updated the git

TorstenS
Posts: 4
Joined: Sun Nov 19, 2017 6:32 pm

Re: RPi Cam Web Interface

Fri Nov 24, 2017 8:23 pm

found again small typos

Code: Select all

diff --git a/www/uPresetsP-IMX219.html b/www/uPresetsP-IMX219.html
index 476e911..1610690 100644
--- a/www/uPresetsP-IMX219.html
+++ b/www/uPresetsP-IMX219.html
@@ -1,10 +1,10 @@
 <option value="1920 1080 25 25 3280 2464">Select option...</option>
-<option value="1920 1080 25 25 3280 2464">N-IMX219-30fps-Full HD 1080p 16:9</option>
-<option value="3280 2464 15 15 3280 2464">N-IMX219-15fps-Full Chip 2959 X 1944 4:3</option>
-<option value="1640 1232 40 40 3280 2464">N-IMX219-40fps-Max View 1640 X 1232 4:3</option>
-<option value="1640 922 40 40 3280 2464">N-IMX219-40fps-Max View 1640 X 922 16:9</option>
-<option value="1280 720 90 90 3280 2464">N-IMX219-90fps-HD 720p 16:9</option>
-<option value="640 480 90 90 3280 2464">N-IMX219-90fps-SD TV 640p 4:3</option>
+<option value="1920 1080 25 25 3280 2464">P-IMX219-25fps-Full HD 1080p 16:9</option>
+<option value="3280 2464 15 15 3280 2464">P-IMX219-15fps-Full Chip 2959 X 1944 4:3</option>
+<option value="1640 1232 40 40 3280 2464">P-IMX219-40fps-Max View 1640 X 1232 4:3</option>
+<option value="1640 922 40 40 3280 2464">P-IMX219-40fps-Max View 1640 X 922 16:9</option>
+<option value="1280 720 90 90 3280 2464">P-IMX219-90fps-HD 720p 16:9</option>
+<option value="640 480 90 90 3280 2464">P-IMX219-90fps-SD TV 640p 4:3</option>
 <option value="1920 1080 01 30 3280 2464">Full HD Timelapse (x30) 1080p 16:9</option>

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

Re: RPi Cam Web Interface

Tue Nov 28, 2017 10:09 am

TorstenS wrote:
Fri Nov 24, 2017 8:23 pm
found again small typos
Thanks. Repository now updated with those corrections

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

Re: RPi Cam Web Interface

Tue Nov 28, 2017 5:00 pm

User buttons

I have added a facility to the main web page to add up to 6 user buttons

This is controlled by a userbuttons file in the main web install folder (e.g. /var/www/html). If the file does not exist then the page displays without any extra buttons. If the file does exist then it can contain the definitions for up to 6 user buttons,

The file is just a text file and contains definition lines which are just

Code: Select all

buttonName,macroname.sh
Give the buttons what names you want and associate them with the macro you want executed when the button is pushed.
When a button is pressed then the corresponding macro is executed.

An example config file is included as userbuttonsD. If that is moved to userbuttons then 2 default buttons will be included
userbuttons.jpg
userbuttons.jpg (11.02 KiB) Viewed 927 times
A typical use would be to allow control of GPIO for activities related to the camera.

ruder
Posts: 7
Joined: Sat Nov 18, 2017 3:48 pm
Location: Rajkot,Gujarat,India.
Contact: Facebook Twitter

Re: RPi Cam Web Interface

Wed Nov 29, 2017 8:17 am

hello everyone, I want to make custom webpage but could not edit index.php file, plz guide me how to edit that webpage, thnx.
-imtiyaz

CharlyDelta
Posts: 44
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Wed Nov 29, 2017 3:14 pm

btidey wrote:
Tue Nov 28, 2017 5:00 pm
User buttons

I have added a facility to the main web page to add up to 6 user buttons

This is controlled by a userbuttons file in the main web install folder (e.g. /var/www/html). If the file does not exist then the page displays without any extra buttons. If the file does exist then it can contain the definitions for up to 6 user buttons,

The file is just a text file and contains definition lines which are just

Code: Select all

buttonName,macroname.sh
Give the buttons what names you want and associate them with the macro you want executed when the button is pushed.
When a button is pressed then the corresponding macro is executed.

An example config file is included as userbuttonsD. If that is moved to userbuttons then 2 default buttons will be included
userbuttons.jpg

A typical use would be to allow control of GPIO for activities related to the camera.
The file exist at the right place but I can't get the two extra buttons.

Code: Select all

#User buttons definitions
#maximum of six buttons
#buttonname, macro
button1,button1.sh
button2,button2.sh

Thanks for your help.

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

Re: RPi Cam Web Interface

Wed Nov 29, 2017 10:01 pm

CharlyDelta wrote:
Wed Nov 29, 2017 3:14 pm
btidey wrote:
Tue Nov 28, 2017 5:00 pm
User buttons

I have added a facility to the main web page to add up to 6 user buttons
The file exist at the right place but I can't get the two extra buttons.

Code: Select all

#User buttons definitions
#maximum of six buttons
#buttonname, macro
button1,button1.sh
button2,button2.sh

Thanks for your help.
Hmm. Looks like the index.php file with userbuttons code didn't get uploaded to git. Not sure how that happened as the other files that were changed went up OK.

Try it now.

Sorry for that.

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

Re: RPi Cam Web Interface

Wed Nov 29, 2017 10:12 pm

ruder wrote:
Wed Nov 29, 2017 8:17 am
hello everyone, I want to make custom webpage but could not edit index.php file, plz guide me how to edit that webpage, thnx.
-imtiyaz
To physically change the index.php you need to make any changes to the run time one that gets installed e.g. /var/www/html/index.php not the one that is in the installer directory (that one is just copied during the installation process).

It can be edited with a standard text editor like nano on the raspberry. I normally make changes to the file on a PC and then copy it across to my test Pi using winscp and putty.

If you mean how do you change it for some specific functionality or look that you want to achieve then please say what you are trying to do.

alberto.tagliavini
Posts: 7
Joined: Mon Mar 14, 2016 1:28 pm

Re: RPi Cam Web Interface

Thu Nov 30, 2017 8:34 am

Hello,
i need your help to understand how to have this configuration:
[*] all day time-lapse
[*] auto-restart the time-lapse when the raspberry startup
[*] split the images in groups of 10 minutes each (i need to use AutoCapture_Interval option to do this?)
[*] auto purge the oldest images if the min space is less then 10% ( i have set PurgeSpace_ModeEx = "Min Space %" and PurgeSpace_Level = 5 but it doesn't work)

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

Re: RPi Cam Web Interface

Thu Nov 30, 2017 9:46 am

alberto.tagliavini wrote:
Thu Nov 30, 2017 8:34 am
Hello,
i need your help to understand how to have this configuration:
[*] all day time-lapse
[*] auto-restart the time-lapse when the raspberry startup
[*] split the images in groups of 10 minutes each (i need to use AutoCapture_Interval option to do this?)
[*] auto purge the oldest images if the min space is less then 10% ( i have set PurgeSpace_ModeEx = "Min Space %" and PurgeSpace_Level = 5 but it doesn't work)
First when the system starts up then it will execute any command put into the Period Start for the relevant period. In All day mode there is only one period start entry so any command there will get executed.

Autocapture_Interval and Max_Capture allow one to achieve various effects. Autocapture_Interval simulates a motion start command at the period determined so if that is set to 600 then whatever is in the motion start field will get executed every 10 minutes. Maximum_captures simulates a motion stop command after that time. So if set to 590 then the stop command will get executed.

So by putting tl 1 in the Motion Start and tl 0 in the motion stop then a new time lapse will be started every 10 minutes and stopped just before the next one is due to start. Make sure there is a little gap between the two.

I think autopurge is working. Note that purging is only done at the management interval (default 1 hour). You should see entries in the scheduler log when a management interval happens and the counto ffiles purged if any.

alberto.tagliavini
Posts: 7
Joined: Mon Mar 14, 2016 1:28 pm

Re: RPi Cam Web Interface

Thu Nov 30, 2017 3:30 pm

btidey wrote:
Thu Nov 30, 2017 9:46 am
alberto.tagliavini wrote:
Thu Nov 30, 2017 8:34 am
Hello,
i need your help to understand how to have this configuration:
[*] all day time-lapse
[*] auto-restart the time-lapse when the raspberry startup
[*] split the images in groups of 10 minutes each (i need to use AutoCapture_Interval option to do this?)
[*] auto purge the oldest images if the min space is less then 10% ( i have set PurgeSpace_ModeEx = "Min Space %" and PurgeSpace_Level = 5 but it doesn't work)
First when the system starts up then it will execute any command put into the Period Start for the relevant period. In All day mode there is only one period start entry so any command there will get executed.

Autocapture_Interval and Max_Capture allow one to achieve various effects. Autocapture_Interval simulates a motion start command at the period determined so if that is set to 600 then whatever is in the motion start field will get executed every 10 minutes. Maximum_captures simulates a motion stop command after that time. So if set to 590 then the stop command will get executed.

So by putting tl 1 in the Motion Start and tl 0 in the motion stop then a new time lapse will be started every 10 minutes and stopped just before the next one is due to start. Make sure there is a little gap between the two.

I think autopurge is working. Note that purging is only done at the management interval (default 1 hour). You should see entries in the scheduler log when a management interval happens and the counto ffiles purged if any.
Thanks for your reply.
I've seen that putting tl 1 in the Motion Start and tl 0 in the motion stop then a new time lapse will be started every 10 minutes can be a problem if i have subfolders by day and hour to save the images. Because i cannot see in the download page the files created in the second folder. For example if i start the timelapse at 3:50 i can see in the download page only the files up to 4 because at 4 it changes subfolder. I cannot see the following files.

ruder
Posts: 7
Joined: Sat Nov 18, 2017 3:48 pm
Location: Rajkot,Gujarat,India.
Contact: Facebook Twitter

Re: RPi Cam Web Interface

Thu Nov 30, 2017 5:18 pm

btidey wrote:
Wed Nov 29, 2017 10:12 pm
ruder wrote:
Wed Nov 29, 2017 8:17 am
hello everyone, I want to make custom webpage but could not edit index.php file, plz guide me how to edit that webpage, thnx.
-imtiyaz
To physically change the index.php you need to make any changes to the run time one that gets installed e.g. /var/www/html/index.php not the one that is in the installer directory (that one is just copied during the installation process).

It can be edited with a standard text editor like nano on the raspberry. I normally make changes to the file on a PC and then copy it across to my test Pi using winscp and putty.

If you mean how do you change it for some specific functionality or look that you want to achieve then please say what you are trying to do.
Actually i want to remove some buttons like, timelapse ,motion detection, edit motion setting and edit schedual setting. but could not find the exact file where the require the changes.

btidey....thanks for reply :)

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 21 guests