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

Re: RPi Cam Web Interface

Fri Nov 04, 2016 5:00 pm

lohtse wrote:I have hit an issue with this software..

if I run the software longer than 10mins I can nolonger access it and control the camera... It is as thought a screen saver has activated and locked the device..

I intend to use the software without a screen and remote login but if the 10min thing can not be bi passed I will have a major issue..

The issue occurs on are Pi3s x2, Zeros x2 and our Pi B and B+ all are on the latest updated(via sudo update etc) firmware/OS

hope someone can shed some light on this..

regards
Lohtse
There is nothing in the camera software that has any time limit or screen dependency and all my camera run headless. Some have been running for over a year continuously (except for a few software updates).

What do you mean by no remote login? SSH would still normally be accessible in a headless unit.

Is the 10 minute fairly predictable and does all access to the Pis go after this interval? If so then I would suspect something funny happening on the networking side. Are you using wifi or wired connections? If wifi then some wifi dongles can cause time out problems unless power save options are turned off.

I would check the scheduler log to see if there is any unusual events leading up to the problem.

Also be sure that any USB cables used to feed power in are low resistance. The extra power taken by the camera can sometimes lead to extra voltage drop in these leading to instability.

lohtse
Posts: 50
Joined: Sun Jul 24, 2016 6:16 pm

Re: RPi Cam Web Interface

Fri Nov 04, 2016 5:42 pm

btidey wrote:
lohtse wrote:I have hit an issue with this software..

if I run the software longer than 10mins I can nolonger access it and control the camera... It is as thought a screen saver has activated and locked the device..

I intend to use the software without a screen and remote login but if the 10min thing can not be bi passed I will have a major issue..

The issue occurs on are Pi3s x2, Zeros x2 and our Pi B and B+ all are on the latest updated(via sudo update etc) firmware/OS

hope someone can shed some light on this..

regards
Lohtse
There is nothing in the camera software that has any time limit or screen dependency and all my camera run headless. Some have been running for over a year continuously (except for a few software updates).

What do you mean by no remote login? SSH would still normally be accessible in a headless unit.

Is the 10 minute fairly predictable and does all access to the Pis go after this interval? If so then I would suspect something funny happening on the networking side. Are you using wifi or wired connections? If wifi then some wifi dongles can cause time out problems unless power save options are turned off.

I would check the scheduler log to see if there is any unusual events leading up to the problem.

Also be sure that any USB cables used to feed power in are low resistance. The extra power taken by the camera can sometimes lead to extra voltage drop in these leading to instability.
All access is lost on all devices I have mentioned and in those requiring wifi I have used 3 different wifi dongles..

If it is a network issue it must be in the raspian software as not hardware as the Pi B and B+ are often used for several days as Octopi servers with cameras and there is NO issues. And the Pi3s are used for serveral projects including media/Kodi servers etc again for days at atime without issue
3x Pi-3 1 x Pi-2 1 x Pi-B+ 1 x Pi-B 2 xPi-Zero 1 x Pi Zero W and a massive ever growing box/room of bits and bobs for them!

hallonpi
Posts: 2
Joined: Wed Nov 02, 2016 6:59 pm

Re: RPi Cam Web Interface

Fri Nov 04, 2016 6:58 pm

btidey wrote:
hallonpi wrote:Hi
Having some trouble to start a video on motion start and end at event end with the motion gui found here
http://elinux.org/RPi-Cam-Web-Interface

I am getting all sorts of strange behavior when setting a start command on motion start in the scheduler it seems the event end fifo comand to stop the video in the motion window never seems to be sent as the video is not stopping. Further i am finding it hard to debug as while motion has been triggered, the settings can not be saved in the gui.

In motion gui event end i have included
echo -n 'ca 0' >/var/www/FIFO

Any advice or tips are appreciated!
Sounds like you are using the external motion method (see above post). I recommend using internal.

Commands are sent to the FIFO where it is located. If you installed in the /var/www root then that would be OK. If you have installed in /var/www/html then it would be /var/www/html/FIFO. Normally the install process should make those adjustments for you.

