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

Re: RPi Cam Web Interface

Tue May 17, 2016 10:37 am

centos90 wrote:Hi, I need some help to get this running, see errors below. thanks
The listing looks a bit confusing. It looks like you are trying to start the system but it's not clear what you have installed.

The easiest way to get this going is to start with clean rasbian, and then follow the 4 steps on the wiki. http://elinux.org/index.php?title=RPi-Cam-Web-Interface

In particular, use the ./install.sh method to install and just use defaults first time round.

centos90
Posts: 25
Joined: Fri Jul 31, 2015 4:18 pm

Re: RPi Cam Web Interface

Tue May 17, 2016 11:14 am

Thanks for the info,
I followed very closely the following link http://elinux.org/index.php?title=RPi-Cam-Web-Interface
I am running raspbian jessie
should this work OK with a usb camera? or it only works with a raspberry pi camera board?

the output I get after starting RPi Cam Web Interface

Code: Select all

sudo sh start.sh
+ readlink -f start.sh
+ dirname /home/pi/RPi_Cam_Web_Interface/start.sh
+ cd /home/pi/RPi_Cam_Web_Interface
+ source ./config.txt
start.sh: 40: start.sh: source: not found
+ fn_stop
+ sudo killall raspimjpeg
raspimjpeg: no process found
+ sudo killall php
php: no process found
+ sudo killall motion
motion: no process found
+ sudo mkdir -p /dev/shm/mjpeg
+ sudo chown www-data:www-data /dev/shm/mjpeg
+ sudo chmod 777 /dev/shm/mjpeg
+ sleep 1
+ sudo su -c raspimjpeg > /dev/null & www-data
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
sh: 1: /var/www/html/macros/error_hard.sh: Permission denied
+ [ -e /etc/debian_version ]
+ sleep 1
+ sudo su -c php /var/www//schedule.php > /dev/null & www-data
pi@raspberrypi:~/RPi_Cam_Web_Interface $ mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
sh: 1: /var/www/html/macros/error_hard.sh: Permission denied
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)

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

Re: RPi Cam Web Interface

Tue May 17, 2016 11:30 am

centos90 wrote:Thanks for the info,
I followed very closely the following link http://elinux.org/index.php?title=RPi-Cam-Web-Interface
I am running raspbian jessie
should this work OK with a usb camera? or it only works with a raspberry pi camera board?

the output I get after starting RPi Cam Web Interface

Code: Select all

sudo sh start.sh
+ readlink -f start.sh
+ dirname /home/pi/RPi_Cam_Web_Interface/start.sh
+ cd /home/pi/RPi_Cam_Web_Interface
+ source ./config.txt
start.sh: 40: start.sh: source: not found
+ fn_stop
+ sudo killall raspimjpeg
raspimjpeg: no process found
+ sudo killall php
php: no process found
+ sudo killall motion
motion: no process found
+ sudo mkdir -p /dev/shm/mjpeg
+ sudo chown www-data:www-data /dev/shm/mjpeg
+ sudo chmod 777 /dev/shm/mjpeg
+ sleep 1
+ sudo su -c raspimjpeg > /dev/null & www-data
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
sh: 1: /var/www/html/macros/error_hard.sh: Permission denied
+ [ -e /etc/debian_version ]
+ sleep 1
+ sudo su -c php /var/www//schedule.php > /dev/null & www-data
pi@raspberrypi:~/RPi_Cam_Web_Interface $ mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
sh: 1: /var/www/html/macros/error_hard.sh: Permission denied
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
This software only works with a Raspberry Pi camera. It takes advantage of more sophisticated access to the camera system via the MMAL interface. It will not work with USB cameras.

centos90
Posts: 25
Joined: Fri Jul 31, 2015 4:18 pm

Re: RPi Cam Web Interface

Tue May 17, 2016 11:32 am

