wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Tue Mar 10, 2015 6:00 pm

Hi

Running the latest version with motion/scheduling settings and have some issues

1) Motion - does not seem to work - appears to be running but motion capture not being triggered - how can I test/fix this?

2) Timelapse - runs fine and download images page shows timelapse with 20 images, but when I click on it I can only see one image and when I choose to download I only get 1 image, not all 20?

3) When downloading using the get zip option - the files being downloaded are the ones with "th" in title i.e the reduced size thumbnail views - not the full images?

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

Re: RPi Cam Web Interface

Tue Mar 10, 2015 6:51 pm

wingers wrote:Hi

Running the latest version with motion/scheduling settings and have some issues

1) Motion - does not seem to work - appears to be running but motion capture not being triggered - how can I test/fix this?

2) Timelapse - runs fine and download images page shows timelapse with 20 images, but when I click on it I can only see one image and when I choose to download I only get 1 image, not all 20?

3) When downloading using the get zip option - the files being downloaded are the ones with "th" in title i.e the reduced size thumbnail views - not the full images?
1) Motion triggers go through scheduler FIFO1 and get passed onto raspimjpeg if set up correctly. The scheduler log should show motion trigger requests and what it did with them. So start there to first make sure the triggers are turning up and then what is happening to them.They can get discarded at different times of the day if scheduler is set up to do that.

2) Time lapse is deliberately set up to have 1 thumbnail representing the first of a sequence, otherwise you could end up with a lot of icons. Clicking the display to bring up the larger one also just shows the first, although I am thinking of trying to add a step through control for that. The big download button currently also just gets 1. It is not possible in a browser to download multiple files from 1 click due to security issues. That is why there is a get zip for multiple selects. I don't think the current code collects all the time lapse from 1 group together. I'll look into that.

3) That's a bug I am looking at.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Tue Mar 10, 2015 7:14 pm

btidey wrote:
1) Motion triggers go through scheduler FIFO1 and get passed onto raspimjpeg if set up correctly. The scheduler log should show motion trigger requests and what it did with them. So start there to first make sure the triggers are turning up and then what is happening to them.They can get discarded at different times of the day if scheduler is set up to do that.

2) Time lapse is deliberately set up to have 1 thumbnail representing the first of a sequence, otherwise you could end up with a lot of icons. Clicking the display to bring up the larger one also just shows the first, although I am thinking of trying to add a step through control for that. The big download button currently also just gets 1. It is not possible in a browser to download multiple files from 1 click due to security issues. That is why there is a get zip for multiple selects. I don't think the current code collects all the time lapse from 1 group together. I'll look into that.

3) That's a bug I am looking at.
1) I am not using scheduling? just the motion detection start button? checked in scheduling log and it is blank - so does this mean scheduling has to be started for motion to now work? assumed these were two separate things - just tried it with scheduling started and yes it does work, but captures a few images of motion and then turns motion start button off again - SEE MY POST BELOW FOR BETTER EXPLANATION OF WHAT HAPPENS

2) even using get zip it only downloads one image for time lapse and not all of them

3) okay cool
Last edited by wingers on Tue Mar 10, 2015 7:39 pm, edited 1 time in total.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Tue Mar 10, 2015 7:33 pm

when I click "motion detection start" (with schedule already started) - it starts as it should and button now says "motion detection stop" - when it detects movement for some reason it then shows "motion detection start" and "timelapse stop" as it processes image, then both buttons show start but it is still running motion?

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

Re: RPi Cam Web Interface

Tue Mar 10, 2015 8:00 pm

wingers wrote: 1) I am not using scheduling? just the motion detection start button? checked in scheduling log and it is blank - so does this mean scheduling has to be started for motion to now work? assumed these were two separate things - just tried it with scheduling started and yes it does work, but captures a few images of motion and then turns motion start button off again - SEE MY POST BELOW FOR BETTER EXPLANATION OF WHAT HAPPENS

2) even using get zip it only downloads one image for time lapse and not all of them

