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

Re: RPi Cam Web Interface

Tue Apr 25, 2017 9:13 am

DrMikeG wrote:This work is excellent but this thread is a pain.

I've done my best to read and search the 4000+ posts (with the numerous side tracks onto other projects).

What am I trying to do:
- Capture short time-lapse sequence (1-2 min) at highest possible quality, at the expense of frame rate.

From what I have understood:
1) This project seems to be the main (if not only) web previewer for pi cam
2) raspimjpeg is designed purely for jpeg/mpeg
3) Including raw layer data does not work for time lapse (only single capture)

What I intend to try:
Adding a new button the interface which when pressed will:
a) stop raspimjpeg
b) using raspistill to capture a fixed number of png images (hopefully these will be higher quality / uncompressed)
c) restart raspimjpeg to continue previewing

My questions are:
Q1) Does this sound practical?
Q2) Is there an easier way I have missed?

Many thanks for your time and expertise.
That is certainly feasible. A button could arrange a ru 0 command to pause raspimjpeg releasing the camera interface, do the fixed number of captures and restart raspimjpeg (ru 1).

Currently the captures do use a jpeg conversion process in the GPU. Two thought on that; the jpeg quality can be raised to its maximum, it might be possible to add png to the raspimjpeg process.

User avatar
RichShumaker
Posts: 168
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA
Contact: Website Facebook Google+ Twitter YouTube

Re: RPi Cam Web Interface

Tue Apr 25, 2017 9:49 am

Gavinmc42 wrote: In those 163 pages has anyone got it going on a Zero W?
?
I have 4 Pi Zero W's that all seem to work. PiNoir, Regular Pi, M12 all v1 cameras as I don't have any v2's.
I need to say a BIG THANK YOU for the amazing Zero Case with Camera & cable created by the Foundation.
This has been my favorite form factor for any of the Pi's I have with Camera's.
I use it with inexpensive rechargeable batteries and I can get over an hour of use or my high end battery gave me 24 hours, need to test with 2 cameras now.

I have been using vMix software to bring the streams together and I can switch and combine them that way.
Here is an example of dual cameras with styled overlay - https://youtu.be/pGb-ebz-pLs
I also use the Web interface to allow me to adjust all the settings and flip the cameras if necessary.
I have tried all kinds of frame rates and settings and it is simply awesome to use.
I was doing 90FPS at 640 X 480 no problem and I think the overclocked PiZero really helps this.

To make setup easy I configured a single RasPi Zero W with Keyboard Mouse and Monitor & set up my network stuff then I cloned it.
When I have issues or need to update I use SSH, which works really well.
I am amazed at how well(I have had 3 going at a time) they all work wirelessly, wired is still faster for lag and it feels like a higher frame rate too.

I am still trying to link more than one camera together for taking pictures and video at the same time across many cameras using RPi Cam Web Interface.
Any suggestions on making this work would be greatly appreciated.
Rich Shumaker
http://www.instructables.com/id/Pi-Zero-W-NoIR-8MP-Camera-Build-Overview-Introduct/

MasterC
Posts: 5
Joined: Sun Aug 16, 2015 4:58 am

Re: RPi Cam Web Interface

Wed Apr 26, 2017 4:27 am

Hi!

Thank you for this excellent software!

I'm trying to "dual purpose" my camera by writing a Python script which utilizes a PIR motion sensor to trigger a bash script that creates "reusable" snapshots (a series of 3 images as snapshot1.jpg snapshot2.jpg snapshot3.jpg that get overwritten after the PIR resets) in /dev/shm/snapshots/ (or /tmp until I get the rest working). My processes have been:
  • Version 1: Initially I would stop RPi Cam Web Interface, use raspistill to capture the image, then mv the image to /tmp/snapshot$i.jpg (in a loop where $i was the iteration through the loop), and then restart RPi Cam Web Interface.
  • Version 2: I quickly realized that is really inelegant and time intensive, so I moved away from stopping this software and raspistill to using:

    Code: Select all

    echo 'im' > /var/www/FIFO
    and a hack to determine the filename and mv the image to /tmp
  • Version 3: The image moving hack didn't work so great, it seemed sometimes echoing im to FIFO wouldn't capture an image, and my hack started a recursive copying party. So then I started looking at using the end_img.sh macro to determine the filename. However, when I run

    Code: Select all

    echo 'im' > /var/www/FIFO
    it doesn't seem to trigger the macros to run, and I am not sure how to handle the occasional echo 'im' not capturing an image, so it might result in the same problem anyway.
Before I move on to Version 4, I get the feeling I'm "Doing Things The Hard Way"(tm) and would love to do this the right way :)

I have the PIR working great, I have it attached to my GPIO pins and Python does an excellent job of spitting out when motion is detected, so I think that part is good but I'm open to a "whole idea" solution that ditches my Python script that calls my bash script described above when the PIR gets triggered.