when I open the browser it says http://192.168.1.7/html
error in raspimjpeg
the log says
http://192.168.1.7/html/schedule.php
{2016/05/17 11:30:23} RaspiMJPEG Version 5.5.2
{2016/05/17 11:30:23} Error: Could not create camera
{2016/05/17 11:30:23} Executing macro /var/www/html/macros/error_hard.sh "Could not create camera"

centos90
Posts: 25
Joined: Fri Jul 31, 2015 4:18 pm

Re: RPi Cam Web Interface

Tue May 17, 2016 11:34 am

OK I thought it was the camera. are there any similar programs which will work with a usb camera? thanks

cweveritt
Posts: 5
Joined: Wed Oct 02, 2013 12:05 am

Re: RPi Cam Web Interface

Thu May 19, 2016 4:06 am

Have tried numerous times to follow the 4 step Installation Instructions at: http://elinux.org/RPi-Cam-Web-Interface starting with a fresh install of 2015-05-05 raspbian-wheezy.img. After this I enter the ip address and get a web page saying:

It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.

I had it working a year or so and am trying to get back into it. Can't figure out what has changed. Would appreciate someone giving me a hand.
Thanks!

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

Re: RPi Cam Web Interface

Thu May 19, 2016 7:01 pm

cweveritt wrote:Have tried numerous times to follow the 4 step Installation Instructions at: http://elinux.org/RPi-Cam-Web-Interface starting with a fresh install of 2015-05-05 raspbian-wheezy.img. After this I enter the ip address and get a web page saying:

It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.

I had it working a year or so and am trying to get back into it. Can't figure out what has changed. Would appreciate someone giving me a hand.
Thanks!
I assume you are using the ./install.sh method to install as this is now the recommended method.

I would start with a fresh install of the latest Jessie (10 May 2016). Although I have used it with Wheezy there is no reason not to use the latest version. I have just done several of these recently and they worked without any fiddling around. When the settings page comes up at the beginning of the install then to keep it as simple as possible clear out the html from subfolder and use all the other defaults. This will install the web material into /var/www

If this does not work for you then get the install.txt from the RPi_Cam_Web_Interface folder, zip it and post it here. This shows all the commands run during the install.

User avatar
Mariannev
Posts: 5
Joined: Tue May 24, 2016 3:00 pm

Re: RPi Cam Web Interface

Tue May 24, 2016 11:19 pm

First, thanks for this software, i tried 3 other options to stream to my website wich i couldn't get to work.
i have my Pi for a month now and am pretty new to this stuff but i learn a lot. but it works now !

My goal is to have a public accessable cam on a website which guests can control with the pipan without logging in.
And the system panel secured with password in an other directory.

I understand in the post above that this can be done with a separate "admin" subfolder, wich then will be secured seperate with .htacces. as descriped in the link.

I have two related questions:
1: do i have to remove and re-install Rpi_cam_web_interface to change the subfolder... or can i edit some settings, or simply run install.sh again ?(this is the method i used for basic install).

2: can the public accessible cam, stream, preview etc, and pan/tilt functions, be accessed through the standard portnumber 80, and the admin stuff over a custom port, to make it harder to find ?

I have the latest Pi 3, with the latest jessie of this month.

Thnks
Mv

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

Re: RPi Cam Web Interface

Wed May 25, 2016 9:56 am

Mariannev wrote:First, thanks for this software, i tried 3 other options to stream to my website wich i couldn't get to work.
i have my Pi for a month now and am pretty new to this stuff but i learn a lot. but it works now !

My goal is to have a public accessable cam on a website which guests can control with the pipan without logging in.
And the system panel secured with password in an other directory.

I understand in the post above that this can be done with a separate "admin" subfolder, wich then will be secured seperate with .htacces. as descriped in the link.

I have two related questions:
1: do i have to remove and re-install Rpi_cam_web_interface to change the subfolder... or can i edit some settings, or simply run install.sh again ?(this is the method i used for basic install).

2: can the public accessible cam, stream, preview etc, and pan/tilt functions, be accessed through the standard portnumber 80, and the admin stuff over a custom port, to make it harder to find ?

I have the latest Pi 3, with the latest jessie of this month.

