nospam
Posts: 45
Joined: Sun Jun 14, 2015 10:38 pm

Re: RPi Cam Web Interface

Sun Jul 22, 2018 12:57 pm

Hi btidey,

Is there a way to get this thread under its own forum board index so users can start posting specific thread topics instead of having thousands of posts under one topic?

This forum topic is an excellent source of info but it's getting very difficult to follow individual sub-threads as there are dozens of different conversation going on overtop of each other.

Thank you for your excellent work and continued support!

ludespeedny
Posts: 103
Joined: Mon Oct 01, 2012 6:55 pm

Re: RPi Cam Web Interface

Mon Jul 23, 2018 6:12 pm

I am trying to set up a password and cannot get it to work. I run the install.sh file and specify a username and password. The password contains a $ and when done I can login but the password is everything in front of the $. I also tried adding a user via the htpasswd command, but seems like it isn't recognized. Can anyone help?

pundit
Posts: 9
Joined: Sat Jul 07, 2018 10:01 pm

Re: RPi Cam Web Interface

Tue Jul 24, 2018 9:08 pm

There is still no joy. My victory was false as I realized that if I'm within my own internal network i can connect fine. However, if I'm on the internet I cannot connect to my Pi.

Looks like my router is not forwarding.

This is my router log:

Jul 25 08:04:46 kernel: DROP IN=vlan2 OUT=br0 SRC=120.18.***.*** DST=192.168.2.159 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=32853 DF PROTO=TCP SPT=39936 DPT=55666 SEQ=1816105227 ACK=0 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (0204058C0402080A00A511C30000000001030306)
Jul 25 08:04:48 kernel: DROP IN=vlan2 OUT=br0 SRC=120.18.***.*** DST=192.168.2.159 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=32854 DF PROTO=TCP SPT=39936 DPT=55666 SEQ=1816105227 ACK=0 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (0204058C0402080A00A5128B0000000001030306)

Could someone please be able to decode this for me as to why my router is blocking this? I have disabled the firewall on the router and it still gives me no joy to access my cam from the internet.

So frustrating, any help would be very much appreciated.

Thank you.

pundit
Posts: 9
Joined: Sat Jul 07, 2018 10:01 pm

Re: RPi Cam Web Interface

Wed Jul 25, 2018 1:19 am

So after hours of working on this problem...

I worked my way through the logs on the system. I look through ufw logs and find that ufw is defn blocking the IP coming in from the inet (my phone IP) to the Rasp system. So I disable the ufw and restart the system.

Test it from inet and works just fine!!

In a nutshell.. read your logs, they will enlighten you! :D

mattj1061
Posts: 1
Joined: Tue Jul 31, 2018 3:51 pm

Re: RPi Cam Web Interface

Tue Jul 31, 2018 3:55 pm

This is a really cool project, great work those who made it. :D

The only button missing is a digital zoom slider. Can this be added? Or is there a way to add it myself?

5jjcopter
Posts: 1
Joined: Mon Jul 30, 2018 8:32 pm

Re: RPi Cam Web Interface

Tue Jul 31, 2018 7:40 pm

I have a problem, to see if I can help.
When I change the port of apache to another port other than 80 it stops working.
I have tested with port 8080, 6000,7000.
It only works with port 80.
Algien could help me.
Sorry for my bad English.

CharlyDelta
Posts: 93
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Wed Aug 01, 2018 7:23 pm

Hello


I'm 900 km from home, acces to surveillance camera (no-ip) and the programm is frozen at 2018.07.31 00.00.07. All buttons are jammed too. I'm connected to internet by a public hotspot and unable to reach the system by SSH. Is there a trick to reboot the system otherwise ?

Tnx for your help.

oldjake
Posts: 27
Joined: Fri Aug 03, 2018 12:39 pm

Re: RPi Cam Web Interface

Fri Aug 03, 2018 9:07 pm

I just have to say, this is amazing! Been using MotionEye for a few months and was getting really frustrated at the things it wouldn't do. It took me far to long to find this but I'm so glad I did. It's absolutely perfect for my use.

Might need a slicker interface :)

AdrianM
Posts: 21
Joined: Sun Mar 27, 2016 12:50 pm

Re: RPi Cam Web Interface

Wed Aug 08, 2018 11:15 am

Following the elinux.org installation instructions, I opted to use nginx as server during installation but the permissions for www folders seem to be causing problems:- e.g. on starting I see warnings like:

Code: Select all

[email protected]:~/RPi_Cam_Web_Interface $ ./start.sh
[email protected]:~/RPi_Cam_Web_Interface $ PHP Warning:  fopen(/var/www/scheduleLog.txt): failed to open stream: Permission denied in /var/www/html/config.php on line 65
checking permissions it looks like 775 which I thought would be right:

Code: Select all

[email protected]:~/RPi_Cam_Web_Interface $ ls -ld /var/www
drwxr-xr-x 3 root root 4096 Aug  7 21:05 /var/www
So I havn't been able to use RPi cam web interface yet - if I browse to my Pi's IP e.g. http://192.168.1.242/ as suggested for a port 80, no subfolder install, I just get the Welcome to nginx on Debian welcome page.
Any troubleshooting ideas for me?

edit: started debug and got;

{2018/08/08 11:19:02} start monitoring for pid: 30139
RaspiMJPEG Version 5.8.10
recommended video buffer size 65536
h264 size set to 131072
recommended video buffers 1
h264 buffers set to recommended 1
Error: Could not open main PIPE

AdrianM
Posts: 21
Joined: Sun Mar 27, 2016 12:50 pm

Re: RPi Cam Web Interface

Mon Aug 13, 2018 8:28 pm

<Shrug> New SD card arrived, Flashed latest Raspbian Stretch and followed installation instructions again for Nginx server. This time it worked first time.

oldjake
Posts: 27
Joined: Fri Aug 03, 2018 12:39 pm

Re: RPi Cam Web Interface

Sat Aug 18, 2018 9:56 am

Hi all

I'm experimenting at the moment. I want to use the camera as motion sensor to run a command:

DISPLAY=:0 xdotool key ctrl+q

I've read the bit in the instructions about macros but I don't seem to be getting the idea - not even where to start.

Is there a step by step tutorial somewhere?

Cheers
Andy

AndyM1972
Posts: 3
Joined: Tue Aug 21, 2018 11:09 am

Delete from DropBox

Tue Aug 21, 2018 11:19 am

Hi,
I'm using this excellent system with the also-excellent 'Dropbox Uploader' script. However, I have to manually remove files from my DropBox to stop it filling up.
I would like to modify 'preview.php' so that if I click the 'cross' button to delete a recording or image, it also sends a delete command to the 'dropbox_uploader.sh' script to remove the file from Dropbox. I'm not bothered about multiple deletes, I just want it to work on the 'cross' button.
I think I have found the relevant code in 'preview.php' and I have clumsily modified it thus:

"if (isset($_POST['delete1'])) {
deleteFile($_POST['delete1']);
maintainFolders(MEDIA_PATH, false, false);
exec(sudo /home/pi/Dropbox-Uploader/./dropbox_uploader.sh delete (MEDIA_PATH));
}"

It is not working. In fact, it kills the webpage completely and it will not load. I've saved an old copy of 'preview.php' so I'm just swapping them in and out while I play with the syntax.

Can anyone assist?
Many thanks. Andy.

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

Re: RPi Cam Web Interface

Tue Aug 21, 2018 4:24 pm

Latest version includes some recent functionality request.

1. System attempts to convert any left over h264 files. Normally these will have been converted to mp4, but as this is done asynchronously it is possible that some have not been processed if the camera system is shutdown while conversions are still being done.

2. A new USERLEVEL (USERLEVEL_MINP) now allow a display with the minimal live screen but read only access to the preview screen of previous recordings.

3. The disk usage display on the download screen is now configurable to allow other volumes to be displayed. This is done by editing the diskUsage.txt file. Details in the wiki

There have also been a couple of security clear ups. This means the time lapse conversion command can no longer be edited in the browser. The convertCmd.txt may be edited to change the command used.

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

Re: Delete from DropBox

Tue Aug 21, 2018 4:36 pm

AndyM1972 wrote:
Tue Aug 21, 2018 11:19 am
Hi,
I'm using this excellent system with the also-excellent 'Dropbox Uploader' script. However, I have to manually remove files from my DropBox to stop it filling up.
I would like to modify 'preview.php' so that if I click the 'cross' button to delete a recording or image, it also sends a delete command to the 'dropbox_uploader.sh' script to remove the file from Dropbox. I'm not bothered about multiple deletes, I just want it to work on the 'cross' button.
I think I have found the relevant code in 'preview.php' and I have clumsily modified it thus:

"if (isset($_POST['delete1'])) {
deleteFile($_POST['delete1']);
maintainFolders(MEDIA_PATH, false, false);
exec(sudo /home/pi/Dropbox-Uploader/./dropbox_uploader.sh delete (MEDIA_PATH));
}"

It is not working. In fact, it kills the webpage completely and it will not load. I've saved an old copy of 'preview.php' so I'm just swapping them in and out while I play with the syntax.

Can anyone assist?
Many thanks. Andy.
Good to hear that you have done some dropBox integration.

exec needs a string for the command and optional arguments.