To reiterate what I'm trying to do: I'd like to use my PIR that is attached to my Pi to trigger the camera to snap 3 successive pictures ~1 second apart and mv (I'd prefer move over copy so I can keep my /var/www/media directory cleaned up for my normal captures from the web interface) those images to a temporary directory using a naming convention that will overwrite them the next time the PIR detects motion.

I've searched this thread and read the Wiki but can't seem to find a solution, any help would be appreciated.

Thanks,
-Chad

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

Re: RPi Cam Web Interface

Wed Apr 26, 2017 9:00 am

MasterC wrote:Hi!

Thank you for this excellent software!

I'm trying to "dual purpose" my camera by writing a Python script which utilizes a PIR motion sensor to trigger a bash script that creates "reusable" snapshots (a series of 3 images as snapshot1.jpg snapshot2.jpg snapshot3.jpg that get overwritten after the PIR resets) in /dev/shm/snapshots/ (or /tmp until I get the rest working). My processes have been:
  • Version 1: Initially I would stop RPi Cam Web Interface, use raspistill to capture the image, then mv the image to /tmp/snapshot$i.jpg (in a loop where $i was the iteration through the loop), and then restart RPi Cam Web Interface.
  • Version 2: I quickly realized that is really inelegant and time intensive, so I moved away from stopping this software and raspistill to using:

    Code: Select all

    echo 'im' > /var/www/FIFO
    and a hack to determine the filename and mv the image to /tmp
  • Version 3: The image moving hack didn't work so great, it seemed sometimes echoing im to FIFO wouldn't capture an image, and my hack started a recursive copying party. So then I started looking at using the end_img.sh macro to determine the filename. However, when I run

    Code: Select all

    echo 'im' > /var/www/FIFO
    it doesn't seem to trigger the macros to run, and I am not sure how to handle the occasional echo 'im' not capturing an image, so it might result in the same problem anyway.
Before I move on to Version 4, I get the feeling I'm "Doing Things The Hard Way"(tm) and would love to do this the right way :)

I have the PIR working great, I have it attached to my GPIO pins and Python does an excellent job of spitting out when motion is detected, so I think that part is good but I'm open to a "whole idea" solution that ditches my Python script that calls my bash script described above when the PIR gets triggered.

To reiterate what I'm trying to do: I'd like to use my PIR that is attached to my Pi to trigger the camera to snap 3 successive pictures ~1 second apart and mv (I'd prefer move over copy so I can keep my /var/www/media directory cleaned up for my normal captures from the web interface) those images to a temporary directory using a naming convention that will overwrite them the next time the PIR detects motion.

I've searched this thread and read the Wiki but can't seem to find a solution, any help would be appreciated.

Thanks,
-Chad
I would persist with method 3.
1) You need the script to be owned by www-data and to have execution rights to allow them to run.

Code: Select all

sudo chown www-data:www-data end_img.sh
sudo chmod 764 end_img.sh
2) A simple version of script would be something like

Code: Select all

#!/bin/bash
if [ -e /tmp/snapshot1 ];then
   cp $1 /tmp/snapshot1.jpg
   mv /tmp/snapshot1 /tmp/snapshot2
elif [ -e /tmp/snapshot2 ];then
   cp $1 /tmp/snapshot2.jpg
   mv /tmp/snapshot2 /tmp/snapshot3
elif [ -e /tmp/snapshot3 ];then
   cp $1 /tmp/snapshot3.jpg
   mv /tmp/snapshot3 /tmp/snapshot1
else
   cp $1 /tmp/snapshot1.jpg
   echo 'trgger' > /tmp/snapshot2
fi
This copies to snapshot1,2,3 in a cyclic fashion. Your python could set up the start file after a PIR trigger to make sure they are in sync.

3) You need to make sure there is a little delay between successive image commands to make sure they fire reliably. I would start with 1 second.

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

Re: RPi Cam Web Interface

Wed Apr 26, 2017 1:53 pm

btidey wrote:
quavoce wrote:
btidey wrote:The latest version now has a video split capability. Under camera settings there is a new setting called video split. If this is 0 then behaviour is as before with continuous recording between a video start and stop. If set non-zero then the recording will be stopped and restarted at this interval whilst vide is active. So if set to say 300 then a new recording will be made at 5 minute intervals. Each recording has its own thumbnail and behaves the same as if it had been manually stopped and restarted at this interval.
Thank you Robert for this useful feature - I'm hoping to set my Pi recording all day using this!

During normal motion detection, video recordings are started and motion detection continues to work by prolonging the recordings if movement still occurs. This indicates that motion detection is still possible while recording video. However, if I manually start recording video, the motion section button is greyed out. Is this intentional to prevent something from breaking?

My thoughts are to make this work like some commercial solutions by recoding video all day and logging the time to a text file when any motion is detected. I like the idea of having the whole day recorded just in case something happens outside my masked area. For example, my camera includes part of the road which I mask off to prevent motion triggering whenever cars drive past, but a couple of weeks ago there was an accident and it would have been useful to have a video recording of this event.

Fingers crossed that this is possible... :)

Thanks!

P.S. Is it possible to include the date/time stamp on videos when using the manual recording button please?
Sorry for delay in replying to this, busy with other stuff.