3) okay cool
1) Yes. Scheduling must normally be running as the motion triggers are piped through there. I want to improve the automation of schedule so that you don't need to worry about start stopping the scheduler but haven't done that yet. I have had my scheduler running now for over 2 weeks and I only stop start it when changing settings.

2) Updated version on github now downloads real files in a zip. If time lapses are included then all captures for that batch are included. If a timelapse is clicked to bring up a preview then the download button gets a zip of all the lapse images. Image and video previews continue to get just the 1 file in jpg or mp4.

Note that zip operations can take a little while to put together so there is can be a delay until the download starts. This would particularly apply to a timelapse with a lot of images. I am seeing about 2 secs per hd image on a B+, probably quite a bit better on a Pi2.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Tue Mar 10, 2015 8:11 pm

btidey wrote:
1) Yes. Scheduling must normally be running as the motion triggers are piped through there. I want to improve the automation of schedule so that you don't need to worry about start stopping the scheduler but haven't done that yet. I have had my scheduler running now for over 2 weeks and I only stop start it when changing settings.

2) Updated version on github now downloads real files in a zip. If time lapses are included then all captures for that batch are included. If a timelapse is clicked to bring up a preview then the download button gets a zip of all the lapse images. Image and video previews continue to get just the 1 file in jpg or mp4.

Note that zip operations can take a little while to put together so there is can be a delay until the download starts. This would particularly apply to a timelapse with a lot of images. I am seeing about 2 secs per hd image on a B+, probably quite a bit better on a Pi2.
1) okay makes sense - but doesn't explain why it does this - when I click "motion detection start" (with schedule already started) - it starts as it should and button now says "motion detection stop" - when it detects movement for some reason it then shows "motion detection start" and "timelapse stop" as it processes image, then both buttons show start but it is still running motion?

2) just done a git pull origin master - but get zip still only contains a single thumbnail image and download button when preview open still downloads 1 jpg file as before?

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

Re: RPi Cam Web Interface

Tue Mar 10, 2015 8:23 pm

wingers wrote:when I click "motion detection start" (with schedule already started) - it starts as it should and button now says "motion detection stop" - when it detects movement for some reason it then shows "motion detection start" and "timelapse stop" as it processes image, then both buttons show start but it is still running motion?
Not sure I understand that. Are you saying the scheduler stops all by itself?

The general idea here is to let scheduler do the automation of on/off and which commands are used.

The scheduler is capable of turning motion detect on/or off if it enters a day period if it has been set to do that. The default setting does have it translating any motion commands into other things like timelapse instead of video but motion detect is also set to have been switched off here. It would probably be better if the commands were also blanked in those periods. If you are manually turning on motion detect then triggers are generated and those commands will be sent.

When the scheduler is started then it will send in the mode commands appropriate to the day period you are in and from then on whenever the day period changes, e.g. from day to dusk.

Check and post a bit of the scheduler log if it's still not clear.

If you don't want scheduler to change the behaviour at different times of the day. One can change the motion settings to send ca 1 (start capture) and ca 0 (stop capture) into FIFO rather than FIFO 1 so that scheduler is not involved and can be left stopped. However, I find it very convenient to turn motion detection on and off automatically to avoid lost of spurious motion recordings at night, together with changing the camera automatically from auto to night mode to extend the period when it can usefully show and grab stuff.

Or if you want to start simple then change scheduler so that all mode commands are blank. I.e it won't attempt to change during the day. The set all on commands to ca 1 and all off commands to ca 0. Now when motion is running by manually starting and stopping it then scheduler just passes the normal commands on (with scheduler running of course.) When you are happy with that then start to change scheduler settings to turn motion detect on and off, and alter camera set up during the day.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Tue Mar 10, 2015 8:31 pm

Starting from a clean boot - I open the web interface and click Start in Schedule Settings (all settings default and have not been changed)

I then click "Motion Detection Start" button and it changes to "Motion Detection Stop" and all other buttons are greyed out

If I then move my hand in front of camera so it detects motion - then "Timelapse Stop" button is shown with all other buttons greyed out for a few moments, then all buttons show enabled and showing Start rather than Stop - motion is still running as I can click edit motion settings

