RPi Cam Web Interface


4203 posts   Page 167 of 169   1 ... 164, 165, 166, 167, 168, 169
by quavoce » Mon Jun 12, 2017 4:00 pm
ksdehoff wrote:I'm having a problem running with motion detection on a Pi Zero and am wondering if anyone has figured out a fix - the problem is that the pi zero simply stops responding to anything on the network after a period of hours, requiring me to power cycle. I'd suspect some sort of resource exhaustion but am not sure - anyone have suggestions on how to properly configure motion detection to run on a Pi Zero?

I run motion detect on a Pi Zero without issues. What is your config (cat /var/www/html/uconfig)?
Try another USB cable if possible and then if you have the same problem, try another power supply as it could be a power issue.
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by ksdehoff » Mon Jun 12, 2017 4:02 pm
I'm using the onboard FPC connector - no USB - but that's good insight - perhaps slowing the camera down a lot will help.

uconfig is simple
annotation Drive Entrance %Y.%M.%D_%h:%m:%s
hflip 1
vflip 1
Last edited by ksdehoff on Mon Jun 12, 2017 4:05 pm, edited 1 time in total.
Posts: 4
Joined: Fri Apr 12, 2013 2:26 am
by quavoce » Mon Jun 12, 2017 4:04 pm
shinji2009 wrote:hi. can anybody tell me please. because i am not too smart in all if these things. generally, how safe it is to not set the password to access to rpis with RPi Cam Web Interface, if rpis are connected to the router via wifi and no ports for them are forwarded?

Depends on how secure your home network is. :)
Generally though you should be fine if you've no intention of exposing the cams to the internet.
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by quavoce » Mon Jun 12, 2017 4:12 pm
Hi Robert,

I've made some changes to the startstop.sh macro because I found it was failing to convert other .h264 files if one of them had an error. I also included a method to detect if the script was already running because I had a series of watchdog resets close to each other that caused problems with conversion. The fix is copied below if you wish to include it in future versions:

Code: Select all
#!/bin/bash

#Check if script already running
mypidfile=/var/www/html/macros/startstop.sh.pid

NOW=`date +"-%Y/%m/%d %H:%M:%S-"`
if [ -f $mypidfile ]; then
   echo "${NOW} Script already running..." >> /var/www/html/scheduleLog.txt
   exit
fi

#Remove PID file when exiting
trap "rm -f -- '$mypidfile'" EXIT

echo $$ > "$mypidfile"

#Do conversion
if [ "$1" == "start" ]; then
  cd $(dirname $(readlink -f $0))
  cd ../media
  shopt -s nullglob
  for f in *.h264
    do
        f1=${f%.*}
        NOW=`date +"-%Y/%m/%d %H:%M:%S-"`
        echo "${NOW} Converting $f" >> /var/www/html/scheduleLog.txt
        #set -e;MP4Box -fps 25 -add $f $f1 > /dev/null 2>&1;rm $f;
        if MP4Box -fps 25 -add $f $f1; then
                NOW=`date +"-%Y/%m/%d %H:%M:%S-"`
                echo "${NOW} Conversion complete, removing $f" >> /var/www/html/scheduleLog.txt
                rm $f
        else
                NOW=`date +"-%Y/%m/%d %H:%M:%S-"`
                echo "${NOW} Error with $f" >> /var/www/html/scheduleLog.txt
        fi
    done
fi
Last edited by quavoce on Mon Jun 12, 2017 9:02 pm, edited 1 time in total.
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by davefi » Mon Jun 12, 2017 8:45 pm
ksdehoff wrote:I'm having a problem running with motion detection on a Pi Zero and am wondering if anyone has figured out a fix - the problem is that the pi zero simply stops responding to anything on the network after a period of hours, requiring me to power cycle. I'd suspect some sort of resource exhaustion but am not sure - anyone have suggestions on how to properly configure motion detection to run on a Pi Zero?


One of mine was doing that. From what I could tell in syslog, the USB hub was disconnecting which took the Edimax USB WiFi adaptor offline.