At the moment manual initiating a recording does grey out motion detection as these were thought to be mutually exclusive modes. The underlying process could have motion detection running even when doing manual recordings but it would need a change to do this. The action on motion detection in the scheduler could then be used to fire a script to log each motion detection.
Latest version now has a motion monitoring mode in addition to the internal / external motion setting. If this is activated then internal motion detection monitors but does not generate triggers. It logs start and stop events to a motionLog.txt file normally in the web folder but configurable in raspimjpeg.

In addition a new macro motion_event.sh can be triggered when internal motion start and stops occur.

I'm not sure what your PS about timestamps means. Annotation can embed the running timestamp in the video and filenames also normally include timestamp.

MasterC
Posts: 5
Joined: Sun Aug 16, 2015 4:58 am

Re: RPi Cam Web Interface

Wed Apr 26, 2017 11:25 pm

btidey wrote: I would persist with method 3.
1) You need the script to be owned by www-data and to have execution rights to allow them to run.

Code: Select all

sudo chown www-data:www-data end_img.sh
sudo chmod 764 end_img.sh
2) A simple version of script would be something like

Code: Select all

#!/bin/bash
if [ -e /tmp/snapshot1 ];then
   cp $1 /tmp/snapshot1.jpg
   mv /tmp/snapshot1 /tmp/snapshot2
elif [ -e /tmp/snapshot2 ];then
   cp $1 /tmp/snapshot2.jpg
   mv /tmp/snapshot2 /tmp/snapshot3
elif [ -e /tmp/snapshot3 ];then
   cp $1 /tmp/snapshot3.jpg
   mv /tmp/snapshot3 /tmp/snapshot1
else
   cp $1 /tmp/snapshot1.jpg
   echo 'trgger' > /tmp/snapshot2
fi
This copies to snapshot1,2,3 in a cyclic fashion. Your python could set up the start file after a PIR trigger to make sure they are in sync.

3) You need to make sure there is a little delay between successive image commands to make sure they fire reliably. I would start with 1 second.
Thank you!! I had 2 things wrong. I'm ashamed to admit the first: I wrote "stop_img.sh" instead of "end_img.sh" :shock:

And 2: I thought I had to interpret the full path to $1 (I assumed it was just the filename), I didn't realize $1 included the full path.

Thank you very much!!
-Chad

rajshah.heritage
Posts: 1
Joined: Fri Apr 28, 2017 10:36 am

Re: RPi Cam Web Interface

Fri Apr 28, 2017 10:47 am

Can we implement the project using COAP (constrained application protocol).
Thanks in advance
Email id: rajshah.heritage @ gmail.com

KC3HUB
Posts: 8
Joined: Fri Apr 28, 2017 12:27 pm

Re: RPi Cam Web Interface

Fri Apr 28, 2017 12:53 pm

Greetings, btidey and Thank You! I'm excited to join the group of CWI users. Just found all this yesterday after floundering through Motion.

From Jan 26, 2016:
...PMM wrote: motion: no process found
php: no process found
bash: php:command not found
Any suggestions to get over the first hurdle?....

...You replied: Those messages are warnings and not necessarily anything to worry about. They occur when processes are trying to be stopped but are not actually already running. I assume you used ./install.sh method. What settings did you choose (subfolder, autostart, server, port, user, password)? Have you then tried browsing to http://cameraIP/subfolder (replace by actual values)? What do you see? ....


He never replied but, "bash: php: command not found" is my only hurdle at the moment on a Zero W with CWI as the first thing installed following WIKI instructions using ./install.sh method. So I'll give you my answers.

My installation picks were: picam, Yes, Apache, 80, no user or pass for now. I type http://10.0.0.10/picam in Chrome and just get a standard 'cannot be displayed' message. Also, on reboot, no LED on camera module (as an extra datapoint).

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

Re: RPi Cam Web Interface

Sat Apr 29, 2017 4:25 pm

btidey wrote:
btidey wrote:
quavoce wrote:
Thank you Robert for this useful feature - I'm hoping to set my Pi recording all day using this!

During normal motion detection, video recordings are started and motion detection continues to work by prolonging the recordings if movement still occurs. This indicates that motion detection is still possible while recording video. However, if I manually start recording video, the motion section button is greyed out. Is this intentional to prevent something from breaking?

My thoughts are to make this work like some commercial solutions by recoding video all day and logging the time to a text file when any motion is detected. I like the idea of having the whole day recorded just in case something happens outside my masked area. For example, my camera includes part of the road which I mask off to prevent motion triggering whenever cars drive past, but a couple of weeks ago there was an accident and it would have been useful to have a video recording of this event.

Fingers crossed that this is possible... :)

Thanks!

P.S. Is it possible to include the date/time stamp on videos when using the manual recording button please?
Sorry for delay in replying to this, busy with other stuff.

At the moment manual initiating a recording does grey out motion detection as these were thought to be mutually exclusive modes. The underlying process could have motion detection running even when doing manual recordings but it would need a change to do this. The action on motion detection in the scheduler could then be used to fire a script to log each motion detection.
Latest version now has a motion monitoring mode in addition to the internal / external motion setting. If this is activated then internal motion detection monitors but does not generate triggers. It logs start and stop events to a motionLog.txt file normally in the web folder but configurable in raspimjpeg.