To debug problems in this area first leave motion detection turned off and then prove you can echo 'ca 1' (to start) and echo 'ca 0' (to stop) to the FIFO. The -n isn't needed any more with recent versions.

Once that is working re-introduce the motion triggers.

Edit: Re-reading also indicates you might aslo have put the echo -n 'ca 0' >/var/www/FIFO into the external motion end event process. That is not how it is supposed to work. Internal or External Motion detection just sends a stop (0) or start (1) into the scheduler FIFO (called FIFO1). The scheduler then translates these triggers into real FIFO commands for the main camera. So under external motion settings you would see something like echo -n '0' >/var/www/FIFO1 for the event end action. I'd still recommend switching to internal motion detection and proceeding as previously described.
Thanks for the suggestion to use the internal engine; I actually had tried it but i was having more trouble with it i thought. It was having trouble getting it to be very sensitive while i wasn't sure how to get it to send an email at the end of an event or to get it to start the video on motion and stop when the event ends (an event, at least in the external, seems to be made up of a series of motion start and stops).

further help /advice and even pointing to documntation is much appreciated!

pumpkinpi
Posts: 141
Joined: Fri Apr 18, 2014 7:11 pm

Re: RPi Cam Web Interface

Fri Nov 04, 2016 8:16 pm

Is there a way that the initial screen can default to the "Simple" view rather than the "Full" view.

I don't see an option for that

Thanks,
PPi

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

Re: RPi Cam Web Interface

Sat Nov 05, 2016 11:39 am

hallonpi wrote:
Thanks for the suggestion to use the internal engine; I actually had tried it but i was having more trouble with it i thought. It was having trouble getting it to be very sensitive while i wasn't sure how to get it to send an email at the end of an event or to get it to start the video on motion and stop when the event ends (an event, at least in the external, seems to be made up of a series of motion start and stops).

further help /advice and even pointing to documntation is much appreciated!
Documentation is in the wiki elinux.org/RPi-Cam-Web-Interface

Internal motion performs the same job as external motion in that it just sends start triggers and end triggers to the scheduler.

For sensitivity tuning on internal add the %c and %f variables to the annotation string. %c will show the smoothed average change being detected. You set the threshold so that it is not triggered by small slow changes. %f shows the averaged change frame count that increments and decrements according to whether a frame exceeds the threshold. When this reaches the start frame point then a start is triggered. The frame counter is now looking for frames which are quiet.When this exceeds the stop frame count a stop is triggered.

Emails or other actions can be sent either by including a macro in the scheduler start trigger actions or by using the macros which get fired when recording starts and stops.

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

Re: RPi Cam Web Interface

Sat Nov 05, 2016 11:41 am

lohtse wrote: All access is lost on all devices I have mentioned and in those requiring wifi I have used 3 different wifi dongles..

If it is a network issue it must be in the raspian software as not hardware as the Pi B and B+ are often used for several days as Octopi servers with cameras and there is NO issues. And the Pi3s are used for serveral projects including media/Kodi servers etc again for days at atime without issue
Is there anything in the logs to indicate a problem with the camera software? Also maybe trying turning off motion detection for a while to see if that makes a difference.

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

Re: RPi Cam Web Interface

Sat Nov 05, 2016 12:35 pm

pumpkinpi wrote:Is there a way that the initial screen can default to the "Simple" view rather than the "Full" view.

I don't see an option for that

Thanks,
PPi
The Full or Simple status is retained in a cookie per browser. So if you set to Simple (no controls) then it should stay even stopping and starting that browser until you toggle it back to full.

If you want it to default to Simple on starting up for the very first time then that would need a small change to the main page (index.php).

pumpkinpi
Posts: 141
Joined: Fri Apr 18, 2014 7:11 pm

Re: RPi Cam Web Interface

Sun Nov 06, 2016 4:16 am

Yes, I want it to be in the Simple view by default.

I tried messing around with this block in index.php, but couldn't make it default to Simple.

$toggleButton = "Simple";
$displayStyle = 'style="display:block;"';
if(isset($_COOKIE["display_mode"])) {
if($_COOKIE["display_mode"] == "Simple") {
$toggleButton = "Full";
$displayStyle = 'style="display:none;"';
}
}