In the end I set up a cron script to ping the router every 15mins and if it was not responding, then it took down the WiFi interface, and brought it back up. Since then its been fine - its still dropping randomly, but brings itself back online. Its probably a power issue, but the Zero is remote and I can't get to it for a while, so this was a suitable workaround.

Its a simple enough script I cobbled together from various sources:
Code: Select all
#!/bin/bash

TESTIP=192.168.1.1

ping -c4 ${TESTIP} > /dev/null

if [ $? != 0 ]
then
    logger -t $0 "WiFi appears down, restarting..."
    ifdown --force wlan0
    rmmod 8192cu
    modprobe 8192cu
    ifup wlan0
fi
Posts: 2
Joined: Fri Jan 27, 2017 9:26 pm
by sjd36 » Tue Jun 13, 2017 6:46 am
btidey wrote:
noxx wrote:before i press the OK-Button to save my conf:

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

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

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

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


No don't change the raspimjpeg paths; leave them as /var/www/html/media

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

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


Hi Guys

The html saves the video to /var/www/html/media folder so if i mount my USB in that directory how do I save the video files to the USB without changing the path? I tried creating a test "media" folder and it wouldnt allow me.

regards
Posts: 1
Joined: Tue Jun 13, 2017 4:59 am
by nunim » Tue Jun 13, 2017 8:29 am
First of all, great software! The motion capture works quite well as well, even in IR.

My only question/issue is .png output for the still images, is this possible? I see that raspicam supports PNG output but I don't see any config or file where I can set this for RPi Cam Control.

Is there a way to output my stills as .png files?

Thanks!
Posts: 1
Joined: Tue Jun 13, 2017 8:21 am
by quavoce » Tue Jun 13, 2017 7:42 pm
Hi All,

If you have a Mac and would like to easily browse the RPi Web Cam media folder over the network, then please follow the instructions I've written up in the link below that explains how to use netatalk (AFP for the Pi).

https://quavoce.wordpress.com/2017/06/1 ... atalk-afp/
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by harlock74 » Tue Jun 13, 2017 9:49 pm
harlock74 wrote:
quavoce wrote:
harlock74 wrote:Hi quavoce,
Many thanks for sharing these very detailed instructions. They are very helpful indeed!
Can you please let me know if you ever tried to install the same letsencrypt certificate on two different raspberry pi's within the same home network, basically same DNS server but different port?
Thanks a lot!

No I haven't used the certificate on two Pis (I don't think that would work?), I just have the proxypi as the gateway into my network, which in turn redirects external access to multiple different Pis depending on the URL.

e.g.
https://myurl/mycam1 -> goes to CamPi1
https://myurl/mycam2 -> goes to CamPi2
https://myurl/mycam3 -> goes to CamPi3


Hi,
Thanks for letting me know. However it looks like it can be done as per the following links:

https://github.com/certbot/certbot/issues/2005

https://stackoverflow.com/questions/37391158/copied-a-lets-encrypt-certificate-from-one-server-to-another-how-to-auto-renew

I have also opened a new thread on the letsencrypt forum. I will report back here should I succeed :D


Success!! It took me quite some time but finally I have managed to install certbot on two Pi's and it's all working like a charm! I will share some instructions very shortly! 8-)
Posts: 180
Joined: Fri Jan 18, 2013 10:47 am
by mem123 » Wed Jun 14, 2017 9:21 am
Hello,
I am trying to record a video via the RPi CAM Web Interface.
I connect my mobile to the same network of the Raspberry Pi and I start recording.
The problem is that I cannot get my mobile connected all the time. I just want to start recording the vidéo, let the raspberry recording all the day and get out.
But when I start recoding the video and disconnect from the network. After that when I reconnect to the network, I can't get access to the interface.
How can I fiw this problem please?
Thank you.
Best regards.
Posts: 18
Joined: Mon Mar 06, 2017 3:43 pm
by quavoce » Wed Jun 14, 2017 7:14 pm
mem123 wrote:Hello,
I am trying to record a video via the RPi CAM Web Interface.
I connect my mobile to the same network of the Raspberry Pi and I start recording.
The problem is that I cannot get my mobile connected all the time. I just want to start recording the vidéo, let the raspberry recording all the day and get out.
But when I start recoding the video and disconnect from the network. After that when I reconnect to the network, I can't get access to the interface.
How can I fiw this problem please?
Thank you.
Best regards.