In addition a new macro motion_event.sh can be triggered when internal motion start and stops occur.

I'm not sure what your PS about timestamps means. Annotation can embed the running timestamp in the video and filenames also normally include timestamp.
Wow, seriously Robert, you are amazing! I'll have a play with this over the weekend! A really big thank you!! Is your Donation link still working?

I need to test a little bit more, but when I had recording on 24/7, with Video Split set to 1800, it stopped converting the .mp4.h264 to .mp4 after a while. As a result, the PurgeSpace_level failed to work because it seems to ignore the .h264 files, filling up my Pi and preventing the video from recording. It could be there's not enough space to do the conversion, so will leave it overnight at 10 min video splits to see if that helps.


Regarding timestamps, I've done a fresh install of everything and it's all ok now, so not sure what I did wrong before.

Thanks again!!

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

Re: RPi Cam Web Interface

Sun Apr 30, 2017 11:57 am

quavoce wrote:
btidey wrote: Latest version now has a motion monitoring mode in addition to the internal / external motion setting. If this is activated then internal motion detection monitors but does not generate triggers. It logs start and stop events to a motionLog.txt file normally in the web folder but configurable in raspimjpeg.

In addition a new macro motion_event.sh can be triggered when internal motion start and stops occur.

I'm not sure what your PS about timestamps means. Annotation can embed the running timestamp in the video and filenames also normally include timestamp.
Wow, seriously Robert, you are amazing! I'll have a play with this over the weekend! A really big thank you!! Is your Donation link still working?

I need to test a little bit more, but when I had recording on 24/7, with Video Split set to 1800, it stopped converting the .mp4.h264 to .mp4 after a while. As a result, the PurgeSpace_level failed to work because it seems to ignore the .h264 files, filling up my Pi and preventing the video from recording. It could be there's not enough space to do the conversion, so will leave it overnight at 10 min video splits to see if that helps.


Regarding timestamps, I've done a fresh install of everything and it's all ok now, so not sure what I did wrong before.

Thanks again!!
Hi Robert, I think there's a bug with Monitor mode and the Video Split feature. If I enable Monitor mode and set Video Split to say 120, then press Record Video Start, the recording stops at the end of the first split. If I then change the mode back to Internal and start recording again, the video splits as expected and continues to record.

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

Re: RPi Cam Web Interface

Sun Apr 30, 2017 1:44 pm

quavoce wrote: Hi Robert, I think there's a bug with Monitor mode and the Video Split feature. If I enable Monitor mode and set Video Split to say 120, then press Record Video Start, the recording stops at the end of the first split. If I then change the mode back to Internal and start recording again, the video splits as expected and continues to record.
Hmm, something's not quite right here as I left it running with video split at 10 mins (motion detection off), but around 30 mins ago it stopped for some reason. (button on website back to "Record Video Start"

This is a fresh RPi v3 Jessie install with v6.3.4

Code: Select all

