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

Re: RPi Cam Web Interface

Mon Aug 01, 2016 9:00 pm

noxx wrote:hello

how can i change the path for the video images and pictures?

regard
There are separate path settings for video, images and time lapse in the /etc/raspimjpeg config file.

These allow changing the naming scheme of the files and separating out into sub-folders and even including date parameters for these sub-folders.

If you change the 'root' from the media folder in the web install then you also have to change that setting in the web side config.php.

Instead use standard linux link/bind (fstab) facilities to 'relocate these to onto other locations like USB sticks, disk drives and network storage locations. When you do that bear in mind the linked location must have read/write permissions for user www-data

I recommend using doing it that way and leaving the logical location root location as media under the web install as this avoids having to change the web side config and also means that if the software is upgraded then nothing else needs to change each time.

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Tue Aug 02, 2016 9:10 am

ok, thx. im a small linux noob, is there a guide for what i must do (fstab)?

another question:
i had installed according this guide:

Code: Select all

git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
chmod u+x *.sh
./install.sh
with nginx

after reboot and open the webpage, i get this in the motion settings:
Motion not running. Put in detection state

i use a raspi2 and 2016-05-27-raspbian-jessie.img (3,74GB)

regard

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

Re: RPi Cam Web Interface

Tue Aug 02, 2016 9:38 am

noxx wrote:ok, thx. im a small linux noob, is there a guide for what i must do (fstab)?

another question:
i had installed according this guide:

Code: Select all

git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
chmod u+x *.sh
./install.sh
with nginx

after reboot and open the webpage, i get this in the motion settings:
Motion not running. Put in detection state

i use a raspi2 and 2016-05-27-raspbian-jessie.img (3,74GB)

regard
Motion: That is normal when you use the external motion detection mechanism. The settings for this are accessed via a web interface that the motion process supports. This is only available when the motion process is actually running (when motion detection is turned on). Internal motion detection uses a vector feed from the camera system and does not use the external motion process at all. It has separate settings available from the main page when internal motion detection is selected (under camera settings).

There is a lot of info around on how to use fstab to mount devices or folders. E.g. http://www.raspberrypi-spy.co.uk/2014/0 ... pberry-pi/

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Tue Aug 02, 2016 1:19 pm

ok, i will try it :)

perhaps a feature request: possibility to change the media path in the web-gui

regard

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Tue Aug 02, 2016 2:31 pm

before i press the OK-Button to save my conf:

i mount my usb-stick via fstab to /media/usbstick

now i must change the raspimjpeg from:
]# File Locations
#
# preview path: add %d for number
# image+video path: add %d for number, year, month, day, hour, minute, second
# macros_path can be used to store macros executed by sy command
# boxing_path if set is where h264 files will be temporarily stored when boxing used
# image, video and lapse may be configured relative to media_path if first / left out
base_path /var/www/html
preview_path /dev/shm/mjpeg/cam.jpg
image_path /var/www/html/media/im_%i_%Y%M%D_%h%m%s.jpg
lapse_path /var/www/html/media/tl_%i_%t_%Y%M%D_%h%m%s.jpg
video_path /var/www/html/media/vi_%v_%Y%M%D_%h%m%s.mp4
status_file /dev/shm/mjpeg/status_mjpeg.txt
control_file /var/www/html/FIFO
media_path /var/www/html/media
macros_path /var/www/html/macros
user_annotate /dev/shm/mjpeg/user_annotate.txt
boxing_path
subdir_char @

to
# File Locations
#
# preview path: add %d for number
# image+video path: add %d for number, year, month, day, hour, minute, second
# macros_path can be used to store macros executed by sy command
# boxing_path if set is where h264 files will be temporarily stored when boxing used
# image, video and lapse may be configured relative to media_path if first / left out
base_path /var/www/html
preview_path /dev/shm/mjpeg/cam.jpg
image_path /media/usbstick/im_%i_%Y%M%D_%h%m%s.jpg
lapse_path /media/usbstick/tl_%i_%t_%Y%M%D_%h%m%s.jpg
video_path /media/usbstick/vi_%v_%Y%M%D_%h%m%s.mp4