Clearly I did not know what I was doing. I couldn't make it default to Simple. Advice?

Thanks,
PPi.

lohtse
Posts: 50
Joined: Sun Jul 24, 2016 6:16 pm

Re: RPi Cam Web Interface

Sun Nov 06, 2016 7:51 am

btidey wrote:
lohtse wrote: All access is lost on all devices I have mentioned and in those requiring wifi I have used 3 different wifi dongles..

If it is a network issue it must be in the raspian software as not hardware as the Pi B and B+ are often used for several days as Octopi servers with cameras and there is NO issues. And the Pi3s are used for serveral projects including media/Kodi servers etc again for days at atime without issue
Is there anything in the logs to indicate a problem with the camera software? Also maybe trying turning off motion detection for a while to see if that makes a difference.
no detection mode set.. states "Motion not running. Put in detection state"


how do I pull the logs off??

My settings are all default other than photo sizes.
3x Pi-3 1 x Pi-2 1 x Pi-B+ 1 x Pi-B 2 xPi-Zero 1 x Pi Zero W and a massive ever growing box/room of bits and bobs for them!

rollerrolol
Posts: 8
Joined: Sat Feb 07, 2015 10:12 pm

Re: RPi Cam Web Interface

Mon Nov 07, 2016 10:14 am

Could someone direct me to some short guide for how to setup motion detection to take 1-3 photos for every detected motion, and to take one photo each 15 minutes? I can't seem to find out how to do it with the instructions in the first post. I just can't seem to get it to take any photos based on a time interval.

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

Re: RPi Cam Web Interface

Mon Nov 07, 2016 4:08 pm

pumpkinpi wrote:Yes, I want it to be in the Simple view by default.

I tried messing around with this block in index.php, but couldn't make it default to Simple.

$toggleButton = "Simple";
$displayStyle = 'style="display:block;"';
if(isset($_COOKIE["display_mode"])) {
if($_COOKIE["display_mode"] == "Simple") {
$toggleButton = "Full";
$displayStyle = 'style="display:none;"';
}
}

Clearly I did not know what I was doing. I couldn't make it default to Simple. Advice?

Thanks,
PPi.
The basic way is just to reverse everything in that code.

$toggleButton = "Full";
$displayStyle = 'style="display:none;"';
if(isset($_COOKIE["display_mode"])) {
if($_COOKIE["display_mode"] == "Full") {
$toggleButton = "Simple";
$displayStyle = 'style="display:block;"';
}
}

You need to edit the operational version of index.php (e.g. in /var/www;html); not the copy kept in the RPi_Cam_Web_Interface folder.

Also note that if a cookie has already been set to Full or Simple then that will be respected. This only affects the default for first time browser use.

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

Re: RPi Cam Web Interface

Mon Nov 07, 2016 4:12 pm

lohtse wrote:
btidey wrote:
lohtse wrote: All access is lost on all devices I have mentioned and in those requiring wifi I have used 3 different wifi dongles..

If it is a network issue it must be in the raspian software as not hardware as the Pi B and B+ are often used for several days as Octopi servers with cameras and there is NO issues. And the Pi3s are used for serveral projects including media/Kodi servers etc again for days at atime without issue
Is there anything in the logs to indicate a problem with the camera software? Also maybe trying turning off motion detection for a while to see if that makes a difference.
no detection mode set.. states "Motion not running. Put in detection state"


how do I pull the logs off??

My settings are all default other than photo sizes.
The Motion not running message occurs if you have External motion detection configured as the 'motion' process settings are only accessible when 'motion' is running. I guess that your problem is occurring with no motion detection operational.

The Scheduler maintains the logs. They can be accessed, viewed, downloaded and deleted from the Scheduler page

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

Re: RPi Cam Web Interface

Mon Nov 07, 2016 4:26 pm