pi@cam:/var/www/html/media $ ls  -al
total 6252388
drwxr-xr-x 2 www-data www-data      4096 Apr 30 14:13 .
drwxr-xr-x 7 www-data www-data      4096 Apr 29 19:40 ..
-rw-r--r-- 1 www-data www-data 359986844 Apr 29 20:02 vi_0001_20170429_195125.mp4
-rw-r--r-- 1 www-data www-data     60115 Apr 29 19:51 vi_0001_20170429_195125.mp4.v0001.th.jpg
-rw-r--r-- 1 www-data www-data 390006435 Apr 29 20:13 vi_0002_20170429_200228.mp4
-rw-r--r-- 1 www-data www-data     59114 Apr 29 20:02 vi_0002_20170429_200228.mp4.v0002.th.jpg
-rw-r--r-- 1 www-data www-data 750229004 Apr 30 08:24 vi_0003_20170430_081045.mp4
-rw-r--r-- 1 www-data www-data     62969 Apr 30 08:10 vi_0003_20170430_081045.mp4.v0003.th.jpg
-rw-r--r-- 1 www-data www-data  66240101 Apr 30 12:46 vi_0004_20170430_124548.mp4
-rw-r--r-- 1 www-data www-data     63059 Apr 30 12:45 vi_0004_20170430_124548.mp4.v0004.th.jpg
-rw-r--r-- 1 www-data www-data  80021922 Apr 30 12:48 vi_0005_20170430_124730.mp4
-rw-r--r-- 1 www-data www-data     64183 Apr 30 12:47 vi_0005_20170430_124730.mp4.v0005.th.jpg
-rw-r--r-- 1 www-data www-data  74062757 Apr 30 12:49 vi_0006_20170430_124830.mp4
-rw-r--r-- 1 www-data www-data     63850 Apr 30 12:48 vi_0006_20170430_124830.mp4.v0006.th.jpg
-rw-r--r-- 1 www-data www-data  29042203 Apr 30 12:49 vi_0007_20170430_124930.mp4
-rw-r--r-- 1 www-data www-data     63961 Apr 30 12:49 vi_0007_20170430_124930.mp4.v0007.th.jpg
-rw-r--r-- 1 www-data www-data 144667132 Apr 30 12:52 vi_0008_20170430_125011.mp4
-rw-r--r-- 1 www-data www-data     63512 Apr 30 12:50 vi_0008_20170430_125011.mp4.v0008.th.jpg
-rw-r--r-- 1 www-data www-data 694668087 Apr 30 13:11 vi_0009_20170430_125810.mp4
-rw-r--r-- 1 www-data www-data     63088 Apr 30 12:58 vi_0009_20170430_125810.mp4.v0009.th.jpg
-rw-r--r-- 1 www-data www-data 647304349 Apr 30 13:21 vi_0010_20170430_130811.mp4
-rw-r--r-- 1 www-data www-data     62449 Apr 30 13:08 vi_0010_20170430_130811.mp4.v0010.th.jpg
-rw-r--r-- 1 www-data www-data 627568780 Apr 30 13:31 vi_0011_20170430_131810.mp4
-rw-r--r-- 1 www-data www-data     63951 Apr 30 13:18 vi_0011_20170430_131810.mp4.v0011.th.jpg
-rw-r--r-- 1 www-data www-data 604600119 Apr 30 13:41 vi_0012_20170430_132811.mp4
-rw-r--r-- 1 www-data www-data     62394 Apr 30 13:28 vi_0012_20170430_132811.mp4.v0012.th.jpg
-rw-r--r-- 1 www-data www-data 661485859 Apr 30 13:51 vi_0013_20170430_133811.mp4
-rw-r--r-- 1 www-data www-data     63527 Apr 30 13:38 vi_0013_20170430_133811.mp4.v0013.th.jpg
-rw-r--r-- 1 www-data www-data 560434951 Apr 30 14:01 vi_0014_20170430_134811.mp4
-rw-r--r-- 1 www-data www-data     62833 Apr 30 13:48 vi_0014_20170430_134811.mp4.v0014.th.jpg
-rw-r--r-- 1 www-data www-data 511521056 Apr 30 14:13 vi_0015_20170430_135811.mp4
-rw-r--r-- 1 www-data www-data     61831 Apr 30 13:58 vi_0015_20170430_135811.mp4.v0015.th.jpg
-rw-r--r-- 1 www-data www-data 199473024 Apr 30 14:11 vi_0016_20170430_140811.mp4.h264
-rw-r--r-- 1 www-data www-data     63624 Apr 30 14:08 vi_0016_20170430_140811.mp4.v0016.th.jpg

pi@cam:/var/www/html/media $ date
Sun 30 Apr 14:39:05 BST 2017

pi@cam:/var/www/html/media $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G   11G  3.9G  73% /
devtmpfs        426M     0  426M   0% /dev
tmpfs           430M   68K  430M   1% /dev/shm
tmpfs           430M  5.9M  425M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           430M     0  430M   0% /sys/fs/cgroup
/dev/mmcblk0p1   63M   21M   42M  34% /boot
tmpfs            86M     0   86M   0% /run/user/33
tmpfs            86M     0   86M   0% /run/user/1000

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

Re: RPi Cam Web Interface

Mon May 01, 2017 9:36 am

quavoce wrote:
Hmm, something's not quite right here as I left it running with video split at 10 mins (motion detection off), but around 30 mins ago it stopped for some reason. (button on website back to "Record Video Start"

This is a fresh RPi v3 Jessie install with v6.3.4
I'm doing some more testing on this. So far it seemed OK for me.

The presence of a h264 file means that something has prevented the Mp4Box operation from converting it to mp4.

The scheduler log should gives some clues as to what is going on.

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

Re: RPi Cam Web Interface

Mon May 01, 2017 9:45 am

KC3HUB wrote:Greetings, btidey and Thank You! I'm excited to join the group of CWI users. Just found all this yesterday after floundering through Motion.

From Jan 26, 2016:
...PMM wrote: motion: no process found
php: no process found
bash: php:command not found
Any suggestions to get over the first hurdle?....

...You replied: Those messages are warnings and not necessarily anything to worry about. They occur when processes are trying to be stopped but are not actually already running. I assume you used ./install.sh method. What settings did you choose (subfolder, autostart, server, port, user, password)? Have you then tried browsing to http://cameraIP/subfolder (replace by actual values)? What do you see? ....


He never replied but, "bash: php: command not found" is my only hurdle at the moment on a Zero W with CWI as the first thing installed following WIKI instructions using ./install.sh method. So I'll give you my answers.

My installation picks were: picam, Yes, Apache, 80, no user or pass for now. I type http://10.0.0.10/picam in Chrome and just get a standard 'cannot be displayed' message. Also, on reboot, no LED on camera module (as an extra datapoint).
When you say Apache did you leave it or enter it as apache? Case matters here.
Was autostart set to true?

It is harmless to rerun the install again on top of an existing one. So I suggest that as the first step.

KC3HUB
Posts: 8
Joined: Fri Apr 28, 2017 12:27 pm