status_file /dev/shm/mjpeg/status_mjpeg.txt
control_file /var/www/html/FIFO
media_path /var/www/html/media
macros_path /var/www/html/macros
user_annotate /dev/shm/mjpeg/user_annotate.txt
boxing_path
subdir_char @
?

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

Re: RPi Cam Web Interface

Tue Aug 02, 2016 4:00 pm

noxx wrote:before i press the OK-Button to save my conf:

i mount my usb-stick via fstab to /media/usbstick

now i must change the raspimjpeg from:
]# File Locations
#
# preview path: add %d for number
# image+video path: add %d for number, year, month, day, hour, minute, second
# macros_path can be used to store macros executed by sy command
# boxing_path if set is where h264 files will be temporarily stored when boxing used
# image, video and lapse may be configured relative to media_path if first / left out
base_path /var/www/html
preview_path /dev/shm/mjpeg/cam.jpg
image_path /var/www/html/media/im_%i_%Y%M%D_%h%m%s.jpg
lapse_path /var/www/html/media/tl_%i_%t_%Y%M%D_%h%m%s.jpg
video_path /var/www/html/media/vi_%v_%Y%M%D_%h%m%s.mp4
status_file /dev/shm/mjpeg/status_mjpeg.txt
control_file /var/www/html/FIFO
media_path /var/www/html/media
macros_path /var/www/html/macros
user_annotate /dev/shm/mjpeg/user_annotate.txt
boxing_path
subdir_char @

to
# File Locations
#
# preview path: add %d for number
# image+video path: add %d for number, year, month, day, hour, minute, second
# macros_path can be used to store macros executed by sy command
# boxing_path if set is where h264 files will be temporarily stored when boxing used
# image, video and lapse may be configured relative to media_path if first / left out
base_path /var/www/html
preview_path /dev/shm/mjpeg/cam.jpg
image_path /media/usbstick/im_%i_%Y%M%D_%h%m%s.jpg
lapse_path /media/usbstick/tl_%i_%t_%Y%M%D_%h%m%s.jpg
video_path /media/usbstick/vi_%v_%Y%M%D_%h%m%s.mp4

status_file /dev/shm/mjpeg/status_mjpeg.txt
control_file /var/www/html/FIFO
media_path /var/www/html/media
macros_path /var/www/html/macros
user_annotate /dev/shm/mjpeg/user_annotate.txt
boxing_path
subdir_char @
?
No don't change the raspimjpeg paths; leave them as /var/www/html/media

Change the fstab to mount the usbstick at /var/www/html/media. That way the camera system thinks the files are still at their normal location but in reality the files are on the usb stick.

One of the reasons why I have not put path changing support on the web interface is that it potentially introduces some security hazards.

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Tue Aug 02, 2016 6:16 pm

thanks.... works fine.

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Tue Aug 02, 2016 8:27 pm

btidey wrote: Motion: That is normal when you use the external motion detection mechanism. The settings for this are accessed via a web interface that the motion process supports. This is only available when the motion process is actually running (when motion detection is turned on). Internal motion detection uses a vector feed from the camera system and does not use the external motion process at all. It has separate settings available from the main page when internal motion detection is selected (under camera settings).

There is a lot of info around on how to use fstab to mount devices or folders. E.g. http://www.raspberrypi-spy.co.uk/2014/0 ... pberry-pi/
thx... works

i try also the internal motion, but the CAM-Tool dont record a video. with external works it.
Attachments
internal_motion.png
internal_motion.png (13.44 KiB) Viewed 5531 times

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

Re: RPi Cam Web Interface

Tue Aug 02, 2016 8:53 pm

noxx wrote:
btidey wrote: Motion: That is normal when you use the external motion detection mechanism. The settings for this are accessed via a web interface that the motion process supports. This is only available when the motion process is actually running (when motion detection is turned on). Internal motion detection uses a vector feed from the camera system and does not use the external motion process at all. It has separate settings available from the main page when internal motion detection is selected (under camera settings).

There is a lot of info around on how to use fstab to mount devices or folders. E.g. http://www.raspberrypi-spy.co.uk/2014/0 ... pberry-pi/
thx... works

i try also the internal motion, but the CAM-Tool dont record a video. with external works it.
Default noise level for internal motion detection is 1010. I know the comment says 1-255 but ignore that. Internal motion detection has 2 different algorithms and the better one is triggered by a noise level setting of > 1000 (as per wiki).