rollerrolol wrote:Could someone direct me to some short guide for how to setup motion detection to take 1-3 photos for every detected motion, and to take one photo each 15 minutes? I can't seem to find out how to do it with the instructions in the first post. I just can't seem to get it to take any photos based on a time interval.
Photos based on a time interval are obtained using the time lapse function. You set the interval under Camera settings then start time lapse operation by either pressing the time lapse start or by sending tl 1 command to the FIFO.

Grabbing a single image at motion start is done by putting an im command in the Motion Start field in the Scheduler. This would work even if the time lapse is grabbing every 15 minutes.

If you want to have time lapse operating in the background (every 15 minutes) and also grab several images on motion start then there are several ways this can be done.

1) Put several im commands in motion start (e.g. im;im;im) These will be spaced out by about 2 seconds as the scheduler puts a delay between commands.

2) Put a macro command in the motion start and put a macro script in then sends im commands to the command FIFO at whatever interval you want.

3) Change the time lapse interval (eg. tv 40 for 4 seconds) and issue a tl 0;tl 1 command in motion start and then do the same thing in motion stop to revert it back to 15 minutes

Edit: If you want the photos to be separate grabs rather than a time lapse sequence then you can use the Auto_Capture interval to do this. Setting that to 900 seconds effectively simulates a motion start every 15 minutes. (Remember to Save Scheduler Settings). So if Motion start has a im command then a separate image rather than a time lapse sequence will be generated.

rollerrolol
Posts: 8
Joined: Sat Feb 07, 2015 10:12 pm

Re: RPi Cam Web Interface

Tue Nov 08, 2016 12:01 pm

btidey wrote: 2) Put a macro command in the motion start and put a macro script in then sends im commands to the command FIFO at whatever interval you want.

3) Change the time lapse interval (eg. tv 40 for 4 seconds) and issue a tl 0;tl 1 command in motion start and then do the same thing in motion stop to revert it back to 15 minutes

Edit: If you want the photos to be separate grabs rather than a time lapse sequence then you can use the Auto_Capture interval to do this. Setting that to 900 seconds effectively simulates a motion start every 15 minutes. (Remember to Save Scheduler Settings). So if Motion start has a im command then a separate image rather than a time lapse sequence will be generated.
I have now done it like this:
https://s13.postimg.org/i6jzv4ruf/rpi_c ... ttings.png
https://s13.postimg.org/fqi6ha9rr/sched ... rpicam.png

Before I had everything the same but now I added the im;im;im, not sure if it was correct. My problem is that nothing is captured even if I have the motion and/or timelapse started.

But I'm not really sure what the different motion start times (each hour from 9 to 14) mean? And I didn't fully understand the point 2.

I would like individual photos, I will later make them into a timelapse movie.
Last edited by rollerrolol on Tue Nov 08, 2016 12:03 pm, edited 1 time in total.

User avatar
xaver
Posts: 20
Joined: Thu Dec 10, 2015 3:35 pm
Location: Czech Republic

Re: RPi Cam Web Interface

Tue Nov 08, 2016 12:02 pm

hello,

I am using RPi Cam Web Interface to watch my frontgate and backyard. I have set it to record anything on movement for a few secs, set up a buffer so I know what caused the motion detection to go. The trouble starts when the electricity goes out, what happens sometimes. When th RPi is restarted, I need the motion detection to be set ON on startup. Is that possible to do somehow? I bet it is, I just don't know how :-)

thanks

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

Re: RPi Cam Web Interface

Tue Nov 08, 2016 6:31 pm

rollerrolol wrote:
btidey wrote: 2) Put a macro command in the motion start and put a macro script in then sends im commands to the command FIFO at whatever interval you want.

3) Change the time lapse interval (eg. tv 40 for 4 seconds) and issue a tl 0;tl 1 command in motion start and then do the same thing in motion stop to revert it back to 15 minutes

Edit: If you want the photos to be separate grabs rather than a time lapse sequence then you can use the Auto_Capture interval to do this. Setting that to 900 seconds effectively simulates a motion start every 15 minutes. (Remember to Save Scheduler Settings). So if Motion start has a im command then a separate image rather than a time lapse sequence will be generated.
I have now done it like this:
https://s13.postimg.org/i6jzv4ruf/rpi_c ... ttings.png
https://s13.postimg.org/fqi6ha9rr/sched ... rpicam.png

