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

Re: RPi Cam Web Interface

Sun Jan 01, 2017 5:30 pm

droogmic wrote:Thanks for the quick reply,

Indeed by front end I think I was extrapolating from install.sh (not knowing they were linked on the pi, i should have just tested it), I need to do a bit more testing but I think your latest commit fixed that.
The other things you I did were stripping all "sudo"s and having to "ldconfig" the mmal libs.

I just want to check, did you mean to do

Code: Select all

sudo killall raspimjpeg >2 /dev/null
vs

Code: Select all

sudo killall raspimjpeg 2>/dev/null
in your latest commit?
Thanks for pointing that out. I had it right on my test camera and then screwed up the final edit.

Should be correct now.

droogmic
Posts: 3
Joined: Sat Dec 31, 2016 11:34 am

Re: RPi Cam Web Interface

Tue Jan 03, 2017 12:00 am

btidey wrote: Thanks for pointing that out. I had it right on my test camera and then screwed up the final edit.

Should be correct now.
Indeed it is, thanks.

https://github.com/droogmic/rpi-cam-web-docker
I think I've finished working on this as it seems to work well (for now). If it attracts some interest and people find it useful I may add it to the wiki. Hope someone finds it useful :P.

PerryJapanTenchi
Posts: 7
Joined: Sat Mar 26, 2016 12:16 pm

Re: RPi Cam Web Interface

Tue Jan 03, 2017 12:56 pm

What is the best method to port forward to raspberry pi to a page that I'm able to select which pi camera I want to view?

I have 1 pi that I port forward to which I'm able to view the pi cam. I have setup another pi and also want to view the pi cam. I don't want to port forward to another port.

Thank you for any suggestion.

gpapig
Posts: 1
Joined: Tue Jan 03, 2017 8:17 pm

Re: RPi Cam Web Interface

Tue Jan 03, 2017 8:23 pm

Hi everybody !

Issue "solved" I've re-install rpasbian froms cratch and now it works fine
Last edited by gpapig on Wed Jan 04, 2017 9:03 pm, edited 3 times in total.

PerryJapanTenchi
Posts: 7
Joined: Sat Mar 26, 2016 12:16 pm

Re: RPi Cam Web Interface

Wed Jan 04, 2017 3:27 am

btidey wrote:
jussi24 wrote:
For me it workes with %a instead of %z. %a is also documented in the annotations for image filenames.
Thanks for that feature!
Yes, it should be %a. It started off life as %z then I changed it and updated the documentation.
Can you post what the user_annotate.txt file contents should be after adding text?

Thank you

markusb68
Posts: 3
Joined: Thu Jan 05, 2017 4:35 pm

Re: RPi Cam Web Interface

Thu Jan 05, 2017 4:41 pm

Hello,

today I have tried to update from GIT. Dind't work so removed using ./remove.sh.

and made a
git clone https://github.com/silvanmelchior/RPi_C ... erface.git
cd RPi_Cam_Web_Interface
chmod u+x *.sh
./install.sh

All is working, but autostart seems to be broken.
the #START RASPIMJPEG SECTION is in rc.local.

using ./start.sh works too, but not the autostart....

any clues

Regards

Markus

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

Re: RPi Cam Web Interface

Thu Jan 05, 2017 6:18 pm

PerryJapanTenchi wrote:
btidey wrote:
jussi24 wrote:
For me it workes with %a instead of %z. %a is also documented in the annotations for image filenames.
Thanks for that feature!
Yes, it should be %a. It started off life as %z then I changed it and updated the documentation.
Can you post what the user_annotate.txt file contents should be after adding text?

Thank you
The %a in the annotation formula is substituted by whatever string is in the user_annotate.txt file. By default this file is located at /dev/shm/mjpeg/user_annotate.txt

So say one wanted the temperature to be included in the annotation then you would have a program which updated the /dev/shm/mjpeg/user_annotate.txt file with the temperature (e.g. 18.1C) and this would be included where the %a occurred. Do not include a line terminator in the file just the pure text you wnat to include.

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

Re: RPi Cam Web Interface

Thu Jan 05, 2017 6:28 pm

markusb68 wrote:Hello,

today I have tried to update from GIT. Dind't work so removed using ./remove.sh.

and made a
git clone https://github.com/silvanmelchior/RPi_C ... erface.git
cd RPi_Cam_Web_Interface
chmod u+x *.sh
./install.sh