Re: RPi Cam Web Interface

Mon May 01, 2017 10:30 pm

This is going to be ugly, so apologies in advance. I'm a Windows baby and my enthusiasm for RPi and Linux is no substitute for experience. The end of the story: CWI is working flawlessly on Pi 3b that's wired to the Internet...

For the new users just joining, NOOBS 2.4 is happy to help load a Pi Zero W through wi-fi except mine didn't recognize the camera module no way no how even after upgrade, update and install commands in terminal.

NOOBS 2.4 will NOT help load a Pi 3b through wi-fi no way no how even after upgrade, update and install commands in terminal but it DOES recognize the camera module.

I verified numerous combinations of connectors, PiCamera, PiNoir, Pi 3b's and Zero W's spending hours doing so. (They're so cheap I've bought several in order to smash out tests and play.) I have mentally lost track of so many things and the final success doesn't mirror what I want but the CWI software works exactly as expected assuming no underlying problems.

"Apache" should in fact have been 'apache' and yes to autostart in the previous post. The error was the Zero W refusing to recognize the camera module no matter what I tried. Even a simple py script in 2.7.9 (? or 2.9.7 ?) returned a handful of errors deep in lines of code for 'camera.py'; that same code worked just fine in an older Pi 3b installation.

Whatever problem I'm facing is far beyond my understanding but it wasn't CWI, so I'll keep watching this big-ol' thread but I'll not junk it up by carrying on. My best guess is that current new users like me are encountering some flaw in new initial downloads that affect CWI. My best success with all new software is on a Pi 3b that still can't find the Bluetooth or Wi-fi Interface even after updates via wired connection.

*EDIT* Confirming NOOBS Lite 2.4 with network install for that Raspbian Lite version will work CWI on Zero W after

Code: Select all

sudo apt-get install git
to do that clone step. Drops a few frames here and there; not a big problem for me.

User avatar
Mettauk
Posts: 235
Joined: Mon Dec 10, 2012 12:40 pm
Location: Zarg

Re: RPi Cam Web Interface

Tue May 02, 2017 7:35 pm

RPi Cam Pan and Tilt fails after running sudo apt-get update && sudo apt-get dist-upgrade. Also having other problems unrelated to RPi Cam but all since updating a number of Pi on 1 May 2017

Anyone know whats going on? or has the same problem?
As humans we have been the same for a very very long time, technology changes how we do... not who we are as people.

Gary Littlemore
Posts: 327
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK

Re: RPi Cam Web Interface

Wed May 03, 2017 11:56 am

Robert, my Jessie Lite still isn't updating using the ./update.sh I've just gone from 6.3.3 tried to ./update.sh first and then had to remove the /RPi_Cam_Web_Interface/ folder and re-git clone to get the 6.3.4 update.
3b+, 2b, b+, b, Zero & Zero-W

Gary Littlemore
Posts: 327
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK

Re: RPi Cam Web Interface

Wed May 03, 2017 8:53 pm

I thought it might be a little easier to track problems/resolve problems, discuss ideas with a Facebook page; come along give it a like.

http://www.facebook.com/RPiCamWebInterface
3b+, 2b, b+, b, Zero & Zero-W

KC3HUB
Posts: 8
Joined: Fri Apr 28, 2017 12:27 pm

Permissions

Thu May 04, 2017 7:07 am

I've read through the docs and may have missed it, but can different user/pswd visitors be granted different permissions? The mini.php is fine but is there some on/off hierarchy for the "full" features list where more sensitive or destructive options can be omitted from view or watermarked?

Loving my time with this! Got the Zero W trimmed and running perfectly.

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

Re: Permissions

Thu May 04, 2017 10:28 am

KC3HUB wrote:I've read through the docs and may have missed it, but can different user/pswd visitors be granted different permissions? The mini.php is fine but is there some on/off hierarchy for the "full" features list where more sensitive or destructive options can be omitted from view or watermarked?

Loving my time with this! Got the Zero W trimmed and running perfectly.
There is nothing explicitly built in to grant different permissions.

Somebody earlier in this thread did some work on using a different user type login with a database. This allowed creation of different users but I don't think there was support for different permissions.

One simple approach would be to create an alternative index.php with say settings stripped out but still accessing download pages and having the buttons.

The .htpasswd could then be edited to give different user login/password for that.

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

Re: RPi Cam Web Interface

Thu May 04, 2017 10:32 am

Gary Littlemore wrote:Robert, my Jessie Lite still isn't updating using the ./update.sh I've just gone from 6.3.3 tried to ./update.sh first and then had to remove the /RPi_Cam_Web_Interface/ folder and re-git clone to get the 6.3.4 update.
What sort of error did you get? DId it fetch OK and run the installer or did it fail to fetch the update?

Previously there was a problem with the git pull method but that was changed to fetch

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

Re: Permissions

Fri May 05, 2017 5:51 am

btidey wrote:
KC3HUB wrote:I've read through the docs and may have missed it, but can different user/pswd visitors be granted different permissions? The mini.php is fine but is there some on/off hierarchy for the "full" features list where more sensitive or destructive options can be omitted from view or watermarked?