Before I had everything the same but now I added the im;im;im, not sure if it was correct. My problem is that nothing is captured even if I have the motion and/or timelapse started.

But I'm not really sure what the different motion start times (each hour from 9 to 14) mean? And I didn't fully understand the point 2.

I would like individual photos, I will later make them into a timelapse movie.
Time lapse mode takes regular image captures at th time lapse interval but they are all grouped together under 1 thumbnail image. You can convert to a video or download the sequence which gives you a zip containing all the images.

As you want to see separate thumbnails I suggested the alternative technique of using the auto_capture interval which regularly does the equivalent of a motion start trigger and does whatever commands are set up in the Motion Start command box, e.g an im (snap image command). With this each capture has its own thumbnail and they are not part of a sequence as such. You can download them altogether if you want by selecting them all and then downloading.

You are using the external motion detection method which uses the 'motion' process to detect movement. I recommend using the internal motion detection method for most purposes now.

The scheduler has three different ways of scheduling commands; All Day, Sun Based and Fixed time which allow for different commands to be set up for different parts of the day. All Day is the simplest as its name implies the day is not split up and there is only Motion Start / Stop Period start entry which is used no matter what the time of day is. Sun Based splits the day into 4 periods Dawn, Day, Dusk and Night which will vary based on the local Sunrise and Sunset times. Fixed Times splits the Day into 6 periods and you can configure the time of these periods and the commands sent within each period. So with 09:00 as the first and 10:00 as the second then the commands in the 09:00 row are used when a motion trigger occurs between 09:00 and 10:00. The second row configures from 10:00 and so on.

I would suggest the following steps.

1) Use All Day mode to keep it simple to start with.
2) Set Auto_Capture Interval to 20 and put a single im in Motion Start.
3) Save Settings
4) Do Not turn on time lapse or motion detection

You should now see an image being captured every 20 seconds.

5) Now change the scheduler settings to have im;im;im; in the Motion Start and Save Settings.

You should now see 3 images being captured about 2 seconds apart and repeated every 20 seconds.

6) Change Auto_Capture Interval to 900 to get the interval you want and Save

7) Change Motion Detection to Internal and tune Motion Settings if required to get the desired sensitivity.

Point 2 was that they is a command (e.g. sy myscript.sh) which you can put in the Motion Start which will then execute a script that you have written and put in the macros folder (with appropriate privileges). This script can do whatever you write into it including sending image capture commands into the FIFO command queue.

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

Re: RPi Cam Web Interface

Tue Nov 08, 2016 6:39 pm

xaver wrote:hello,

I am using RPi Cam Web Interface to watch my frontgate and backyard. I have set it to record anything on movement for a few secs, set up a buffer so I know what caused the motion detection to go. The trouble starts when the electricity goes out, what happens sometimes. When th RPi is restarted, I need the motion detection to be set ON on startup. Is that possible to do somehow? I bet it is, I just don't know how :-)

thanks
Motion Detection can be controlled at start up in 2 basic ways.

1) You can edit the /etc/raspimjpeg main config file and change motion_detection from false to true

2) You can configure the scheduler so that it has a period start command of md 1. The Period Start command will be executed when the raspberry starts up.

Method 2 is better in my view as it allows control if you have set up the Scheduler to have different periods. E.g. in Sun based mode you could choose to have motion detection only active during the Day (md 1 in Day Period Start and md 0 in other Period Starts). When the Raspberry boots then it will turn on motion detection if it starts in a Day period otherwise it would wait for the next Day period to start. If you don't want to split the Day up then you use All Day mode and put a md 1 in its one Period Start entry so the Raspberry always goes into motion detection no matter when it boots up.

xzanfr
Posts: 18
Joined: Wed Jun 20, 2012 12:52 pm

Re: RPi Cam Web Interface

Tue Nov 08, 2016 8:44 pm

xaver wrote:hello,