You can see what is going on with internal motion detection by including %c and %f in the annotation string. %c will show the filtered changes occurring by frames. When this is above the threshold value then the change frame counter increments (%f) and when this exceeds the start frame count then a capture is triggered. Lower the value of the threshold to increase the sensitivity to small changes.

RichATX
Posts: 1
Joined: Thu Aug 04, 2016 12:46 am

Re: RPi Cam Web Interface

Thu Aug 04, 2016 12:51 am

Howdy!

I assuming my camera is busted as I tried a different cable, but has anyone had this happen:

I get weird colors on horizontal lines/banding.

For a while it was only happening on video, but now it's on still pics too.

I guess I could force myself to order another Pi just to be sure it's not software related ;)

Image

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

Re: RPi Cam Web Interface

Thu Aug 04, 2016 10:31 am

RichATX wrote:Howdy!

I assuming my camera is busted as I tried a different cable, but has anyone had this happen:

I get weird colors on horizontal lines/banding.

For a while it was only happening on video, but now it's on still pics too.

I guess I could force myself to order another Pi just to be sure it's not software related ;)
Sounds like a hardware issue of some sort. To double check you could do a raspivid or raspistill on a clean Raspbian camera enabled image.

Worth checking all the interconnects including the little SUNNY cable on the camera module itself (Press it down). A separate Pi would allow tracing it down further to being at the camera end or Pi end.

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: RPi Cam Web Interface

Thu Aug 04, 2016 3:18 pm

Hello @all,
I'm still using an old "RPi Cam Control v6.0.1", in combination with lighttpd as webserver.
Therefore I modified the script "RPi_Cam_Web_Interface_Installer.sh", mainly disabling the "apt-get install" for apache.

Now I would like to update to the new version.
So I have to use and modify the new "install.sh" procedure, but there are only the options Apache2 and Nginx.

Did someone modify the files 'install.sh' and 'RPi_Cam_Web_Interface_Installer.sh' for usage with lighttpd ?
or how/where should I modify these script files?

Many thanks in advance for every hint!

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Thu Aug 04, 2016 3:38 pm

is it possible to overlay the mask (*.pgm file) and videofile on the webgui?
i want see, that my created pgm file is right

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

Re: RPi Cam Web Interface

Thu Aug 04, 2016 4:49 pm

noxx wrote:is it possible to overlay the mask (*.pgm file) and videofile on the webgui?
i want see, that my created pgm file is right
There is no direct facility to do that moment on the web interface although I have been thinking about how to make the mask generation easier.

What I have done up to now is to grab an image from the camera (at video resolution) and then process it in a photo-editor. This involved reducing resolution down to size of the mask, drawing an outline round the required masking area and then using a flood fill tool to make the areas black and white. Then saving as a pgm file.

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

Re: RPi Cam Web Interface

Thu Aug 04, 2016 5:11 pm

thsBavR10 wrote:Hello @all,
I'm still using an old "RPi Cam Control v6.0.1", in combination with lighttpd as webserver.
Therefore I modified the script "RPi_Cam_Web_Interface_Installer.sh", mainly disabling the "apt-get install" for apache.

Now I would like to update to the new version.
So I have to use and modify the new "install.sh" procedure, but there are only the options Apache2 and Nginx.

Did someone modify the files 'install.sh' and 'RPi_Cam_Web_Interface_Installer.sh' for usage with lighttpd ?
or how/where should I modify these script files?

Many thanks in advance for every hint!
I haven't done any work with lighttpd but it shouldn't be too bad as the web site rquirements and changes are fairly modest. If we can work out the manual changes needed then I'd see if this can be added to install.sh as a etxra web server option.

I think I would start off by taking install.sh and modifying it to remove the web server part of the install

Round about line 309 there is code like

Code: Select all

if [ "$webserver" == "apache" ]; then
   sudo apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 gpac motion zip libav-tools gstreamer1.0-tools
   fn_apache
else
   sudo apt-get install -y nginx php5-fpm php5-cli php5-common php-apc apache2-utils gpac motion zip libav-tools gstreamer1.0-tools
   fn_nginx