Thnks
Mv
1. Just run the ./install.sh again to change settings. It runs pretty quickly after the initial install as it doesn't need to download all the bigger items. It does try to move media files from the previous location to the new but if you have any valuable captures I would back them up first to be safe.

2. Currently the password mechanism secures access to the whole site. by admin I suppose you mean access to the camera settings etc and ordinary users would still see the downloads page. The settings are part of the main index page so something extra would need to be done to achieve that.

User avatar
Mariannev
Posts: 5
Joined: Tue May 24, 2016 3:00 pm

Re: RPi Cam Web Interface

Wed May 25, 2016 9:49 pm

nthnm wrote:To have a basic non-controllable view page (untested, but pretty sure it should work as stated):

1. When prompted for a directory during the RPi_Cam install, enter "admin"
2. Follow the instructions here to password protect the admin directory.
3. From the www directory, "sudo ln -T admin/cam_pic.php cam_pic.php"
4. Download the file from the post above and unzip it to www.
I did the testing for you, it works,
I took a slightly different approach, i put the two files in the document root , /var/www/ plus the link to cam_pic.php.
The owner and group of the file is www-data.
Is this safe this way ? Now i have to study PHP, to split up the index.php to get the pipan controls also in the public directory /var/www.
Thanks for the help
( found out how to reply with quotes , hope this works out this time)

bismosa
Posts: 40
Joined: Sun Dec 23, 2012 11:43 am

Re: RPi Cam Web Interface

Fri May 27, 2016 3:46 pm

Hello!
Great work! Thank you!

I have a few questions:
1.) Every few hours the motion detection stops. But i cant find out why.
My setup:
Raspberry PI B+
Overclock: Medium (core_freq=250;sdram_freq=450;over_voltage=2)
MPEG2 License: yes
gpu_mem=128
disable_camera_led=1

Im using the last Raspian Jessie image from 2016-05-10 on a 16GB SD-Card. I use an extra 8GB USB-Stick to save images and videos.
Changed settings in Web-Interface:
Preset: Max View
Annotation: RPi Cam %Y.%M.%D_%h:%m:%s:%u Motion:%c
Buffer: 1000
Motion Detect: Internal
Rotation: 90

Schedule Settings: Period Start: md 1;tl 1

Every few hours the motion detection and the timelapse stops. I cant find any reason for that. The last lines in the log:

Code: Select all