All is working, but autostart seems to be broken.
the #START RASPIMJPEG SECTION is in rc.local.

using ./start.sh works too, but not the autostart....

any clues

Regards

Markus
The rc.local section should look something like

Code: Select all

#START RASPIMJPEG SECTION
mkdir -p /dev/shm/mjpeg
chown www-data:www-data /dev/shm/mjpeg
chmod 777 /dev/shm/mjpeg
sleep 4;su -c 'raspimjpeg > /dev/null 2>&1 &' www-data
if [ -e /etc/debian_version ]; then
  sleep 4;su -c 'php /var/www/html/schedule.php > /dev/null 2>&1 &' www-data
else
  sleep 4;su -s '/bin/bash' -c 'php /var/www/html/schedule.php > /dev/null 2>&1 &' w$
fi
#END RASPIMJPEG SECTION
Check, in particular the paths are correct. I have shown them with install in a html subfolder.

jjtx
Posts: 15
Joined: Wed Oct 30, 2013 8:31 pm

Re: RPi Cam Web Interface

Fri Jan 06, 2017 3:38 am

silvanmelchior wrote:Installation instructions and all other information is now here:

http://elinux.org/RPi-Cam-Web-Interface

Wow thanks for doing this. I ran the scripts, installed it and it worked right out of the box as they say.

Everything else I've tried to install has failed with an error.

Any plans on implementing a file-upload to server option?

Rasilon
Posts: 101
Joined: Wed Mar 11, 2015 7:30 pm

Re: RPi Cam Web Interface

Sun Jan 08, 2017 11:20 pm

I cannot get this to work properly on Pi 2 Raspbian Pixel. The web interface works, but what ever I try it will only record for a few minutes. The motion mode also only works for a few minutes and it does not record the video. None of it will auto start.

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

Re: RPi Cam Web Interface

Mon Jan 09, 2017 9:28 am

Rasilon wrote:I cannot get this to work properly on Pi 2 Raspbian Pixel. The web interface works, but what ever I try it will only record for a few minutes. The motion mode also only works for a few minutes and it does not record the video. None of it will auto start.
There shouldn't be an issue with Pixel specifically. Can you give a bit more info to help see what is going wrong?

In particular -
1) What method did you use to install? I recommend using ./install.sh
2) It sounds like it will manually record but then stops. Is it still working when that happens? Can you start another recording?
3) What does the log (in scheduler) show?
4) Are you sure the power supply and USB cable are providing +5V at the Raspberry? The camera draws a bit more power and voltage drop in the cable can lead to unstable operation.

Rasilon
Posts: 101
Joined: Wed Mar 11, 2015 7:30 pm

Re: RPi Cam Web Interface

Mon Jan 09, 2017 10:54 am

Thank you for the reply, but this is way over my head to figure out. I installed Pikrellcam and I had it installed and set up in just a few minutes.

jackisidore
Posts: 2
Joined: Fri Dec 30, 2016 8:34 pm

Re: RPi Cam Web Interface

Mon Jan 09, 2017 9:00 pm

I had 6.2.21 running for a few weeks without problems and today decided to try updating/
Running ./update.sh resulted in

Code: Select all

error: Your local changes to the following files would be overwritten by merge:
bin/raspimjpeg
Please, commit your changes or stash them before you can merge.
After reading this post I deleted the old install folder, cloned git and installed the new software. The result is that RPI cam appears to be running the website displays only the index of /var/www :

Code: Select all

Index of /

[ICO]	Name	Last modified	Size	Description
[DIR]	html/	2016-12-27 15:46	-	 
Apache/2.4.10 (Raspbian) Server at 192.168.1.xxx Port 80

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

Re: RPi Cam Web Interface

Tue Jan 10, 2017 11:01 am

jackisidore wrote:I had 6.2.21 running for a few weeks without problems and today decided to try updating/
Running ./update.sh resulted in

Code: Select all

error: Your local changes to the following files would be overwritten by merge:
bin/raspimjpeg
Please, commit your changes or stash them before you can merge.
After reading this post I deleted the old install folder, cloned git and installed the new software. The result is that RPI cam appears to be running the website displays only the index of /var/www :

Code: Select all

Index of /

[ICO]	Name	Last modified	Size	Description
[DIR]	html/	2016-12-27 15:46	-	 
Apache/2.4.10 (Raspbian) Server at 192.168.1.xxx Port 80
The error during the update was caused by git thinking that a local file has been changed outside of its control and it won't do the merge because of that. Normally that should only happen if you have edited or changed one of the files in the install folder yourself but I have heard of cases where this has got triggered without any explicit changes having been made.