Loving my time with this! Got the Zero W trimmed and running perfectly.
There is nothing explicitly built in to grant different permissions.

Somebody earlier in this thread did some work on using a different user type login with a database. This allowed creation of different users but I don't think there was support for different permissions.

One simple approach would be to create an alternative index.php with say settings stripped out but still accessing download pages and having the buttons.

The .htpasswd could then be edited to give different user login/password for that.
Hi Robert, that would have been me, but unfortunately I realised it was somewhat insecure as you could still access things like cam.jpg and your recorded media if you knew the URLs, so I've gone back to .htaccess for now.

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

Re: Permissions

Fri May 05, 2017 10:43 am

btidey wrote:
KC3HUB wrote:I've read through the docs and may have missed it, but can different user/pswd visitors be granted different permissions? The mini.php is fine but is there some on/off hierarchy for the "full" features list where more sensitive or destructive options can be omitted from view or watermarked?

Loving my time with this! Got the Zero W trimmed and running perfectly.
There is nothing explicitly built in to grant different permissions.

Somebody earlier in this thread did some work on using a different user type login with a database. This allowed creation of different users but I don't think there was support for different permissions.

One simple approach would be to create an alternative index.php with say settings stripped out but still accessing download pages and having the buttons.

The .htpasswd could then be edited to give different user login/password for that.
I've been doing a bit more thinking about what might be possible without too much rework.

Currently there is a 'normal' and a 'simple' main display mode which may be toggled by any user. Simple gives just the preview screen while normal allows everything.

I could possibly change this so there are 3 display modes.

Full - like 'normal' gives access to everything
User - Preview, action buttons and access to download; no Schedule settings, no motion settings, no camera settings, no system control.
Simple - Just preview

The server can get access to the name of the login user if .htaccess is used. This would potentially allow the server to switch the display mode based on the name of the user. To keep things simple one could have just a user config file listing user names and the display mode to be used. This would be initially just be set up off-line.

Any comments? Are people interested in this functionality?

Gary Littlemore
Posts: 327
Joined: Thu Oct 11, 2012 11:52 am
Location: Cheshire, UK

Re: RPi Cam Web Interface

Fri May 05, 2017 12:17 pm

btidey wrote:
Gary Littlemore wrote:Robert, my Jessie Lite still isn't updating using the ./update.sh I've just gone from 6.3.3 tried to ./update.sh first and then had to remove the /RPi_Cam_Web_Interface/ folder and re-git clone to get the 6.3.4 update.
What sort of error did you get? DId it fetch OK and run the installer or did it fail to fetch the update?

Previously there was a problem with the git pull method but that was changed to fetch
I didn't get any error, it appeared to fetch okay and the installer ran but it was still on 6.3.3 when I'd rebooted.
3b+, 2b, b+, b, Zero & Zero-W

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

Re: RPi Cam Web Interface

Fri May 05, 2017 3:21 pm

quavoce wrote: Hi Robert, I think there's a bug with Monitor mode and the Video Split feature. If I enable Monitor mode and set Video Split to say 120, then press Record Video Start, the recording stops at the end of the first split. If I then change the mode back to Internal and start recording again, the video splits as expected and continues to record.
I've been able to repeat the above problem on a new Pi with a fresh Jessie install and camera, but this time I have some error messages for you. :)

As I hadn't logged out of the ssh window after installing RPi Web Cam, the error messages appeared on standard out as soon as the 120 seconds were up:

Code: Select all