{2016/05/27 15:49:33} Capturing image
{2016/05/27 15:49:36} Capturing image
{2016/05/27 15:49:39} Capturing image
{2016/05/27 15:49:42} Capturing image
{2016/05/27 15:49:44} send smd 1
[2016/05/27 15:49:44] Start capture requested from Pipe
[2016/05/27 15:49:44] Send ca 1
{2016/05/27 15:49:44} Executing macro /var/www/html/macros/start_vid.sh "/var/www/html/media/vi_0171_20160527_154944.mp4" &
{2016/05/27 15:49:44} Capturing started
{2016/05/27 15:49:45} Capturing image
{2016/05/27 15:49:48} Capturing image
{2016/05/27 15:49:51} Capturing image
{2016/05/27 15:49:54} Capturing image
{2016/05/27 15:49:55} send smd 0
[2016/05/27 15:49:55] Stop capture requested
[2016/05/27 15:49:55] Send ca 0
{2016/05/27 15:49:55} send smd 1
{2016/05/27 15:49:55} Capturing stopped
{2016/05/27 15:49:55} Add /var/www/html/media/vi_0171_20160527_154944.mp4 to Box Queue at pos 0
{2016/05/27 15:49:56} Start boxing /var/www/html/media/vi_0171_20160527_154944.mp4.h264 to /var/www/html/media/vi_0171_20160527_154944.mp4 Queue pos 0
{2016/05/27 15:49:56} DEBUG 3
[2016/05/27 15:49:57] Start capture requested from Pipe
[2016/05/27 15:49:57] Send ca 1
{2016/05/27 15:49:57} Executing macro /var/www/html/macros/start_vid.sh "/var/www/html/media/vi_0172_20160527_154957.mp4" &
{2016/05/27 15:49:57} Capturing started
{2016/05/27 15:49:57} Capturing image
{2016/05/27 15:49:59} Finished boxing /var/www/html/media/vi_0171_20160527_154944.mp4 from Box Queue at pos 0
{2016/05/27 15:49:59} Removed item from Box Queue
{2016/05/27 15:50:01} Capturing image
{2016/05/27 15:50:07} Capturing image
{2016/05/27 15:50:10} Capturing image
{2016/05/27 15:50:13} Capturing image
{2016/05/27 15:50:16} Capturing image
{2016/05/27 15:50:27} Watchdog detected problem. Stopping{2016/05/27 15:50:27} SIGINT/SIGTERM received, stopping
{2016/05/27 15:50:35} RaspiMJPEG Version 5.5.2
{2016/05/27 15:50:35} recommended video buffers 1
{2016/05/27 15:50:35} h264 buffers set to recommended 1
{2016/05/27 15:50:35} Set up internal detect width=82 height=61
{2016/05/27 15:50:35} MJPEG streaming, ready to receive commands
{2016/05/27 15:50:35} send smd 9
[2016/05/27 15:50:35] Reload parameters command requested
[2016/05/27 15:50:35] Scheduler loop is started
{2016/05/27 15:50:35} Starting command loop
{2016/05/27 15:50:35} DEBUG 3
[2016/05/27 15:50:36] Scheduled management tasks. Next at 1464360636
What can i do to avoid this?
Or how can i self detect (and reboot) if this happens?
Or can i set a cron and restart motion and timelapse every minute to "manually" restart capturing? if i use:

Code: Select all

echo -n 'tl 1' > /var/www/html/FIFO
echo -n 'md 1' > /var/www/html/FIFO
The timelapse and motion detection are working again.

2.) How many GPU Memory is required? What is the "best" setting?

3.) Is it possible to change the log path? I dont want to stress the SD-Card. I think it will be better to save the log on the USB-Drive.

4.) I have many entrys in /var/log/messages

Code: Select all

May 26 13:10:52 cam motion: [1] [NTC] [NET] netcam_read_first_header: Non-streaming camera (keep-alive not set)
May 26 13:10:52 cam motion: [1] [NTC] [NET] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
May 26 13:10:52 cam motion: [1] [NTC] [NET] netcam_read_html_jpeg: leaving netcam connected.
May 26 13:10:52 cam motion: [1] [NTC] [NET] netcam_read_first_header: Found Conn: close header ('Connection: close')
After a reboot no more entrys...but what does that mean?

5.) If timelapse is running i have stuttering video in the preview and stuttering video on a recording. Is it the slowly raspberry? Works this better on a Raspberry Pi 2 (or 3)?

Thank you so much for this hard work!

Should i post this on an extra thread?

Regards
Bismosa

User avatar
jbeale
Posts: 3491
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Cam Web Interface

Fri May 27, 2016 7:24 pm

What does "Buffer: 1000" mean? I don't know that it's to blame here, but in general, I don't think any amount of overclock is guaranteed stable for all devices under all circumstances, otherwise it wouldn't be an overclock.

bismosa
Posts: 40
Joined: Sun Dec 23, 2012 11:43 am

Re: RPi Cam Web Interface

Fri May 27, 2016 8:18 pm

Hello,
buffer is the "Pre-Event Motion Capture Buffer". So the capture starts about 1 second before motion is detected. A very useful feature for me ;)

Generally i dont think that it is on overclocking. The raspberry is running otherwise perfect (before this i used it for my Squeezebox Server with the same settings...and i never had problems). Maybe a power supply problem? I will test it tomorrow.
Is there this problem-not otherwise?

Regards
Bismosa

User avatar
jbeale
Posts: 3491
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Cam Web Interface

Fri May 27, 2016 8:44 pm

If the problem is consistent, makes sense to me to try it without the overclock and see if that makes a difference. Running the camera is a different use-case than not running the camera, different hardware may be used, and more current demand also.