Your recovery method was correct; delete the original install folder, clone and run the installer. I think you are now saying that the web site config is out of sync. Something like you installed the camera software into html but the browser is displaying the default web page from /var/www. Is that right?

If you browse to http://ipaddress/html is that working?

jackisidore
Posts: 2
Joined: Fri Dec 30, 2016 8:34 pm

Re: RPi Cam Web Interface

Tue Jan 10, 2017 6:05 pm

With the installer I changed the apache port to 90 and now the website is working.
I also tried installing nginx from the installer which didn't work. No idea why port 80 didn't work for the websie.

Thanks for your help and a bigger thank you for RPIcam. absolutely the best cam software for a Pi.

markusb68
Posts: 3
Joined: Thu Jan 05, 2017 4:35 pm

Re: RPi Cam Web Interface

Tue Jan 10, 2017 6:21 pm

Hello,

Autostart is working now.

Had these 2 lines in rc.local above RASPIMJPEG SECTION

Code: Select all

echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
moved them to the end (before exit 0)
Now all O.K.

Thanks

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

Re: RPi Cam Web Interface

Tue Jan 10, 2017 7:00 pm

jackisidore wrote:With the installer I changed the apache port to 90 and now the website is working.
I also tried installing nginx from the installer which didn't work. No idea why port 80 didn't work for the websie.

Thanks for your help and a bigger thank you for RPIcam. absolutely the best cam software for a Pi.
Good to hear it's working although port change is puzzling.

sudo netstat -lptn

will show which programs are using which ports. Sounds like Apache was still using port 80 but maybe the sites-enabled folder (/etc/apache2/sites-enabled) had got confused somehow. It should normally only have one entry in there raspicam.conf if only one web site (the camera) is being used. If there is another entry like an apache default then that may have taken ownership of port 80 as a different web site. The install.sh normally removes the 000-default.conf one to allow raspicam.conf to have whatever port it wants, but if a different one using port 80 is in there then that would cause a problem.

The entries in sites-enabled are actually just links to the real files in sites-available but only ones in sites-enabled are activated by Apache. You could remove any other entries in sites-enabled if you want to get port 80 again for the camera. You can just edit the port entry in sites-available/raspicam.conf to avoid running the installer again.

Installing nginx does work providing it is done without installing Apache first. If one is done after the other then they will fight each other over port usage. I have added a bit of clarification into the wiki on this.
Last edited by btidey on Tue Jan 10, 2017 7:15 pm, edited 1 time in total.

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

Re: RPi Cam Web Interface

Tue Jan 10, 2017 7:05 pm

markusb68 wrote:Hello,

Autostart is working now.

Had these 2 lines in rc.local above RASPIMJPEG SECTION

Code: Select all

echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
hwclock -s
moved them to the end (before exit 0)
Now all O.K.