I am using RPi Cam Web Interface to watch my frontgate and backyard. I have set it to record anything on movement for a few secs, set up a buffer so I know what caused the motion detection to go. The trouble starts when the electricity goes out, what happens sometimes. When th RPi is restarted, I need the motion detection to be set ON on startup. Is that possible to do somehow? I bet it is, I just don't know how :-)

thanks
Another way to get it to work is:
From the main screen, Expand the "setup"tab
click "settings" button in the setup section of the menu
slide it on the screen to "on"

(Up until about 45 mins ago I've been doing it as mentioned by btidey in the post above, however I've just had to set up a new card with a fresh version of pikrelcam and found it - handy addition :) )

EDIT: posted in wrong thread - sorry for being a plonker!
Last edited by xzanfr on Wed Nov 09, 2016 8:09 am, edited 1 time in total.

User avatar
xaver
Posts: 20
Joined: Thu Dec 10, 2015 3:35 pm
Location: Czech Republic

Re: RPi Cam Web Interface

Tue Nov 08, 2016 10:05 pm

thank you both, I edited /etc/raspimjpeg ;-)

quavoce
Posts: 109
Joined: Fri Nov 27, 2015 9:11 am

Re: RPi Cam Web Interface

Wed Nov 09, 2016 8:54 pm

Hi Robert,

Just noticed your new installation menu as I wanted to rebuild my test RPi Cam Pi - it's a great improvement from the previous version - but I'm having a slight issue with it. (when was this update released?)

During installation it prompts you to run the configure option after the reboot whereupon I can choose to set up security if I wanted to. As I'm just testing I left all options as they were because port 80 is ok, and autostart and camera shows as enabled. Also the main page shows Apache2 as installed, and RPi Cam as started. However, I was unable to browse to the RPiCam website on the Pi... (it says "The requested URL /html/ was not found on this server.")

Looking at /etc/apache2/sites-enabled I noticed that the default site profile was there and the usual raspicam.conf was missing.

I then decided to enable security by setting a user/pass, but still the website doesn't work (though it does now prompt me for a user/pass!)

Is there a bug in the new installation script that misses copying over raspicam.conf, or have I done something wrong?

I did a full (Hard) uninstall and re-installed RPi Cam, but the same issue occurred.

Thanks.

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

Re: RPi Cam Web Interface

Thu Nov 10, 2016 6:19 pm

quavoce wrote:Hi Robert,

Just noticed your new installation menu as I wanted to rebuild my test RPi Cam Pi - it's a great improvement from the previous version - but I'm having a slight issue with it. (when was this update released?)

During installation it prompts you to run the configure option after the reboot whereupon I can choose to set up security if I wanted to. As I'm just testing I left all options as they were because port 80 is ok, and autostart and camera shows as enabled. Also the main page shows Apache2 as installed, and RPi Cam as started. However, I was unable to browse to the RPiCam website on the Pi... (it says "The requested URL /html/ was not found on this server.")

Looking at /etc/apache2/sites-enabled I noticed that the default site profile was there and the usual raspicam.conf was missing.

I then decided to enable security by setting a user/pass, but still the website doesn't work (though it does now prompt me for a user/pass!)

Is there a bug in the new installation script that misses copying over raspicam.conf, or have I done something wrong?

I did a full (Hard) uninstall and re-installed RPi Cam, but the same issue occurred.

Thanks.
Can I first clarify which install method you are using?

There is the original method RPi_Cam_Web_Interface_Installer.sh and the install.sh method. It sounds like you may be referring to the original one as the newer one which is not the case.

I don't maintain the original RPi one any more, just the install.sh one. Although the RPi one offers menu items to change the config around after installation the same effect is achieved with the install.sh one just by running it again. Doing it this way simplifies the script a lot and makes it easier to maintain. It does not re-install all the dependencies after the initial install so effectively just changes the settings to match the configuration options requested.

quavoce
Posts: 109
Joined: Fri Nov 27, 2015 9:11 am

Re: RPi Cam Web Interface

Thu Nov 10, 2016 6:26 pm

btidey wrote:
Can I first clarify which install method you are using?

There is the original method RPi_Cam_Web_Interface_Installer.sh and the install.sh method. It sounds like you may be referring to the original one as the newer one which is not the case.