Meanwhile it is well established that a marginal power supply can cause trouble including a lockup, but normally you can see the problem before it happens with the colored square appearing at upper-right hand corner of the screen (well, unless you use the Pi headless, the square overlay is from the GPU HDMI output and doesn't appear on the camera output, and maybe it doesn't show on the original RPi 1 models?). But you can also check with a voltmeter if your +5V really is +5V.

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

Re: RPi Cam Web Interface

Fri May 27, 2016 10:38 pm

bismosa wrote:Hello,
buffer is the "Pre-Event Motion Capture Buffer". So the capture starts about 1 second before motion is detected. A very useful feature for me ;)

Generally i dont think that it is on overclocking. The raspberry is running otherwise perfect (before this i used it for my Squeezebox Server with the same settings...and i never had problems). Maybe a power supply problem? I will test it tomorrow.
Is there this problem-not otherwise?

Regards
Bismosa
Read somewhere that using internal motion capture the Buffer should be at least 3000, less causes problems. Sorry can't find the reference, maybe try the wiki
As humans we have been the same for a very very long time, technology changes how we do... not who we are as people.

bismosa
Posts: 40
Joined: Sun Dec 23, 2012 11:43 am

Re: RPi Cam Web Interface

Sat May 28, 2016 2:49 pm

Hello,

today i have tested with an other power supply and without overclock. After 6 hours the timelapse and motion detection stops again

Code: Select all

{2016/05/28 13:48:52} Capturing image
{2016/05/28 13:48:57} Capturing image
{2016/05/28 13:49:00} Capturing image
{2016/05/28 13:49:01} send smd 1
[2016/05/28 13:49:01] Start capture requested from Pipe
[2016/05/28 13:49:01] Send ca 1
{2016/05/28 13:49:01} Executing macro /var/www/html/macros/start_vid.sh "/var/www/html/media/vi_0016_20160528_134901.mp4" &
{2016/05/28 13:49:01} Capturing started
{2016/05/28 13:49:03} Capturing image
[2016/05/28 13:49:03] Send sy start.sh
{2016/05/28 13:49:03} Can't find macro /var/www/html/macros/start.sh
{2016/05/28 13:49:06} Capturing image
{2016/05/28 13:49:09} Capturing image
{2016/05/28 13:49:12} Capturing image
{2016/05/28 13:49:15} Capturing image
{2016/05/28 13:49:18} Capturing image
{2016/05/28 13:49:21} Capturing image
{2016/05/28 13:49:24} Capturing image
{2016/05/28 13:49:27} Capturing image
{2016/05/28 13:49:28} send smd 0
[2016/05/28 13:49:28] Stop capture requested
[2016/05/28 13:49:28] Send ca 0
{2016/05/28 13:49:28} Capturing stopped
{2016/05/28 13:49:28} Add /var/www/html/media/vi_0016_20160528_134901.mp4 to Box Queue at pos 3
{2016/05/28 13:49:28} Start boxing /var/www/html/media/vi_0016_20160528_134901.mp4.h264 to /var/www/html/media/vi_0016_20160528_134901.mp4 Queue pos 3
{2016/05/28 13:49:28} DEBUG 3
{2016/05/28 13:49:30} Capturing image
{2016/05/28 13:49:39} Watchdog detected problem. Stopping{2016/05/28 13:49:39} SIGINT/SIGTERM received, stopping
{2016/05/28 13:49:49} RaspiMJPEG Version 5.5.2
{2016/05/28 13:49:49} recommended video buffers 1
{2016/05/28 13:49:49} h264 buffers set to recommended 1
{2016/05/28 13:49:49} Set up internal detect width=82 height=61
{2016/05/28 13:49:49} MJPEG streaming, ready to receive commands
{2016/05/28 13:49:49} send smd 9
[2016/05/28 13:49:49] Reload parameters command requested
[2016/05/28 13:49:49] Scheduler loop is started
{2016/05/28 13:49:49} Starting command loop
{2016/05/28 13:49:49} DEBUG 3
[2016/05/28 13:49:50] New period detected 0
[2016/05/28 13:49:50] Send md 1
{2016/05/28 13:49:50} Executing macro /var/www/html/macros/do_cmd.sh "md 1" &
{2016/05/28 13:49:50} Internal motion detection started
{2016/05/28 13:49:50} recommended video buffers 1
{2016/05/28 13:49:50} h264 buffers set to recommended 1
{2016/05/28 13:49:50} Set up internal detect width=82 height=61
{2016/05/28 13:49:51} DEBUG 3
[2016/05/28 13:49:52] Send tl 1
{2016/05/28 13:49:52} Timelapse started
{2016/05/28 13:49:52} send smd 1
[2016/05/28 13:49:54] Scheduled management tasks. Next at 1464439790
[2016/05/28 13:49:54] Start capture requested from Pipe
[2016/05/28 13:49:54] Send ca 1
{2016/05/28 13:49:56} Executing macro /var/www/html/macros/start_vid.sh "/var/www/html/media/vi_0017_20160528_134954.mp4" &
{2016/05/28 13:49:56} Capturing started
{2016/05/28 13:49:56} Capturing image
{2016/05/28 13:49:59} Capturing image
{2016/05/28 13:50:10} Watchdog detected problem. Stopping{2016/05/28 13:50:11} SIGINT/SIGTERM received, stopping
{2016/05/28 13:50:28} RaspiMJPEG Version 5.5.2
{2016/05/28 13:50:28} recommended video buffers 1
{2016/05/28 13:50:28} h264 buffers set to recommended 1
{2016/05/28 13:50:28} Set up internal detect width=82 height=61
{2016/05/28 13:50:28} MJPEG streaming, ready to receive commands
{2016/05/28 13:50:28} send smd 9
{2016/05/28 13:50:28} Starting command loop
[2016/05/28 13:50:28] Reload parameters command requested
[2016/05/28 13:50:28] Scheduler loop is started
{2016/05/28 13:50:29} DEBUG 3
[2016/05/28 13:50:29] Scheduled management tasks. Next at 1464439829
[2016/05/28 14:50:30] Scheduled management tasks. Next at 1464443430
[2016/05/28 15:50:31] Scheduled management tasks. Next at 1464447031
/dev/shm/jpeg/status_mjpeg.txt: "ready"