If I then put hand in front of camera again to trigger motion - it does the same i.e. all buttons greyed out except "Timelapse Stop" whilst it processes image, and then all buttons enabled but showing Start rather than Stop

Hope this makes sense

Schedule log below:-

Code: Select all

[2015/Mar/10 20:31:13] RaspiCam support started
[2015/Mar/10 20:31:13] Capture Pipe already exists /var/www/FIFO1
[2015/Mar/10 20:31:13] New period detected 3
[2015/Mar/10 20:31:13] Send md 0
[2015/Mar/10 20:31:15] Send em night
[2015/Mar/10 20:31:21] Start capture requested
[2015/Mar/10 20:31:21] Send tl 20
[2015/Mar/10 20:31:23] Ignore FIFO char 

[2015/Mar/10 20:31:24] Stop capture requested
[2015/Mar/10 20:31:24] Send tl 0
[2015/Mar/10 20:31:26] Ignore FIFO char 

[2015/Mar/10 20:31:26] Start capture requested
[2015/Mar/10 20:31:26] Send tl 20
[2015/Mar/10 20:31:28] Ignore FIFO char 

[2015/Mar/10 20:31:28] Stop capture requested
[2015/Mar/10 20:31:28] Send tl 0
[2015/Mar/10 20:31:30] Ignore FIFO char 

[2015/Mar/10 20:31:32] Stop capture request ignored, already stopped
[2015/Mar/10 20:31:32] Ignore FIFO char 

[2015/Mar/10 20:31:32] Stop capture request ignored, already stopped
[2015/Mar/10 20:31:32] Ignore FIFO char 

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

Re: RPi Cam Web Interface

Tue Mar 10, 2015 10:50 pm

wingers wrote:Starting from a clean boot - I open the web interface and click Start in Schedule Settings (all settings default and have not been changed)
This is sort of what I expected. The issue is a combination of the ambiguous defaults and the fact that you manually enabled motion detection.

When the scheduler started it decided that it was in dusk so sent commands to turn motion detection off. It still had on commands tl 20 and tl0 to start and stop time lapse recordings if motion was detected but these would ordinarily not have been used as it had disabled motion detection. I had left those in there to allow easy experimenting with time lapse recording instead of video capture outside of daytime.

You now overrode that by manually turning motion detection on so that when triggers came in scheduler passed the time lapse start and stop commands in. Note that scheduler currently has no knowledge of whether motion detection is actually on or off or if you have manually started it. It is just a means of sending command strings into raspimjpeg and translating trigger signals it receives.

To try to avoid others falling into this trap I have changed the defaults so that it only turns in motion during the daytime period and sends no on/off commands through in other periods. This means that if you turn on motion detection manually it won't capture other than in daytime.

Note you will only get defaults if there is not already saved user settings. One can just delete the schedule.json file to get back to a clean system.

As I said you can simulate a totally manual system by removing all mode commands and putting ca 1 in all the on boxes and ca 0 in all the off boxes. This is then equivalent to a non scheduled system. Nothing happens until you manually start detection and it will then capture video start stop whenever it occurs.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Tue Mar 10, 2015 10:55 pm

okay thanks - that makes more sense to me - do think it could be done in a less confusing way for the user perhaps though - i.e. so manual motion capture can still be used as before, but so you can have option say a tick box or something to use schedule settings - so if not selected it is just default motion - if selected then it uses the schedule settings - if not for first use of new version like I did today it is not immediately obvious that schedule is for time lapse and overrides the default button

EDIT: or perhaps just rethink the buttons - so you have a button for STANDARD MOTION START/STOP and one for SCHEDULED MOTION START/STOP - clicking the scheduled one would be equivalent of clicking start in the scheduler settings page - then you could have one settings page for motion divided into standard/global settings at top and scheduled motion settings at the bottom
Last edited by wingers on Tue Mar 10, 2015 10:58 pm, edited 1 time in total.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Tue Mar 10, 2015 10:55 pm

p.s. keep up the great work though, only my suggestions - I do really appreciate all the improvements you are making to it

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

Re: RPi Cam Web Interface

Tue Mar 10, 2015 11:16 pm