fi

Change that to

Code: Select all

if [ "$webserver" == "apache" ]; then
   sudo apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 gpac motion zip libav-tools gstreamer1.0-tools
   fn_apache
elif [ "$webserver" == "nginx" ]; then
   sudo apt-get install -y nginx php5-fpm php5-cli php5-common php-apc apache2-utils gpac motion zip libav-tools gstreamer1.0-tools
   fn_nginx
elif  [ "$webserver" == "lighttpd" ]; then
   sudo apt-get install -y  gpac motion zip libav-tools gstreamer1.0-tools
#   fn_lighttpd
fi


If run with lightpd then it would install except for the web server and modify its settings.

The right stuff must now be added to the apt-get to add lighttpd, php5 and tie php5 into lighttpd

fn_lighttpd doesn't exist but is commented out for the moment. It has to have the stuff in to edit the lighttpd config to match the install. If this is worked out by directly editng the lighttpd config files then the editing instructions can be put into the fn_lighttpd function.

The changes would need to set up a web site root to match the install folder, set up the port to match the install port and set up user and password access if required.

Edit:

Code: Select all

if [ "$webserver" == "apache" ]; then
   sudo apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 gpac motion zip libav-tools gstreamer1.0-tools
   fn_apache
elif [ "$webserver" == "nginx" ]; then
   sudo apt-get install -y nginx php5-fpm php5-cli php5-common php-apc apache2-utils gpac motion zip libav-tools gstreamer1.0-tools
   fn_nginx
elif  [ "$webserver" == "lighttpd" ]; then
   sudo apt-get install -y  lighttpd php5-cli php5-common php5-cgi php5 gpac motion zip libav-tools gstreamer1.0-tools
#   fn_lighttpd
fi


should do the basic lighttpd php5 install.

I think then that
sudo lighty-enable-mod fastcgi-php
is needed. This can be put in fn_lighttpd when that is done.

I think that lighttpd defaults to /var/www so if subfolder is blanked out, and no user/password is used in the install then this might give a starting point for an operational system

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Thu Aug 04, 2016 7:19 pm

btidey wrote:
noxx wrote:is it possible to overlay the mask (*.pgm file) and videofile on the webgui?
i want see, that my created pgm file is right
There is no direct facility to do that moment on the web interface although I have been thinking about how to make the mask generation easier.

What I have done up to now is to grab an image from the camera (at video resolution) and then process it in a photo-editor. This involved reducing resolution down to size of the mask, drawing an outline round the required masking area and then using a flood fill tool to make the areas black and white. Then saving as a pgm file.
thx. my video-picture has 1920x780, my pgm 121x68.
i create a jpg file and convert this with IrfanView to *.pgm
hope this work.

perhaps in a future release its easier like in
www.kerberos.io (create a mask in the webgui)

thx for you fast help....

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: RPi Cam Web Interface

Thu Aug 04, 2016 8:22 pm

btidey wrote:
I haven't done any work with lighttpd but it shouldn't be too bad as the web site rquirements and changes are fairly modest. If we can work out the manual changes needed then I'd see if this can be added to install.sh as a etxra web server option.

I think I would start off by taking install.sh and modifying it to remove the web server part of the install
..

If run with lightpd then it would install except for the web server and modify its settings.

The right stuff must now be added to the apt-get to add lighttpd, php5 and tie php5 into lighttpd

fn_lighttpd doesn't exist but is commented out for the moment. It has to have the stuff in to edit the lighttpd config to match the install. If this is worked out by directly editng the lighttpd config files then the editing instructions can be put into the fn_lighttpd function.

The changes would need to set up a web site root to match the install folder, set up the port to match the install port and set up user and password access if required.

Edit:

Code: Select all

if [ "$webserver" == "apache" ]; then
   sudo apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 gpac motion zip libav-tools gstreamer1.0-tools
   fn_apache
elif [ "$webserver" == "nginx" ]; then
   sudo apt-get install -y nginx php5-fpm php5-cli php5-common php-apc apache2-utils gpac motion zip libav-tools gstreamer1.0-tools
   fn_nginx
elif  [ "$webserver" == "lighttpd" ]; then
   sudo apt-get install -y  lighttpd php5-cli php5-common php5-cgi php5 gpac motion zip libav-tools gstreamer1.0-tools