It always seems to happen when boxing the video. But over 30 Videos have been recorded and boxed before without problems.
The Watchdog has in the 6 hours triggered 3 times.

By the way...if i remove "gpu_mem=128" from the config i get a reboot loop with this error in the log:
Error: Could not enable connection splitter -> video converter

Is it maybe wrong to set the Period AllDay - Period Start to "md 1;tl 1" ?

I have now changed the Buffer to "3000" but i dont think that this is the problem. What can i do to find the problem?

Regards
Bismosa

Los7
Posts: 2
Joined: Sat May 28, 2016 8:32 pm

Re: RPi Cam Web Interface

Sat May 28, 2016 8:51 pm

I am trying to use the servo feature. In /var/www/html I renamed servo_off to servo_on and the 4 pan tilt buttons appeared. But now, if I got it right from the wiki, I do not need the package from https://github.com/skalad/RPi_Cam_Web_I ... r_pan_tilt because it is outdated? The pan tilt feature should just work?
So, which GPIO pins give me the signal for the servos? In which file can I configure the pins?
Thanks for this great project!

peterwup
Posts: 5
Joined: Thu May 12, 2016 6:56 pm

Re: RPi Cam Web Interface

Sat May 28, 2016 11:42 pm

Hi,

I am using the great tool in combination with an external motion detection which support other webcams too.
At the moment I take a snapshot by: "http://cameraIPaddress/cam_pic.php" from another computer.
Is it possible to get a snapshot with a higher resolution in the same way ?
The snapshot software I use just accept static URLS.

kazuko.nakamura
Posts: 58
Joined: Sun May 29, 2016 7:14 am

Re: RPi Cam Web Interface