Perhaps you running out of storage space on the SD card? Set the schedule to keep a set amount of free space by automatically deleting media. http://elinux.org/RPi-Cam-Web-Interface#Scheduler

If you want to record video all day, please follow these instructions I just wrote up on the Wiki: http://elinux.org/RPi-Cam-Web-Interface ... all_day.3F
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by quavoce » Wed Jun 14, 2017 7:14 pm
harlock74 wrote:Success!! It took me quite some time but finally I have managed to install certbot on two Pi's and it's all working like a charm! I will share some instructions very shortly! 8-)

Nice, it'll be interesting to see how that works!
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by quavoce » Wed Jun 14, 2017 7:18 pm
ksdehoff wrote:I'm using the onboard FPC connector - no USB - but that's good insight - perhaps slowing the camera down a lot will help.

uconfig is simple
annotation Drive Entrance %Y.%M.%D_%h:%m:%s
hflip 1
vflip 1

Try using the Internal motion mode instead as I understand it's less CPU intensive: http://elinux.org/RPi-Cam-Web-Interface#Internal
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by pumpkinpi » Wed Jun 14, 2017 9:43 pm
pumpkinpi wrote:I recently upgraded to the newest version on two cameras I have at work. I am saving the media files onto an NFS server via a symbolically linked /var/www/html/media file. However, since the upgrade, the MP4Box does not seem to be converting any saved videos. I have lots of .h264 files but no .MP4s. The .jpg thumbs are saved and they appear in the downloads page with "busy" labels. I think this is related to what you are discussing above, but I am not sure how to fix it or troubleshoot.

I should note that it has been about 14 months since my last upgrade and I had to remove the RPi_ folder and get the latest system from git to get it to install.

Thanks,
PPi


Hi folks,

Just wondering if anybody has ideas here? It seems to be sporadic. One camera is able to process the videos and convert to mp4 videos and the other never seems to do it. Wondering if it is because they are both saving to a common NFS file server but then again, this was never an issue before.

I could just run a script to do the conversion later on when things are not happening. I am using the internal detection method.

All my Pi's are Pi 2's so they should have enough horsepower for this.

EDIT: Uploaded a file showing what I see this morning. Basically, it converted the first video, then left the others unconverted.

Thanks,
PPi.
Attachments
RPi Cam Control v6.3.6.png
RPi Cam Control v6.3.6.png (18.36 KiB) Viewed 580 times
Posts: 113
Joined: Fri Apr 18, 2014 7:11 pm
by quavoce » Thu Jun 15, 2017 9:35 pm
pumpkinpi wrote:
pumpkinpi wrote:I recently upgraded to the newest version on two cameras I have at work. I am saving the media files onto an NFS server via a symbolically linked /var/www/html/media file. However, since the upgrade, the MP4Box does not seem to be converting any saved videos. I have lots of .h264 files but no .MP4s. The .jpg thumbs are saved and they appear in the downloads page with "busy" labels. I think this is related to what you are discussing above, but I am not sure how to fix it or troubleshoot.

I should note that it has been about 14 months since my last upgrade and I had to remove the RPi_ folder and get the latest system from git to get it to install.

Thanks,
PPi


Hi folks,

Just wondering if anybody has ideas here? It seems to be sporadic. One camera is able to process the videos and convert to mp4 videos and the other never seems to do it. Wondering if it is because they are both saving to a common NFS file server but then again, this was never an issue before.

I could just run a script to do the conversion later on when things are not happening. I am using the internal detection method.

All my Pi's are Pi 2's so they should have enough horsepower for this.