#   fn_lighttpd
fi


should do the basic lighttpd php5 install.

I think then that
sudo lighty-enable-mod fastcgi-php
is needed. This can be put in fn_lighttpd when that is done.

I think that lighttpd defaults to /var/www so if subfolder is blanked out, and no user/password is used in the install then this might give a starting point for an operational system
Many thanks for your very quick answer!
I'll try your proposed changes and report the success.

Thomas

dennyfmn
Posts: 27
Joined: Thu Aug 16, 2012 1:36 pm

Random Timelapse Stalls and Stops

Thu Aug 04, 2016 10:20 pm

I gave been trying to troubleshoot this problem through several versions of the Rpi Cam Web Interface. What I see are random stalls and stops while doing timelapses. Back in the 6.0 series, the buttons for timelapse would stay greyed out until you restarted the camera. The 6.2 series now times out after about 85 seconda or so, returns the buttons on the web page to active, and stops recording timelape frames. The preview images continue to be updated in real time.

I'm currently running Rpi Cam Web Interface 6.2.10 on this system with nginx.

Model: Model B+ - 700 MHz 512MB
Version: 8.0 Jessie

Kernel: Linux mypi8wifi 4.4.13+ #894 Mon Jun 13 12:43:26 BST 2016 armv6l GNU/Linux

In order to separate any web client/server issues from the problem, I have been running the system completely from the command line, never even connecting to the web server with a browser. The nginx log has not been written to since 7/25. All the troubleshooting is being done using ssh sessions.

I have set up timelapse recording at a frame rate of every 2 seconds. It doesn't seem to matter what the exact time is used, but the stalls seem like a random thing that happens. The more frames you take, the greater the chance that it will stall. The odd thing is that it can record up to the maximum frame count of 9999 and never stop. But, randomly it can quit at any time.

I am writing my timelapse frames to a 16GB USB Thumb drive. In order to do timelapse without ever using a web client or connecting to the web server, I do everything from the command line.

at the bottom of /etc/rc.local

Code: Select all

# Mount the USB drive
mount /pics
sleep 2

# This section is to document the settings that are used with timelapse control
mount --bind /pics/test /var/www/html/media

#START RASPIMJPEG SECTION
mkdir -p /dev/shm/mjpeg
chown www-data:www-data /dev/shm/mjpeg
chmod 777 /dev/shm/mjpeg
sleep 4;su -c 'raspimjpeg > /dev/null 2>&1 &' www-data
if [ -e /etc/debian_version ]; then
  sleep 4;su -c 'php /var/www/html/schedule.php > /dev/null 2>&1 &' www-data
else
  sleep 4;su -s '/bin/bash' -c 'php /var/www/html/schedule.php > /dev/null 2>&1 &' www-data
fi
#END RASPIMJPEG SECTION

# Start timelapse
sleep 5
echo 'tl 1' > /var/www/html/FIFO11
I wrote a little script that monitors the status file every .25 seconds and logs the status with a timestamp.

cat logstatus.sh

Code: Select all

#!/bin/bash

echo "logging status to /pics/status.txt. Type ^C to exit."

while true
do
 now=`date +'%Y%m%d %H:%M:%S'`
 result=`cat status_mjpeg.txt`
 echo $now - $result >> /pics/status.txt
 sleep .25
done
On 8/2 after recording all 9999 frames without stopping, after clearling out the media directory and restarting timelapse with:

echo 'tl 1' > /var/www/html/FIFO11 (yes, I am using the new FIFO)

it stopped after recording only 22 frames.

Here are the contents of the log file (snipped).

After frame 22, Status stayed at "image" for 86 sec then went to "ready".