Sun May 29, 2016 7:37 am

Hi,

I've got two questions:

1. Is possible to change annotation position from top to bottom right?
2. Set red LED on when motion detected? (not necessary)

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

Re: RPi Cam Web Interface

Sun May 29, 2016 10:53 am

Los7 wrote:I am trying to use the servo feature. In /var/www/html I renamed servo_off to servo_on and the 4 pan tilt buttons appeared. But now, if I got it right from the wiki, I do not need the package from https://github.com/skalad/RPi_Cam_Web_I ... r_pan_tilt because it is outdated? The pan tilt feature should just work?
So, which GPIO pins give me the signal for the servos? In which file can I configure the pins?
Thanks for this great project!
Skalad did the original work on this but it then got modified and move into the standard version so that is all you need.

You need to install the servoblaster software. The servo mapping is

0 on P1-7 GPIO-4
1 on P1-11 GPIO-17
2 on P1-12 GPIO-18
3 on P1-13 GPIO-27
4 on P1-15 GPIO-22
5 on P1-16 GPIO-23
6 on P1-18 GPIO-24
7 on P1-22 GPIO-25

The software uses 0 for 'y' and 1 for 'x' directions.

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

Re: RPi Cam Web Interface

Sun May 29, 2016 11:05 am

peterwup wrote:Hi,

I am using the great tool in combination with an external motion detection which support other webcams too.
At the moment I take a snapshot by: "http://cameraIPaddress/cam_pic.php" from another computer.
Is it possible to get a snapshot with a higher resolution in the same way ?
The snapshot software I use just accept static URLS.
The cam_pic.php url is fetching the current 'preview image'. You can set up the resolution of this on the main settings page (preview width, height is calculated). So the easiest way is just to increase this setting. It will affect the size of the real time window and will also increase the bandiwidth being used to maintain the live display.

If you want a high resolution image capture then what you maybe want to do is send in a image capture command. This will take a real image capture at the resolution set up which can be up to full camera resolution. This image would be stored in the path for images (default the media folder). The method used depends a bit on what you are trying to do from these remote computers.

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

Re: RPi Cam Web Interface

Sun May 29, 2016 11:26 am

bismosa wrote:Hello,

today i have tested with an other power supply and without overclock. After 6 hours the timelapse and motion detection stops again


It always seems to happen when boxing the video. But over 30 Videos have been recorded and boxed before without problems.
The Watchdog has in the 6 hours triggered 3 times.

By the way...if i remove "gpu_mem=128" from the config i get a reboot loop with this error in the log:
Error: Could not enable connection splitter -> video converter

Is it maybe wrong to set the Period AllDay - Period Start to "md 1;tl 1" ?

I have now changed the Buffer to "3000" but i dont think that this is the problem. What can i do to find the problem?

Regards
Bismosa
FIrst, don't remove or reduce gpu_mem setting below 128. The GPU is being used to do multiple tasks here and needs that memory.

The log is indicating a problem when capture (lapse) is occurring during the boxing operation. Doing both time lapse and motion detection is possible but does put more stress on the system. This is causing the watchdog to time out and try to reset the operation. The timeout could be being triggered by a number of factors:

a) Could be the CPU is getting overloaded and not getting enough time to perform all the work within the watchdog period. This is more likely to happen with a Raspberry A or B (single core). You could try disabling the watchdog (set to 0).

b) It is still possible that power dips during the intensive periods are causing a problem. Although you have swapped the PSU, have you made sure the USB power cable is low resistance. I have seen several cases of problems caused by the quality if the USB cable causing excessive voltage drop.

I would also try doing a test run with just motion detection or just time lapse to see what the stability is,. This will help establish whether it is the capture during a box which is the initial trigger.

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

Re: RPi Cam Web Interface

Sun May 29, 2016 11:35 am

kazuko.nakamura wrote:Hi,

I've got two questions:

1. Is possible to change annotation position from top to bottom right?
2. Set red LED on when motion detected? (not necessary)
1. The position of the annotation is controlled by the MMAL camera interface software. Last time I checked there was no positional control.