mmal: mmal_vc_port_info_set: failed to set port info (2:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x1df8ba0 (EINVAL)
mmal: mmal_connection_create: format not set on input port
mmal: mmal_connection_destroy_internal: connection vc.ril.camera:out:1/vc.ril.video_encode:in:0 could not be cleared
The scheduleLog.txt shows:

Code: Select all

{2017/05/05 14:21:31} RaspiMJPEG Version 5.8.02
{2017/05/05 14:21:31} recommended video buffer size 65536
{2017/05/05 14:21:31} h264 size set to 131072
{2017/05/05 14:21:31} recommended video buffers 1
{2017/05/05 14:21:31} h264 buffers set to recommended 1
{2017/05/05 14:21:31} Opening FIFO 0 /var/www/html/FIFO 6
{2017/05/05 14:21:31} Opening FIFO 1 /var/www/html/FIFO11 7
{2017/05/05 14:21:31} MJPEG streaming, ready to receive commands
{2017/05/05 14:21:31} send smd 9
[2017/05/05 14:21:32] RaspiCam support started
[2017/05/05 14:21:32] Capture Pipe already exists /var/www/html/FIFO1
[2017/05/05 14:21:32] Scheduler loop is started
{2017/05/05 14:21:32} Starting command loop
[2017/05/05 14:21:32] Reload parameters command requested
[2017/05/05 14:21:32] Scheduler loop is started
[2017/05/05 14:21:33] New period detected 0
[2017/05/05 14:21:33] Scheduled management tasks. Next at 1493997693
{2017/05/05 14:22:07} Change: rotation = 180
{2017/05/05 14:22:22} Change: video_width = 1296
{2017/05/05 14:22:22} Change: video_height = 972
{2017/05/05 14:22:22} Change: video_fps = 25
{2017/05/05 14:22:22} Change: MP4Box_fps = 25
{2017/05/05 14:22:22} Change: image_width = 2592
{2017/05/05 14:22:22} Change: image_height = 1944
{2017/05/05 14:22:22} recommended video buffer size 65536
{2017/05/05 14:22:22} h264 size set to 131072
{2017/05/05 14:22:22} recommended video buffers 1
{2017/05/05 14:22:22} h264 buffers set to recommended 1
{2017/05/05 14:22:35} Change: quality = 10
{2017/05/05 14:22:35} Change: width = 800
{2017/05/05 14:22:35} Change: divider = 1
{2017/05/05 14:22:35} recommended video buffer size 65536
{2017/05/05 14:22:35} h264 size set to 131072
{2017/05/05 14:22:35} recommended video buffers 1
{2017/05/05 14:22:35} h264 buffers set to recommended 1
{2017/05/05 14:22:52} Change: rotation = 0
{2017/05/05 15:09:30} Change: motion_external = 2
{2017/05/05 15:09:59} Change: annotation = RPi Cam %Y.%M.%D_%h:%m:%s %c %f
{2017/05/05 15:10:35} Change: video_split = 120
{2017/05/05 15:11:33} Capturing with split of 120 seconds
{2017/05/05 15:11:33} Capturing started
{2017/05/05 15:13:33} Stopping video from timer
{2017/05/05 15:13:33} Capturing stopped
{2017/05/05 15:13:33} Add /var/www/html/media/vi_0000_20170505_151133.mp4 to Box Queue at pos 0
{2017/05/05 15:13:33} Restarting next split of 120 seconds
{2017/05/05 15:13:33} Error: Could not create connection camera -> video converter
{2017/05/05 15:13:34} Start boxing /var/www/html/media/vi_0000_20170505_151133.mp4.h264 to /var/www/html/media/vi_0000_20170505_151133.mp4 Queue pos 0
{2017/05/05 15:13:39} Finished boxing /var/www/html/media/vi_0000_20170505_151133.mp4 from Box Queue at pos 0
{2017/05/05 15:13:41} Removed item from Box Queue
{2017/05/05 15:13:44} Watchdog detected problem. Stopping{2017/05/05 15:13:45} SIGINT/SIGTERM received, stopping
{2017/05/05 15:13:50} RaspiMJPEG Version 5.8.02
{2017/05/05 15:13:50} recommended video buffer size 65536
{2017/05/05 15:13:50} h264 size set to 131072
{2017/05/05 15:13:50} recommended video buffers 1
{2017/05/05 15:13:50} h264 buffers set to recommended 1
{2017/05/05 15:13:50} Set up internal detect width=82 height=61
{2017/05/05 15:13:50} Opening FIFO 0 /var/www/html/FIFO 7
{2017/05/05 15:13:50} Opening FIFO 1 /var/www/html/FIFO11 8
{2017/05/05 15:13:50} MJPEG streaming, ready to receive commands
{2017/05/05 15:13:50} send smd 9
{2017/05/05 15:13:50} Starting command loop
[2017/05/05 15:13:50] Reload parameters command requested
[2017/05/05 15:13:50] Scheduler loop is started
[2017/05/05 15:13:51] New period detected 0
[2017/05/05 15:13:51] Scheduled management tasks. Next at 1494000831
The other problem with video split not working after a while is something I'll test further as this needs to be left running for a while before it occurs.

Thanks.

KC3HUB
Posts: 8
Joined: Fri Apr 28, 2017 12:27 pm

Re: Permissions

Sat May 06, 2017 3:04 am

btidey wrote: ...

I could possibly change this so there are 3 display modes.

Full - like 'normal' gives access to everything
User - Preview, action buttons and access to download; no Schedule settings, no motion settings, no camera settings, no system control.
Simple - Just preview

The server can get access to the name of the login user if .htaccess is used. This would potentially allow the server to switch the display mode based on the name of the user. To keep things simple one could have just a user config file listing user names and the display mode to be used. This would be initially just be set up off-line.

Any comments? Are people interested in this functionality?
I certainly like it. I'd swamp through something mediocre if I were doing it in order to achieve Master, Monitor and Visitor accounts leaving min.php for something elementary - seems like 'min' was intended to embed in a page as part of more content (just a guess). In elinux.org there's a simple start to adding new user/pass logins and my goal is to provide CWI loaded Zero W's to a museum for both security and later as guest webcams. "Full" is far too much access for every single human viewer, and Simple seems superfluous unless you have to hide buttons in a hurry.

Having a mid-level account with no access to destructive settings, on/off settings or schedule settings feels totally natural to me. They can still adjust some qualities and my friends and museum folks are nowhere near even guessing how to reverse engineer links or connect to php files. They're smart enough, just not curious enough. If there was a real hacking vulnerability, then min.php would already be trickier to omit from the url to access the login or controls (depending on pw being set or not), right?

Return to “Camera board”