20160802 08:06:13 - image
20160802 08:06:13 - timelapse
20160802 08:06:14 - timelapse
20160802 08:06:14 - timelapse
20160802 08:06:14 - timelapse
20160802 08:06:14 - timelapse
20160802 08:06:15 - timelapse
20160802 08:06:15 - image
20160802 08:06:15 - timelapse
20160802 08:06:16 - timelapse
20160802 08:06:16 - timelapse
20160802 08:06:16 - timelapse
20160802 08:06:17 - timelapse
20160802 08:06:17 - timelapse
20160802 08:06:17 - timelapse
20160802 08:06:17 - image
20160802 08:06:18 - image
20160802 08:06:18 - image
20160802 08:06:18 - image
... snip ...
20160802 08:07:42 - image
20160802 08:07:42 - image
20160802 08:07:42 - image
20160802 08:07:42 - image
20160802 08:07:43 - ready
20160802 08:07:43 - ready
20160802 08:07:43 - ready
20160802 08:07:44 - ready
20160802 08:07:44 - ready
20160802 08:07:44 - ready


Since there is no interaction with a web client, it would seem that this is an issue with raspimjpeg getting out of sync with something.

A few examples I have seen: stalls and stops at 73, 1747, 8412, 7765 frames.

I'm setting up a battery powered, headless timelapse recorder that I can control with pushbutton presses, disconnected from any network. I'd like to resolve the issues with random failures to record.

If the root cause of the problem can't be fixed, I would like to see raspimjpeg return to the "timelapse" mode after a timeout, rather then just going "ready". I would rather loose a few frames than have it stop recording. I have looked at the source for raspimjpeg, but figuring out where the issue lies is beyond my capability.

I think the RPi Camera Web Interface is very cool software. It would really be great to see this wrinkle get ironed out.

Thanks for any help that can be offered!

Denny

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: RPi Cam Web Interface

Fri Aug 05, 2016 5:48 am

thsBavR10 wrote:
btidey wrote:
I haven't done any work with lighttpd but it shouldn't be too bad as the web site rquirements and changes are fairly modest. If we can work out the manual changes needed then I'd see if this can be added to install.sh as a etxra web server option.

I think I would start off by taking install.sh and modifying it to remove the web server part of the install
..

If run with lightpd then it would install except for the web server and modify its settings.

The right stuff must now be added to the apt-get to add lighttpd, php5 and tie php5 into lighttpd

fn_lighttpd doesn't exist but is commented out for the moment. It has to have the stuff in to edit the lighttpd config to match the install. If this is worked out by directly editng the lighttpd config files then the editing instructions can be put into the fn_lighttpd function.

The changes would need to set up a web site root to match the install folder, set up the port to match the install port and set up user and password access if required.

Edit:

Code: Select all

if [ "$webserver" == "apache" ]; then
   sudo apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 gpac motion zip libav-tools gstreamer1.0-tools
   fn_apache
elif [ "$webserver" == "nginx" ]; then
   sudo apt-get install -y nginx php5-fpm php5-cli php5-common php-apc apache2-utils gpac motion zip libav-tools gstreamer1.0-tools
   fn_nginx
elif  [ "$webserver" == "lighttpd" ]; then
   sudo apt-get install -y  lighttpd php5-cli php5-common php5-cgi php5 gpac motion zip libav-tools gstreamer1.0-tools
#   fn_lighttpd
fi


should do the basic lighttpd php5 install.

I think then that sudo lighty-enable-mod fastcgi-php is needed. This can be put in fn_lighttpd when that is done.

I think that lighttpd defaults to /var/www so if subfolder is blanked out, and no user/password is used in the install then this might give a starting point for an operational system
Many thanks for your very quick answer!
I'll try your proposed changes and report the success.

Thomas
Edit:
It's working fine, with this changes. You did a great job!
There could be an small mod to line 87, within the dialog, adding lighty/lighttpd to the possible servers.

Code: Select all

  " Server:(apache/nginx/lighttpd)" 3 1   "$webserver"   3 32 15 0  \ 

I assume the trailing numbers have to be changed.

Creating the missing subroutine 'fn_lighttpd' from scratch is beyond my skills ;-), but I can help in testing your suggestions. '15-fastcgi-php.conf ' is existing within /etc/lighttpd/conf-enabled/

The only small difference to the "old" behaviour is, that I have to reload the page after starting/stopping the camera.
Maybe an future enhancement could be auto-detecting exisitng webservers.

Great job, btidey!

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Fri Aug 05, 2016 3:50 pm

hello

is it possible to add a auto-restart if RPI CAM CONTROLL crashed?

regard