2. This is possible using the macros facility. First you have to configure it to be off in the normal config.txt. There are two ways you can use the macros facility to then turn it on and off. You can then set up a start_vid to turn it on via the GPIO, and an end_vid.sh to turn it off. The light would then be on during any video recording whether motion detected or manually triggered.

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

Re: RPi Cam Web Interface

Sun May 29, 2016 12:40 pm

btidey wrote:
peterwup wrote:Hi,

I am using the great tool in combination with an external motion detection which support other webcams too.
At the moment I take a snapshot by: "http://cameraIPaddress/cam_pic.php" from another computer.
Is it possible to get a snapshot with a higher resolution in the same way ?
The snapshot software I use just accept static URLS.
The cam_pic.php url is fetching the current 'preview image'. You can set up the resolution of this on the main settings page (preview width, height is calculated). So the easiest way is just to increase this setting. It will affect the size of the real time window and will also increase the bandiwidth being used to maintain the live display.

If you want a high resolution image capture then what you maybe want to do is send in a image capture command. This will take a real image capture at the resolution set up which can be up to full camera resolution. This image would be stored in the path for images (default the media folder). The method used depends a bit on what you are trying to do from these remote computers.
Here is a simple example of triggering a standard capture, waiting a bit to allow it to complete then returning the resulting image. Note that every time you access the url you will get a capture in the media folder. One could delete the capture files if one wanted to. Save the code as say cam_capture.php then put in the web folder and access it in the url.

Code: Select all

<?php
   define('BASE_DIR', dirname(__FILE__));
   require_once(BASE_DIR.'/config.php');
   
   $pipe = fopen("FIFO","w");
   fwrite($pipe, "im");
   fclose($pipe);
   sleep(2);
   $myarray = glob(MEDIA_PATH . "/*jpg*" . THUMBNAIL_EXT);
   usort($myarray, create_function('$a,$b', 'return filemtime($b) - filemtime($a);'));

   header("Content-Type: image/jpeg");
   if (isset($_GET["pDelay"]))
   {
      $preview_delay = $_GET["pDelay"];
   } else {
      $preview_delay = 10000;
   }
   usleep($preview_delay);
   readfile(dataFilename($myarray[0]));

?>

bismosa
Posts: 40
Joined: Sun Dec 23, 2012 11:43 am

Re: RPi Cam Web Interface

Sun May 29, 2016 12:54 pm

btidey wrote: FIrst, don't remove or reduce gpu_mem setting below 128. The GPU is being used to do multiple tasks here and needs that memory.

The log is indicating a problem when capture (lapse) is occurring during the boxing operation. Doing both time lapse and motion detection is possible but does put more stress on the system. This is causing the watchdog to time out and try to reset the operation. The timeout could be being triggered by a number of factors:

a) Could be the CPU is getting overloaded and not getting enough time to perform all the work within the watchdog period. This is more likely to happen with a Raspberry A or B (single core). You could try disabling the watchdog (set to 0).

b) It is still possible that power dips during the intensive periods are causing a problem. Although you have swapped the PSU, have you made sure the USB power cable is low resistance. I have seen several cases of problems caused by the quality if the USB cable causing excessive voltage drop.

I would also try doing a test run with just motion detection or just time lapse to see what the stability is,. This will help establish whether it is the capture during a box which is the initial trigger.
This is one reason for new hardware ;) But it is also interesting to find the error. I i think i get them:
I have yesterday tested with Buffer "3000". Same problem. But after a restart i get an error on my USB-Stick It was only mounted as Read-Only and had a bad Superblock. I think that the Stick wont work properly and fast enough(?). Now i use an other old 4GB USB-Stick and since 17 hours everything works very well!
I have no entry from watchdog or any other errors in the log.

So i think that this problem is resolved :) Thank you for your tips!

I had to ask a few more...but the most is now done. The only thing was the log-file path. Can i change it?

Thank you!

Regards
Bismosa

Return to “Camera board”