EDIT: Uploaded a file showing what I see this morning. Basically, it converted the first video, then left the others unconverted.

Thanks,
PPi.

What does /var/www/html/scheduleLog.txt show? I think this will log any errros with MP4box.
It could be a permissions issue with the media folder. What does "ls -al /var/www/html/media show for each cam? Although if it's writing .h264 to media already then probably not.
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by btidey » Fri Jun 16, 2017 8:36 am
pumpkinpi wrote:
Hi folks,

Just wondering if anybody has ideas here? It seems to be sporadic. One camera is able to process the videos and convert to mp4 videos and the other never seems to do it. Wondering if it is because they are both saving to a common NFS file server but then again, this was never an issue before.

I could just run a script to do the conversion later on when things are not happening. I am using the internal detection method.

All my Pi's are Pi 2's so they should have enough horsepower for this.

EDIT: Uploaded a file showing what I see this morning. Basically, it converted the first video, then left the others unconverted.

Thanks,
PPi.


Note that when linking to an external folder rather than using the local storage then it is a very good idea to take advantage of the boxing_path configuration if you are not doing so.

This is described in the wiki and removes the real time access needed to the external FS. Captures to the .h264 are performed to the local boxing_path folder and then MP4Box conversions move the mp4 to its final destination.
Posts: 1277
Joined: Sun Feb 17, 2013 6:51 pm
by harlock74 » Sun Jun 18, 2017 9:46 am
harlock74 wrote:
quavoce wrote:
harlock74 wrote:
No I haven't used the certificate on two Pis (I don't think that would work?), I just have the proxypi as the gateway into my network, which in turn redirects external access to multiple different Pis depending on the URL.

e.g.
https://myurl/mycam1 -> goes to CamPi1
https://myurl/mycam2 -> goes to CamPi2
https://myurl/mycam3 -> goes to CamPi3


Hi,
Thanks for letting me know. However it looks like it can be done as per the following links:

https://github.com/certbot/certbot/issues/2005

https://stackoverflow.com/questions/37391158/copied-a-lets-encrypt-certificate-from-one-server-to-another-how-to-auto-renew

I have also opened a new thread on the letsencrypt forum. I will report back here should I succeed :D


Success!! It took me quite some time but finally I have managed to install certbot on two Pi's and it's all working like a charm! I will share some instructions very shortly! 8-)


After trying different methods with both certbot and letsencypt, the most reliable solution that I have managed to reproduce everytime and without getting any error messages, is as per below instructions:

After creating a certificate with letsencrypt on your first RPi:
1. Locate the folder where your certificate is being stored. This should be in /etc/letsencrypt/live/<your_domain> by default.

2. You should see 4 files: cert.pem, privkey.pem, chain.pem, and fullchain.pem. Copy these files to your second RPi. I would highly recommend using rsync with a method like -a to preserve symbolic links, and then copy the entirety of /etc/letsencrypt. Alternatively you can create an archive with tar, again to preserve all the relevantsymbolic links.

3. Install letsencrypt on your second RPi:
Code: Select all
git clone https://github.com/letsencrypt/letsencrypt

4.Then:
Code: Select all
cd letsencrypt

5. Then run the command to re-install your certificate:
Code: Select all
./letsencrypt-auto install --apache --cert-path <cert_path> --key-path <key_path> --chain-path <chain_path> --fullchain-path <fullchain_path>

6. Make sure you change the ssl port on your second RPi by editing:
Code: Select all
sudo nano /etc/apache2/ports.conf
sudo nano /etc/apache2/sites-available/default-ssl.conf
sudo nano /etc/apache2/sites-available/000-default-le-ssl.conf
sudo service apache2 restart
sudo systemctl daemon-reload

7. Portforward the new ssl port from your router.
Last edited by harlock74 on Sun Jun 18, 2017 9:56 am, edited 1 time in total.
Posts: 180
Joined: Fri Jan 18, 2013 10:47 am
by harlock74 » Sun Jun 18, 2017 9:55 am
bengray97 wrote:
quavoce wrote:
quavoce wrote:I would like to enable HTTPS on each of my RPiCam's so that the username and password aren't transmitted in the clear. I have successfully done this using the instructions below but there's one problem I just can't figure out.

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

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