Thanks
Those extra lines look like something to do with a RTC clock add-on. As it works with them moved to the end it sounds like maybe they were triggering an error as rc.local was executed so that the rest of the script (starting the camera wasn't getting executed. Maybe you could try executing them manually from a terminal to see if they are throwing errors.

markusb68
Posts: 3
Joined: Thu Jan 05, 2017 4:35 pm

Re: RPi Cam Web Interface

Wed Jan 11, 2017 8:34 am

Yes, these lines do activate the RTC and set the system clock.
They don't give errors executed manually and all is working fine now.
I just have to keep them below the "RASPIMJPEG SECTION" after the next update.

I'm wondering if I could use the Scheduler to activate timelapse full-res picture capture on a sun-based schedule.
But can't figure out a way to set it up. It looks to me as the Scheduler is just for motion capture (video).
Correct?

Thanks

Markus

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

Re: RPi Cam Web Interface

Wed Jan 11, 2017 9:18 am

markusb68 wrote:Yes, these lines do activate the RTC and set the system clock.
They don't give errors executed manually and all is working fine now.
I just have to keep them below the "RASPIMJPEG SECTION" after the next update.

I'm wondering if I could use the Scheduler to activate timelapse full-res picture capture on a sun-based schedule.
But can't figure out a way to set it up. It looks to me as the Scheduler is just for motion capture (video).
Correct?

Thanks

Markus
The scheduler is fairly general purpose and not constrained to motion capture video.

Any sequence of the supported commands can be put into the motion start, motion stop, and period start fields. This can include changing camera settings, taking still images, videos, or controlling time lapse sequences.

Motion Start and Motion Stop commands get executed whenever a trigger (1=Start, 0=Stop) get entered into the scheduler FIFO1. Normally these would come from the motion detection logic but can come from anywhere (e.g. PIR motion detectors, door triggers etc).

The Period Start commands get executed whenever a period change is detected. In All Day mode there is only one set, but time based and Sun based allow different commands at different periods of the day. In a lot of cases these are used to determine what camera settings to use or whether to enable motion detection, but they can be used for anything. So for example, a time lapse sequence could be started at the beginning of a period and terminated at the next period start.

For additional flexibility one can use the Management command facility of the scheduler. Any commands here are periodically run at the Management interval. Typically one would use a sy command to execute a macro periodically that could do whatever logic was required and in turn issue further commands back to the command queue FIFO to initiate, image, video and time lapse operations.

Archer322
Posts: 8
Joined: Wed Jan 11, 2017 4:54 pm

Re: RPi Cam Web Interface

Wed Jan 11, 2017 5:29 pm

Hi all, first thanks for this great piece of work! Had a lot of fun setting up various PiCams and showing them off!

I'm having trouble with using a network drive for storage and I'm hoping there's a solution out there.

I'm using a 1TB Seagate Passport drive connected to my router via USB. I've managed to get my Pi to mount the drive as /var/www/media via fstab with:

//192.168.1.1/new_volume/Pi_Cam /var/www/media cifs defaults 0 1

The Pi can write and modify the mounted folder, which is odd because I didn't give www-data the correct permissions as I'm not sure how to? Still everything seems to be working correctly, the network drive is showing files being created and deleted as I modify them through the web interface and this seems to be syncing with /var/www/media (which shows 932GB available via the Pi file manager). So the mount appears to be good.

However, when I manually record video from the web interface the Pi seems to hang and get very slow, when I press stop it takes nearly a minute to stop recording. When the video recording is motion activated it seems to cause even more delays and eventually freezes the Pi. Looking at the log file in scheduler nothing seems out of place, I can see the capture start and end commands and the boxing queue call, with the motion capture and eventual freezing these processes get interrupted but there's still nothing out of the ordinary in the log.

It seems like there might be a buffering issue with the video recording, like the Pi is hanging because of the wifi connection or something while it's writing to the network drive, but I have no idea.

Ultimately I'd like several PiCams to be writing to this network drive, and I thought even over wifi that shouldn't be a problem as the Pi should have enough memory to buffer any video capture while it waits to write. If anyone could shed some light on this I would really appreciate it, thanks!

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

Re: RPi Cam Web Interface

Wed Jan 11, 2017 10:22 pm

Archer322 wrote:Hi all, first thanks for this great piece of work! Had a lot of fun setting up various PiCams and showing them off!

I'm having trouble with using a network drive for storage and I'm hoping there's a solution out there.

I'm using a 1TB Seagate Passport drive connected to my router via USB. I've managed to get my Pi to mount the drive as /var/www/media via fstab with:

//192.168.1.1/new_volume/Pi_Cam /var/www/media cifs defaults 0 1

The Pi can write and modify the mounted folder, which is odd because I didn't give www-data the correct permissions as I'm not sure how to? Still everything seems to be working correctly, the network drive is showing files being created and deleted as I modify them through the web interface and this seems to be syncing with /var/www/media (which shows 932GB available via the Pi file manager). So the mount appears to be good.

However, when I manually record video from the web interface the Pi seems to hang and get very slow, when I press stop it takes nearly a minute to stop recording. When the video recording is motion activated it seems to cause even more delays and eventually freezes the Pi. Looking at the log file in scheduler nothing seems out of place, I can see the capture start and end commands and the boxing queue call, with the motion capture and eventual freezing these processes get interrupted but there's still nothing out of the ordinary in the log.

It seems like there might be a buffering issue with the video recording, like the Pi is hanging because of the wifi connection or something while it's writing to the network drive, but I have no idea.

Ultimately I'd like several PiCams to be writing to this network drive, and I thought even over wifi that shouldn't be a problem as the Pi should have enough memory to buffer any video capture while it waits to write. If anyone could shed some light on this I would really appreciate it, thanks!
Going over wifi to a remote folder can certainly cause issues like this as the initial video recording is being done by real-time call backs from the camera system.

Read the data flow section in the wiki for details on what is going on.

There is a config option in /etc/raspimjpeg which can help in cases like this. By default the real time recording is to the media folder but if you set up boxing_path then you can arrange for the initial recordings to be made to a local folder in the Pi and then the boxing operation to .mp4 converts the .h264 recording from this local folder through to the final media folder. As the boxing process has a queue, is non real time and done asynchronously to the recording process then it can help a lot. It also cuts down on the network traffic as there is only the final transfer write rather than 1 to record, 1 to read the h264 and 1 to write the mp4 back.

The boxing_path should be local to the Pi and be given read write to the www-data user. It only stores the recordings temporarily.

The easiest way to make sure permissions are right is just to make the www-data the owner of the boxing_path folder

sudo chown www-data:www-data path-to-boxing_path

Archer322
Posts: 8
Joined: Wed Jan 11, 2017 4:54 pm

Re: RPi Cam Web Interface

Wed Jan 11, 2017 11:34 pm

btidey wrote: Going over wifi to a remote folder can certainly cause issues like this as the initial video recording is being done by real-time call backs from the camera system.

Read the data flow section in the wiki for details on what is going on.

There is a config option in /etc/raspimjpeg which can help in cases like this. By default the real time recording is to the media folder but if you set up boxing_path then you can arrange for the initial recordings to be made to a local folder in the Pi and then the boxing operation to .mp4 converts the .h264 recording from this local folder through to the final media folder. As the boxing process has a queue, is non real time and done asynchronously to the recording process then it can help a lot. It also cuts down on the network traffic as there is only the final transfer write rather than 1 to record, 1 to read the h264 and 1 to write the mp4 back.

The boxing_path should be local to the Pi and be given read write to the www-data user. It only stores the recordings temporarily.

The easiest way to make sure permissions are right is just to make the www-data the owner of the boxing_path folder

sudo chown www-data:www-data path-to-boxing_path
"This can cause quite a lot of network traffic and potential problems if the media folder has been remotely mounted. "

Derp, right there in the wiki. I'll give this a shot, thanks!

Archer322
Posts: 8
Joined: Wed Jan 11, 2017 4:54 pm

Re: RPi Cam Web Interface

Thu Jan 12, 2017 12:30 am

Archer322 wrote:
btidey wrote: Going over wifi to a remote folder can certainly cause issues like this as the initial video recording is being done by real-time call backs from the camera system.

Read the data flow section in the wiki for details on what is going on.

There is a config option in /etc/raspimjpeg which can help in cases like this. By default the real time recording is to the media folder but if you set up boxing_path then you can arrange for the initial recordings to be made to a local folder in the Pi and then the boxing operation to .mp4 converts the .h264 recording from this local folder through to the final media folder. As the boxing process has a queue, is non real time and done asynchronously to the recording process then it can help a lot. It also cuts down on the network traffic as there is only the final transfer write rather than 1 to record, 1 to read the h264 and 1 to write the mp4 back.

The boxing_path should be local to the Pi and be given read write to the www-data user. It only stores the recordings temporarily.

The easiest way to make sure permissions are right is just to make the www-data the owner of the boxing_path folder

sudo chown www-data:www-data path-to-boxing_path
"This can cause quite a lot of network traffic and potential problems if the media folder has been remotely mounted. "

Derp, right there in the wiki. I'll give this a shot, thanks!
And it works like a charm! I ended up modifying the uconfig file in /var/www/ adding the line "boxing_path /var/www/boxing" after I made the boxing folder and setting www-data owner as you described. I did this thinking uconfig may persist through updates while raspimjpeg could be wiped? Haven't gone through any updates so I'm not sure what's kept and what's not.

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

Re: RPi Cam Web Interface

Thu Jan 12, 2017 9:30 am

Archer322 wrote:
And it works like a charm! I ended up modifying the uconfig file in /var/www/ adding the line "boxing_path /var/www/boxing" after I made the boxing folder and setting www-data owner as you described. I did this thinking uconfig may persist through updates while raspimjpeg could be wiped? Haven't gone through any updates so I'm not sure what's kept and what's not.
Putting stuff in uconfig is good as it will survive a re-install or update whereas /etc/raspimjpeg will get reset. The only thing you need to be careful of is system/reset settings on web page will wipe out everything in uconfig. It can be a good idea to keep a copy of uconfig once you have got settings how you like it.

Return to “Camera board”