wingers wrote: EDIT: or perhaps just rethink the buttons - so you have a button for STANDARD MOTION START/STOP and one for SCHEDULED MOTION START/STOP - clicking the scheduled one would be equivalent of clicking start in the scheduler settings page - then you could have one settings page for motion divided into standard/global settings at top and scheduled motion settings at the bottom
Yes. I am trying to make it a bit more straightforward and consistent but it's trickier because this is built out of a number of pieces that don't really know what the other pieces are doing. One method that might work is to pass the manual motion start request through scheduler rather than act independently. That way scheduler would know that it was manually off or on. The analogy would be like a central heating override control where you turn it on (or off) until the next scheduled transition.

The other major I want to have a go at is the fundamental video capture using a buffering method that would allow pre-recording of data just before the trigger rather than the significant delay there is at the moment. That is quite a complicated piece though.

RoddyJoff
Posts: 41
Joined: Wed Jan 15, 2014 3:31 pm
Location: Manchester, UK

Re: RPi Cam Web Interface

Wed Mar 11, 2015 3:31 pm

Hello,

I have been following this thread for a several weeks now but have not been active for a while due to a house move.

I am a novice, well maybe a novice+, with regards to configuring an RPi but did successfully install Steven Melchior's Raspbian camera project. I then added the Pi-Pan modules as well.