Error in RaspiMPEG:
Restart RaspiMPEG (./RPI_CAM_WEB_Interface.sh start) or the whole RPi.
Attachments
2016-08-05 17_44_25-RPi Cam Control v6.2.11_ mycam@raspberrypi.jpg
2016-08-05 17_44_25-RPi Cam Control v6.2.11_ [email protected] (62.58 KiB) Viewed 4921 times

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

Re: RPi Cam Web Interface

Fri Aug 05, 2016 8:52 pm

thsBavR10 wrote: Edit:
It's working fine, with this changes. You did a great job!
There could be an small mod to line 87, within the dialog, adding lighty/lighttpd to the possible servers.

Code: Select all

  " Server:(apache/nginx/lighttpd)" 3 1   "$webserver"   3 32 15 0  \ 

I assume the trailing numbers have to be changed.

Creating the missing subroutine 'fn_lighttpd' from scratch is beyond my skills ;-), but I can help in testing your suggestions. '15-fastcgi-php.conf ' is existing within /etc/lighttpd/conf-enabled/

The only small difference to the "old" behaviour is, that I have to reload the page after starting/stopping the camera.
Maybe an future enhancement could be auto-detecting exisitng webservers.

Great job, btidey!
I have added test lighttpd support into install.sh in GitHub. This should allow different subfolders and ports, but not user /password authentication yet. I have not tested this with a real camera system.

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

Re: RPi Cam Web Interface

Fri Aug 05, 2016 8:59 pm

noxx wrote:hello

is it possible to add a auto-restart if RPI CAM CONTROLL crashed?

regard


Error in RaspiMPEG:
Restart RaspiMPEG (./RPI_CAM_WEB_Interface.sh start) or the whole RPi.
There is a watchdog which is supposed to try to restart the camera system if there is a crash or the stream stops updating for some reason. This is controlled by the watchdog settings under camera settings. Under normal operation you should see 2 raspimjpeg processes if a ps -A command is used to list running processes. One of these is the operational system, the other is the watchdog.

Check scheduler Log to see what is happening if you get a crash. If some error has locked up the camera subsystem then this restart will not work. A macro could be used to reboot the Pi if this happens.

Pangu
Posts: 78
Joined: Tue Dec 18, 2012 5:30 pm

Re: RPi Cam Web Interface

Sat Aug 06, 2016 8:51 am

I am aware of

http://rpicam-ip/cam_pic.php

is there a similar URL that I can access to get the live preview of the rpi cam? I want to have a URL which is showing just the live preview WITHOUT any buttons or configuration options. I want to give this URL to "restricted" users who should only be able to VIEW but not change any settings.

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: RPi Cam Web Interface

Sat Aug 06, 2016 3:28 pm

btidey wrote:.
I have added test lighttpd support into install.sh in GitHub. This should allow different subfolders and ports, but not user /password authentication yet. I have not tested this with a real camera system.
Many thanks! I've tested it.
- In the line

Code: Select all

server.document-root      = "/var/www/html>
in the config file there is a missing " at the end of the line.
- the string

Code: Select all