Initial Setup
1. Fresh Jessie image (used 2016-09-23-raspbian-jessie.img)
2. Install RPi Cam:
Code: Select all
sudo apt-get update
sudo apt-get upgrade
git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
chmod u+x *.sh
./install.sh

3. Configured using html as subfolder, Apache, Port 80, user/pass blank
4. Connected to RPi Cam from desktop and recorded a normal and motion detected video.
5. Connected to RPi Cam via iPhone/iPad and browsed to Download Video and Images, and verified I can play back recorded videos.

Configure HTTPS
1. Set up and configure self-signed certificate: (accept the defaults)
Code: Select all
sudo mkdir /etc/apache2/ssl
sudo openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key

2. Prep Apache to use SSL
Code: Select all
sudo a2enmod rewrite
sudo a2enmod ssl

3. Edit /etc/apache2/sites-available/raspicam.conf (use nano instead of vim if preferred)
Code: Select all
sudo vim /etc/apache2/sites-available/raspicam.conf

4. Change <VirtualHost *:80> to <VirtualHost *:443>
5. Add the following lines just before </VirtualHost>
Code: Select all
SSLEngine On
SSLCertificateFile    /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key

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

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn

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

6. Restart Apache
Code: Select all
sudo service apache2 restart

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

Does this work ok for anyone else?


Ok, so the issue turns out to be the iPhone/iPad being too zealous on the encryption being correct. It seems they just don't like self-signed certs. See here for more info: http://stackoverflow.com/questions/4660 ... -uiwebview

The solution then is to generate official Certificate Authority signed certs for your domain name. I found a free method to do this using https://letsencrypt.org/ and I can confirm video playback now works over HTTPS!

I now have an end-to-end solution involving a reverse proxy, https encryption, Dynamic DNS, and multiple RPi Cams. If anyone is interested in a full set of detailed instructions for the proxy and https config, let me know and I'll post them on here.