However, it still won't work as is because the php files run as user www-data and won't be able to execute sudo based commands.

One way would be to give user www-data sudo access to the dropbox command using the sudoers.d RPI_Cam_Web_Interface file

One would still need to worry a bit about security implications of this. I treat dropBox very seriously as I certainly do not want back doors into that. One more secure method would just append filenames to a file when they are deleted in preview.php. Thats a nice straightforward modification. You could then have a separate program which could run periodically (e.g. under Cron) to check the list and delete the files accordingly.

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

Re: RPi Cam Web Interface

Tue Aug 21, 2018 4:52 pm

oldjake wrote:
Sat Aug 18, 2018 9:56 am
Hi all

I'm experimenting at the moment. I want to use the camera as motion sensor to run a command:

DISPLAY=:0 xdotool key ctrl+q

I've read the bit in the instructions about macros but I don't seem to be getting the idea - not even where to start.

Is there a step by step tutorial somewhere?

Cheers
Andy
There is no specific extra tutorial (If anybody wants to add to the wiki feel free).

The best way to get into macros is just to build it up slowly step by step.

cd to the macros folder

1. Start with the example macro test.sh which just writes the date to a file. Modify it so it writes to the folder where the web software is installed. (e.g. /var/www/html/testmacro.txt

2. Copy it to a name that runs whenever an image is taken. (sudo cp test.sh start_img.sh)

3. Make the macro file owned by user www-data and given execution permissions (sudo chown www-data:www-data start_img.sh) (sudo chmod 764 start_img.sh)

4. Now try it out by taking an image snapshot. You should get the testmacro.txt file written with current date

So now you have got a basic macro to work. More complex ones use the same process.

For motion detection you want to use motion_event.sh Try copying the test example to that (remove the start_img.sh) Now you can test that fires with motion events. The motion trigger feeds a parameter to the macro (1=start 0=stop) which you can access and test with a $ parameter in the bash script.

After you have got to this stage you can now put your own logic into the script. One thing you have to bear in mind is that the macros run under user www-data so any commands in the macro need to be accessible by this user. THis may need the permissions of special commands to be given special permission to run under www-data.

CharlyDelta
Posts: 93
Joined: Thu Jul 18, 2013 4:04 am
Location: Montreal

Re: RPi Cam Web Interface

Tue Aug 21, 2018 5:43 pm

I try to change the date and time with this function but without success (Standalone case)
It also allows editing of the macro script names and the manual setting of the Raspberry Pi date/time. Normally the date / time is maintained automatically by NTP when Raspberry is connected to internet. In standalone cases where there is no internet this allows the date / time to be initialised
Tnx for help

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

Re: RPi Cam Web Interface

Tue Aug 21, 2018 8:18 pm

CharlyDelta wrote:
Tue Aug 21, 2018 5:43 pm
I try to change the date and time with this function but without success (Standalone case)
It also allows editing of the macro script names and the manual setting of the Raspberry Pi date/time. Normally the date / time is maintained automatically by NTP when Raspberry is connected to internet. In standalone cases where there is no internet this allows the date / time to be initialised
Tnx for help
This does only work if it is truly standalone. If the Raspberry thinks it can get NTP then this will not work.

First test locally on Raspberry command window with

sudo date -s "timestring"

where timestring is something like 21 AUG 2018 22:00:00

If that works then this function should work.

AndyM1972
Posts: 3
Joined: Tue Aug 21, 2018 11:09 am

Re: RPi Cam Web Interface. Delete files from DropBox.

Wed Aug 22, 2018 11:08 am

@btidey Thanks for the tips. I think I was going about it the wrong way so what I've done is create a shell script (full paths removed for readability):

Code: Select all

ls CCTV > locallist.log  [CCTV is the local folder where all my videos and images are]

./dropbox_uploader.sh list > remotelist.log [Get list of files on DropBox]

sed -r 's/.{14}//' remotelist.log > newremotelist.log [Remove unnecessary characters returned by DropBox]

grep -Fxv -f locallist.log newremotelist.log > diffs.log [Check for differences]

sed -i '1d' diffs.log [Remove unnecessary top line returned in previous command]

cat diffs.log | while read line ; do ./dropbox_uploader.sh delete "$line"; done [Use contents of Diffs file to remove files on DropBox]
I could probably combine some of these commands, but I'm not very experienced in coding and I like to see & understand exactly what each step is doing.
I've got this running from Crontab and it is working well. The advantage of this method over what I was originally trying to do is that this will keep local and remote files in sync no matter what method is used to delete them, either 'cross' button, 'selective delete' or 'delete all'

Thanks for your help. Andy.
Last edited by AndyM1972 on Thu Aug 23, 2018 9:03 am, edited 2 times in total.

oldjake
Posts: 27
Joined: Fri Aug 03, 2018 12:39 pm

Re: RPi Cam Web Interface

Thu Aug 23, 2018 8:43 am

Couple of questions...

1. Shutter speed. I've just discovered this and what a difference it makes! I've got a camera by my front door. After dusk, it's pretty much useless. I set the shutter speed at various values up to 6,000,000 (despite the page saying that 330,000 is the max) and it turns it from useless to being able to see everything that's going on.

However, it works perfectly for preview but as soon as you turn motion detection on or even record manually then it seems to ignore the setting.

2. Schedule. I've a camera indoors with a schedule set from 09:00 to 20:00. I have it set with a ca 1 in motion start and ca 0 in motion stop. In order for it to detect motion, do I need motion detection on all the time, or will the scheduler switch motion detection on/off accordingly?

Any steer would be gratefully received.

Thanks for the steer on macros @btidey! I've now got the one I mentioned working and another that uses Twilio to send me an SMS if motion is detected on one particular camera.

Cheers
Andy

AndyM1972
Posts: 3
Joined: Tue Aug 21, 2018 11:09 am

Re: RPi Cam Web Interface

Thu Aug 23, 2018 8:59 am

@ oldjake

I have 'md 1' in the 'Period Start' field. That starts motion detection at the beginning of the relevant period.

Andy.

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

Re: RPi Cam Web Interface

Thu Aug 23, 2018 11:52 am

btidey wrote:
Tue Aug 21, 2018 4:24 pm
Latest version includes some recent functionality request.

1. System attempts to convert any left over h264 files. Normally these will have been converted to mp4, but as this is done asynchronously it is possible that some have not been processed if the camera system is shutdown while conversions are still being done.

2. A new USERLEVEL (USERLEVEL_MINP) now allow a display with the minimal live screen but read only access to the preview screen of previous recordings.

3. The disk usage display on the download screen is now configurable to allow other volumes to be displayed. This is done by editing the diskUsage.txt file. Details in the wiki

There have also been a couple of security clear ups. This means the time lapse conversion command can no longer be edited in the browser. The convertCmd.txt may be edited to change the command used.
The security changes broke the action of some buttons on the download page. New version fixes that.

oldjake
Posts: 27
Joined: Fri Aug 03, 2018 12:39 pm

Re: RPi Cam Web Interface

Fri Aug 24, 2018 7:44 pm

AndyM1972 wrote:
Thu Aug 23, 2018 8:59 am
@ oldjake

I have 'md 1' in the 'Period Start' field. That starts motion detection at the beginning of the relevant period.

Andy.
Ah! That's what I'm missing. Cheers for that.

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

Re: RPi Cam Web Interface

Sat Aug 25, 2018 8:18 am

oldjake wrote:
Thu Aug 23, 2018 8:43 am
Couple of questions...

1. Shutter speed. I've just discovered this and what a difference it makes! I've got a camera by my front door. After dusk, it's pretty much useless. I set the shutter speed at various values up to 6,000,000 (despite the page saying that 330,000 is the max) and it turns it from useless to being able to see everything that's going on.

However, it works perfectly for preview but as soon as you turn motion detection on or even record manually then it seems to ignore the setting.


Cheers
Andy
Once video recording starts then you can't use long shutter speeds as that is in conflict with video frame rate. You can try slowing down the video frame rate as well.

The scheduler lets you send any sequence of camera commands so you can change round settings when dusk period starts.

AdrianM
Posts: 21
Joined: Sun Mar 27, 2016 12:50 pm

Re: RPi Cam Web Interface

Sat Aug 25, 2018 9:13 pm

I had hoped to be able to turn on/off motion detection by sending http requests from another client on the same LAN to the RPi Cam control port. I thought /etc/motion/motion.conf had to have the localhost setting to off to permit this...

Code: Select all

control_port 6642
control_localhost off
control_html_output off
But for initial testing, just trying to browse to http://<mycameraip>:6642/0/config/list (in chrome, on a PC) fails with the error "<mycameraip> refused to connect."

I therefore suspect I am misunderstanding things - maybe control_localhost on/off simply enables/disables control from the RPi hosting the Cam Web interface?

I know I can issue commands over the FIFO pipe directly on the host but I need remote operation. I guess I could create my own php server script to do this but if there's a more direct way to interact with the API that's what I'd like to do.

oldjake
Posts: 27
Joined: Fri Aug 03, 2018 12:39 pm

Re: RPi Cam Web Interface

Sun Aug 26, 2018 6:06 pm

Disaster!

Just been to the wiki page as I have another Pi built and ready to go but the page is down. Do the install instructions exist anywhere else?

Cheers
Andy

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 10 guests