I don't maintain the original RPi one any more, just the install.sh one. Although the RPi one offers menu items to change the config around after installation the same effect is achieved with the install.sh one just by running it again. Doing it this way simplifies the script a lot and makes it easier to maintain. It does not re-install all the dependencies after the initial install so effectively just changes the settings to match the configuration options requested.
Ahhh, I use RPi_Cam_Web_Interface_Installer.sh out of habit, but will ensure I won't going forward. :) Thanks!

quavoce
Posts: 109
Joined: Fri Nov 27, 2015 9:11 am

Re: RPi Cam Web Interface

Thu Nov 10, 2016 8:39 pm

I would like to enable HTTPS on each of my RPiCam's so that the username and password aren't transmitted in the clear. I have successfully done this using the instructions below but there's one problem I just can't figure out.

The problem is I can't play back recorded video on an iPhone/iPad when HTTPS is enabled... It works fine from a desktop, just not my mobile devices.

Could someone follow my instructions below to see if you see the same issue, either on Android or iPhone as well please?

Initial Setup
1. Fresh Jessie image (used 2016-09-23-raspbian-jessie.img)
2. Install RPi Cam:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
chmod u+x *.sh
./install.sh
3. Configured using html as subfolder, Apache, Port 80, user/pass blank
4. Connected to RPi Cam from desktop and recorded a normal and motion detected video.
5. Connected to RPi Cam via iPhone/iPad and browsed to Download Video and Images, and verified I can play back recorded videos.

Configure HTTPS
1. Set up and configure self-signed certificate: (accept the defaults)

Code: Select all

sudo mkdir /etc/apache2/ssl
sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
2. Prep Apache to use SSL

Code: Select all

sudo a2enmod rewrite
sudo a2enmod ssl
3. Edit /etc/apache2/sites-available/raspicam.conf (use nano instead of vim if preferred)

Code: Select all

sudo vim /etc/apache2/sites-available/raspicam.conf
4. Change <VirtualHost *:80> to <VirtualHost *:443>
5. Add the following lines just before </VirtualHost>

Code: Select all

SSLEngine On
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
It should look like this:

Code: Select all

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www
        <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride All
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn

        SetEnvIf Request_URI "/cam_pic.php$|/status_mjpeg.php$" dontlog
        CustomLog ${APACHE_LOG_DIR}/access.log common env=!dontlog
        SSLEngine On
        SSLCertificateFile    /etc/apache2/ssl/server.crt
        SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
6. Restart Apache

Code: Select all

sudo service apache2 restart
7. Visit the RPi Cam webpage again, ensuring you start with https://
8. Try to play back the recorded videos on your mobile.

Does this work ok for anyone else?

GOPI56
Posts: 29
Joined: Sat Aug 13, 2016 10:13 am
Location: Malaysia

Re: RPi Cam Web Interface

Fri Nov 11, 2016 2:27 am

Hi all,
I would like to disable the motion detection on motion software because i am using PIR sensors to detect motion.How to disable it anyone help.

Thank you.

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

Re: RPi Cam Web Interface

Fri Nov 11, 2016 9:03 am

GOPI56 wrote:Hi all,
I would like to disable the motion detection on motion software because i am using PIR sensors to detect motion.How to disable it anyone help.

Thank you.
Motion detection will only be on if one of the following is true.

1) /etc/raspimjpeg config file has motion_detection true so that it is started on boot up. If so change it to false and restart.

2) Scheduler has a md 1 command to turn on motion detection in one of the period start entries. Remove any md 1 entries

3) Someone has pushed the Start motion detection button on the web interface.

4) Some external process is sending a md 1 command to the FIFO

For PIR control there are 2 ways.

a) Arrange the PIR start trigger to send a 'ca 1' to FIFO when it detects motion to start a video recording and a ca 0 when PIR signals stop.

b) Arrange the PIR start trigger to send a '1' to FIFO1 when it detects motion and a '0' when PIR signals stop. The Scheduler then translates these into whatever commands are required. This method is more flexible as it allows easy changing of the actions and they can be different at different times of the day.

Return to “Camera board”