I'm also close to having a functioning PHP Userform Login for RPi Cam so that we don't have to use htaccess for login. Again, if there's interest let me know and I'll post what I have working so far. (I'm using pre-made PHP Login files from GitHub, but it creates an account via SMTP so want to avoid that if I can)


Quavoce,

Thank you for the good walk-through on how to set up a self-signed cert! Did you ever post a detailed account of setting an official authority cert for your domain as well as setting up the PHP Userform Login? If not I'd be very interested in one or if there is a good tutorial out there, let me know. I'd appreciate any direction. Thanks. :D


Hi Quavoce,

I would also be interested in setting up a basic PHP Userform Login instead of using htaccess method. When you get a chance, would you please share any instructions?

Thanks a lot!

EDIT:

So far I have found these 3 ways, but I didn't figure out how to install:

https://github.com/delight-im/PHP-Auth#creating-a-new-instance
https://github.com/PHPAuth/PHPAuth
https://github.com/fethica/PHP-Login/blob/master/README.md

Robert is there any chance in the future to implement any of this PHP Userform Login in the setup?
Thanks!
Posts: 180
Joined: Fri Jan 18, 2013 10:47 am
by btidey » Mon Jun 19, 2017 11:20 am
harlock74 wrote:
Robert is there any chance in the future to implement any of this PHP Userform Login in the setup?
Thanks!


I encourage and welcome any improvements to merge into the repository.

My criteria are that the improvements need to be largely backwards compatible with existing operation and to be general purpose in nature.

The easiest way to submit is to test changes in a fork and then submit pull requests, but I am happy to help merge stuff in as necessary.
Posts: 1277
Joined: Sun Feb 17, 2013 6:51 pm
by gigpi » Mon Jun 19, 2017 1:38 pm
Hello btidey and once again thanks for your work here,

i'm having the camera freezing with the latest versions, usually in the morning. I can only see the same frame with the clock freezed, it says is recording a video but endless.

After some struggling i'm able to stop video recording issuing echo ca 1/0, ru 1/0 or start.sh/stop.sh scripts (not really sure which commands effectively works).
Then looking in the "status_mjpeg.txt" file i can see ready (before was md_ready) but now comes the tricky part: i can't stop the camera with "echo ru 0 > FIFO" it always tell me ready in the status. No way i can restart the camera it's always freezed on the same frame.

I'm using external motion, looking in the /var/www installation directory i see "media" and "uconfig" are the only files with the last access time exactly as the clock freezed, every other files is updated to when i issue the commands i told you. There are also 3 FIFO (fifo, fifo1, fifo11).

I'm at a point where i don't know how to debug it or where else to look.
I suppose is something related to boxing mp4 but i'm not sure.

Here is the log from "scheduleLog.txt", frame clock is freezed at 09:13:52:
Code: Select all
[2017/06/19 09:13:03] Start capture requested from Pipe
[2017/06/19 09:13:03] Send ca 1
{2017/06/19 09:13:03} Capturing started
[2017/06/19 09:13:05] Send im
{2017/06/19 09:13:05} Capturing image
[2017/06/19 09:13:07] Send sy notify.sh
{2017/06/19 09:13:07} Executing macro /var/www/picam/macros/notify.sh &
[2017/06/19 09:13:20] Stop capture requested
[2017/06/19 09:13:20] Send ca 0
{2017/06/19 09:13:20} Capturing stopped
{2017/06/19 09:13:20} Add /var/www/picam/media/vi_0010_20170619_091303.mp4 to Box Queue at pos 9
{2017/06/19 09:13:20} Start boxing /var/www/picam/media/vi_0010_20170619_091303.mp4.h264 to /var/www/picam/media/vi_0010_20170619_091303.mp4 Queue pos 9
[2017/06/19 09:13:22] Start capture requested from Pipe
[2017/06/19 09:13:22] Send ca 1
[2017/06/19 09:13:24] Send im
{2017/06/19 09:13:25} Capturing started
{2017/06/19 09:13:25} Capturing image
[2017/06/19 09:13:26] Send sy notify.sh
{2017/06/19 09:13:26} Executing macro /var/www/picam/macros/notify.sh &
{2017/06/19 09:13:31} Finished boxing /var/www/picam/media/vi_0010_20170619_091303.mp4 from Box Queue at pos 9
{2017/06/19 09:13:31} Removed item from Box Queue
[2017/06/19 09:13:56] Stop capture requested
[2017/06/19 09:13:56] Send ca 0
[2017/06/19 09:40:16] Scheduled management tasks. Next at 1497861616
[2017/06/19 10:40:17] Scheduled management tasks. Next at 1497865217
[2017/06/19 11:40:18] Scheduled management tasks. Next at 1497868818
[2017/06/19 12:40:19] Scheduled management tasks. Next at 1497872419
[2017/06/19 13:40:20] Scheduled management tasks. Next at 1497876020
{2017/06/19 14:32:12} RaspiMJPEG Version 5.8.03
[2017/06/19 14:32:13] RaspiCam support started
[2017/06/19 14:32:13] Capture Pipe already exists /var/www/picam/FIFO1
[2017/06/19 14:32:13] Scheduler loop is started
[2017/06/19 14:32:13] Stop capture request ignored, already stopped
[2017/06/19 14:32:14] New period detected 0
[2017/06/19 14:32:14] Scheduled management tasks. Next at 1497879134
{2017/06/19 14:51:10} RaspiMJPEG Version 5.8.03
[2017/06/19 14:51:11] RaspiCam support started
[2017/06/19 14:51:11] Capture Pipe already exists /var/www/picam/FIFO1
[2017/06/19 14:51:11] Scheduler loop is started
[2017/06/19 14:51:12] New period detected 0
[2017/06/19 14:51:12] Scheduled management tasks. Next at 1497880272


Only solution i have now is to reboot rPI..
I hope you can give me some more ideas to track back the problem.
Thank you.
User avatar
Posts: 17
Joined: Thu May 14, 2015 12:23 pm
by btidey » Mon Jun 19, 2017 2:09 pm
I have added a method to give different levels of web functionality controlled by different user name logins.

Details are in wiki under additions and tricks.

The login in method is still the same (htaccess) but if you add extra named users to access the web pages then the username can be used to give 3 levels of access.

Minimum is preview only, medium is preview plus video,image, time lapse buttons plus access to downloads, max is full with all buttons and settings.

The mapping of usernames to access levels is done via a userLevel file as explained in wiki

Note that the restrictions are just what is presented in the web interface.
Posts: 1277
Joined: Sun Feb 17, 2013 6:51 pm
by btidey » Mon Jun 19, 2017 2:14 pm
gigpi wrote:Hello btidey and once again thanks for your work here,

i'm having the camera freezing with the latest versions, usually in the morning. I can only see the same frame with the clock freezed, it says is recording a video but endless.

Only solution i have now is to reboot rPI..
I hope you can give me some more ideas to track back the problem.
Thank you.


Looks a bit strange to get a freeze without further log messages. Could you zip up uConfig and schedule.json from the web folder and attach here or PM them so I can see your set up.
Posts: 1277
Joined: Sun Feb 17, 2013 6:51 pm
by quavoce » Mon Jun 19, 2017 7:30 pm
harlock74 wrote:
Hi Quavoce,

I would also be interested in setting up a basic PHP Userform Login instead of using htaccess method. When you get a chance, would you please share any instructions?

Thanks a lot!

EDIT:

So far I have found these 3 ways, but I didn't figure out how to install:

https://github.com/delight-im/PHP-Auth#creating-a-new-instance
https://github.com/PHPAuth/PHPAuth
https://github.com/fethica/PHP-Login/blob/master/README.md

Robert is there any chance in the future to implement any of this PHP Userform Login in the setup?
Thanks!

Unfortunately I found it to be too insecure due to the way the software works. This could be just due to my inexperience with PHP though!
From what I understand, a piece of PHP code needs to be included in every web page so that when someone attempts to access that page, they are redirected to login:
Code: Select all
<?php require "login/loginheader.php"; ?>

The trouble is, this doesn't work on files such as cam.jpg which is easily accessible from the URL (and is an essential part of the software), so I had to abandon that method and go back to .htaccess which secures everything in the web root.

The downside with .htaccess and iPhones or iPads is that you have to enter the user/pass every time you try to watch each video. It's very frustrating but I can't see any other workaround as they don't store the credentials.

If anyone has found a solution to this I would be very eager to hear more!

Thanks.
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by quavoce » Mon Jun 19, 2017 7:40 pm
btidey wrote:I have added a method to give different levels of web functionality controlled by different user name logins.

Details are in wiki under additions and tricks.

The login in method is still the same (htaccess) but if you add extra named users to access the web pages then the username can be used to give 3 levels of access.

Minimum is preview only, medium is preview plus video,image, time lapse buttons plus access to downloads, max is full with all buttons and settings.

The mapping of usernames to access levels is done via a userLevel file as explained in wiki

Note that the restrictions are just what is presented in the web interface.

Thank you Robert, this sounds useful!
Posts: 81
Joined: Fri Nov 27, 2015 9:11 am
by harlock74 » Tue Jun 20, 2017 4:56 pm
btidey wrote:
harlock74 wrote:
Robert is there any chance in the future to implement any of this PHP Userform Login in the setup?
Thanks!


I encourage and welcome any improvements to merge into the repository.

My criteria are that the improvements need to be largely backwards compatible with existing operation and to be general purpose in nature.

The easiest way to submit is to test changes in a fork and then submit pull requests, but I am happy to help merge stuff in as necessary.


Hi Robert,

I am still comparing these different methods/softwares but I must admit I am not completely sure about the security level...but I am not an expert either :D

Having said that I will keep investigating and report back my findings.
Posts: 180
Joined: Fri Jan 18, 2013 10:47 am