server.port
occurs at multiple locations,
(also in line

Code: Select all

include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port

so the so subsequent spaces must be recognized.

I modified fn_lighttpd () a little bit:

Code: Select all

fn_lighttpd ()
{
sudo lighty-enable-mod fastcgi-php
#sudo sed -i "s/server.document-root.*/server.document-root  = \"\/var\/www$rpicamdirEsc>/g" 
sudo sed -i "s/server.document-root.*/server.document-root  = \"\/var\/www$rpicamdirEsc\"/g" 

/etc/lighttpd/lighttpd.conf
#sudo sed -i "s/server.port.*/server.port  = $webport/g" /etc/lighttpd/lighttpd.conf
sudo sed -i "s/server.port   .*/server.port     = $webport/g" /etc/lighttpd/lighttpd.conf
#sudo service lighttpd restart  
sudo /etc/init.d/lighttpd force-reload
 }
Is that correct?

noxx
Posts: 17
Joined: Fri Oct 25, 2013 8:13 pm

Re: RPi Cam Web Interface

Sat Aug 06, 2016 3:53 pm

btidey wrote:
noxx wrote:hello

is it possible to add a auto-restart if RPI CAM CONTROLL crashed?

regard


Error in RaspiMPEG:
Restart RaspiMPEG (./RPI_CAM_WEB_Interface.sh start) or the whole RPi.
There is a watchdog which is supposed to try to restart the camera system if there is a crash or the stream stops updating for some reason. This is controlled by the watchdog settings under camera settings. Under normal operation you should see 2 raspimjpeg processes if a ps -A command is used to list running processes. One of these is the operational system, the other is the watchdog.

Check scheduler Log to see what is happening if you get a crash. If some error has locked up the camera subsystem then this restart will not work. A macro could be used to reboot the Pi if this happens.

that are the last entry before RPi Cam crashed

Code: Select all

{2016/08/06 12:50:53} Removed item from Box Queue
[2016/08/06 12:51:28] Start capture requested from Pipe
[2016/08/06 12:51:28] Send ca 1
{2016/08/06 12:51:28} Capturing started
[2016/08/06 12:51:31] Stop capture requested
[2016/08/06 12:51:31] Send ca 0
{2016/08/06 12:51:31} Capturing stopped
{2016/08/06 12:51:31} Add /var/www/html/media/vi_1267_20160806_125128.mp4 to Box Queue at pos 30
{2016/08/06 12:51:32} Start boxing /var/www/html/media/vi_1267_20160806_125128.mp4.h264 to /var/www/html/media/vi_1267_20160806_125128.mp4 Queue pos 30
[2016/08/06 12:51:33] Start capture requested from Pipe
[2016/08/06 12:51:33] Send ca 1
{2016/08/06 12:51:33} Capturing started
{2016/08/06 12:51:33} Finished boxing /var/www/html/media/vi_1267_20160806_125128.mp4 from Box Queue at pos 30
{2016/08/06 12:51:33} Removed item from Box Queue
[2016/08/06 12:51:48] Stop capture requested
[2016/08/06 12:51:48] Send ca 0
{2016/08/06 12:51:48} Capturing stopped
{2016/08/06 12:51:48} Add /var/www/html/media/vi_1268_20160806_125133.mp4 to Box Queue at pos 31
{2016/08/06 12:51:48} Start boxing /var/www/html/media/vi_1268_20160806_125133.mp4.h264 to /var/www/html/media/vi_1268_20160806_125133.mp4 Queue pos 31
{2016/08/06 12:51:50} Finished boxing /var/www/html/media/vi_1268_20160806_125133.mp4 from Box Queue at pos 31
{2016/08/06 12:51:50} Removed item from Box Queue
[2016/08/06 12:51:52] Start capture requested from Pipe
[2016/08/06 12:51:52] Send ca 1
{2016/08/06 12:51:52} Capturing started
[2016/08/06 12:51:55] Stop capture requested
[2016/08/06 12:51:55] Send ca 0
[2016/08/06 12:56:02] Scheduled management tasks. Next at 1470484562
[2016/08/06 13:56:03] Scheduled management tasks. Next at 1470488163
[2016/08/06 14:56:04] Scheduled management tasks. Next at 1470491764
[2016/08/06 15:56:05] Scheduled management tasks. Next at 1470495365
[2016/08/06 16:56:06] Scheduled management tasks. Next at 1470498966
{2016/08/06 17:16:57} RaspiMJPEG Version 5.6.4
{2016/08/06 17:16:57} recommended video buffers 1
is a restart macro for RPi Cam available?


EDIT: Next freeze :-(
WebGui show the last Picture at 19:52:31

Code: Select all

[2016/08/06 19:52:23] Start capture requested from Pipe
[2016/08/06 19:52:23] Send ca 1
{2016/08/06 19:52:23} Capturing started
[2016/08/06 19:52:31] Stop capture requested
[2016/08/06 19:52:31] Send ca 0
{2016/08/06 19:52:31} Error: Could not send buffers to port, h264 callback
{2016/08/06 19:52:31} Executing macro /var/www/html/macros/error_hard.sh "Could not send buffers to port, h264 callback" 
{2016/08/06 19:52:36} RaspiMJPEG Version 5.6.4
{2016/08/06 19:52:36} Error: Could not enable camera
{2016/08/06 19:52:36} Executing macro /var/www/html/macros/error_hard.sh "Could not enable camera" 

Return to “Camera board”