Sometime later I updated my system and lost the pi-pan controls - then I moved house ;-( so the project was halted for a while.

I'm now in the process of attempting to get it all to work again but having tried to read through this thread am confused.

It appears that BTIDEY has taken over the project by the many editions he has posted so my question is where should I start to achieve a working RPI Camera control that will function with the Pi-Pan modules? Do I start with Steven Melchior's package or BTIDEY's? (and if the latter how do I obtain the software?)

Apologies for the basic questions, I thought I was making progress but seem to have taken a few steps backwards.

Kind regards,
------------------------------------
The best things in life are free.

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

Re: RPi Cam Web Interface

Wed Mar 11, 2015 5:19 pm

RoddyJoff wrote: It appears that BTIDEY has taken over the project by the many editions he has posted so my question is where should I start to achieve a working RPI Camera control that will function with the Pi-Pan modules? Do I start with Steven Melchior's package or BTIDEY's? (and if the latter how do I obtain the software?)
I haven't really taken over the project. I just started forking the excellent original code and adding in stuff that was useful to me, initially on the web views where the plain list of captures names made it a bit tedious to manage. I put them up here as they could be useful for others.

The instructions for adding in pi-pan are on the wiki. http://elinux.org/RPi-Cam-Web-Interface
They consist of adding in the pi-pan stuff and then adding a bit of extra code to the main index.php and adding a couple of extra files to www. These instructions equally apply to my version.

Note, however, that you currently lose at least the changes to index.php every time you update the software from either repository because it would replace your edited index.php with one not containing pi-pan.

What might be useful is to put those pipan controls in the repository and then have a way of enabling it for those wishing to use pi-pan. I can have a look at that.

To get and install my version you do exactly the same as you would with the original but use my github instead https://github.com/roberttidey/RPi_Cam_Web_Interface

RoddyJoff
Posts: 41
Joined: Wed Jan 15, 2014 3:31 pm
Location: Manchester, UK

Re: RPi Cam Web Interface

Wed Mar 11, 2015 5:24 pm

Many thanks for your reply - an informative response has answered all my questions!

I'll use your code with a brand new NOOBs install and then add the pi-pan bits when I am happy all is working.

I'll be back with an update as soon as I have finished.

Thanks again.

Regards.
------------------------------------
The best things in life are free.

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

Re: RPi Cam Web Interface

Wed Mar 11, 2015 5:28 pm

There was a slightly confusing bit of the interface around time lapse recording if triggered by motion detection.

When motion detection was enabled (either manually or by schedule) then the other buttons were grayed out. If a video was triggered the buttons would show this and then at the end it would end up with again motion detection shown as active (and the other buttons grayed out.

If time lapse was triggered by motion it would work the same except that at the end of the sequence the button status were all live seeming to indicate that motion was off and manual operations could be done. In reality motion was still active; it was just the buttons were not being restored correctly by raspimjpeg to show motion active.

This is now fixed in the latest of my version.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Wed Mar 11, 2015 5:39 pm

If I click start in schedule then motion all working fine - and now buttons showing correctly as per your last update - BUT if I then go back into schedule and click stop, when I then go back to main interface motion detection stop button is showing and all others disabled?

RicoJA
Posts: 5
Joined: Sat Mar 29, 2014 2:07 am

Re: RPi Cam Web Interface

Wed Mar 11, 2015 6:02 pm

Has anyone thought of adding motion tracking to this project?

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Wed Mar 11, 2015 6:03 pm

suggestion - on the schedule page it might be worth adding a note at the bottom of the screen showing available options that can be used i.e. md 0, md 1 em night, tl 20 tl 0 ca 1 ca 0 etc - so it is easy to see for newbies what each day/night/dusk/dawn setting is doing and how it can be changed - I know it is mentioned in forum/documentation, but always easier to have it in same place as settings for quick reference

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Wed Mar 11, 2015 6:16 pm

suggestion - move schedule start/stop button to main page like others - then can be more obvious when schedule running or not?

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

Re: RPi Cam Web Interface

Wed Mar 11, 2015 6:53 pm

I have added the pipan / pilight web related stuff from the wiki to my fork so that updates won't lose this each time. It does not install the other pipan stuff just the web end. I also don't use these myself so have no idea whether this is working or not.

The controls for these do NOT appear by default and behaviour is as before. As a 'temporary' way of enabling these the pages check for files called pipan_on and pilight_on in the www folder. I have put pipan_off and pilight_off in there so they just need to be renamed as needed. That should survive an update but not a remove / reinstall.

With both on it looks like below where pilight is under camera settings. The RGB values are not persisted.

I'm not sure who contributed the original wiki stuff. If they are not happy with me copying into my fork or want an acknowledgement there please let me know.
Attachments
Index2.jpg
Index2.jpg (50.1 KiB) Viewed 2939 times

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

Re: RPi Cam Web Interface

Wed Mar 11, 2015 6:59 pm

wingers wrote:If I click start in schedule then motion all working fine - and now buttons showing correctly as per your last update - BUT if I then go back into schedule and click stop, when I then go back to main interface motion detection stop button is showing and all others disabled?
Normally you should just leave schedule running all the time. I will check out the suggestion of moving the button to main page each web page runs as separate entity so I'll need to think about it for a bit.

wingers
Posts: 60
Joined: Wed Dec 31, 2014 8:31 pm

Re: RPi Cam Web Interface

Wed Mar 11, 2015 7:09 pm

btidey wrote:Normally you should just leave schedule running all the time. I will check out the suggestion of moving the button to main page each web page runs as separate entity so I'll need to think about it for a bit.
But surely if I leave schedule running all the time then it is constantly doing motion captures during the day?

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

Re: RPi Cam Web Interface

Wed Mar 11, 2015 11:08 pm

wingers wrote:
btidey wrote:Normally you should just leave schedule running all the time. I will check out the suggestion of moving the button to main page each web page runs as separate entity so I'll need to think about it for a bit.
But surely if I leave schedule running all the time then it is constantly doing motion captures during the day?
That was the general intention here. I.e. the scheduler determines when to turn motion detection on and off at times when the light is good enough. Scheduler is then just deciding what to do when it gets motion start and stop events. If you tune up the motion detection settings then you should get few false detections.

If you take out any md 1 from the scheduler (day), then the scheduler will never turn on motion detection by itself and you can then turn motion on and off manually. The scheduler still runs all the time and passes through any detect events to start and stop recordings.

If we want more flexibility on day periods to allow automation to match other needs then I'm open to suggestions. The Night, Dawn, Day, Dusk scheme was designed to allow track light variations throughout the year without having to adjust times manually.

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

Re: RPi Cam Web Interface

Wed Mar 11, 2015 11:10 pm

I have tuned up the styling a bit on motion and scheduling pages. The scheduling page also now has a command reference table built in.

Return to “Camera board”