User avatar
Gavinmc42
Posts: 3150
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jun 28, 2017 1:45 pm

I use a USB externally powered 3.5" caddy with currently a 3TB WD purple.
First 1TB ran fine for 18months till it filled up.
So much easier to use USB drives than network ones.

One day I will figure out remote network drives :oops:
I figure I have three plus years to figure it out before needing another drive.
Maybe by then image recognition software might only save the relevant videos.

Booting from USB stick takes a bit longer but I have heard they should last longer.
My development Pi3's run from tiny 32GB USB sticks, but they don't run 24/7.

My SDcard versions need a new sdcard every year or so.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 06, 2017 6:04 pm

I'm aiming to setup a status notification for a camera (and a bunch more in future), but I'm unable to find a way of verifying if 'motion' is currently enabled for PiKrellCam other than the OSD. I've trawled through most -if not all- of this thread & the help page and gleamed a great deal but haven't found a solution to this as yet. Was hoping for something like on_motion_enabled and on_motion_disabled in ~/.pikrellcam/pikrellcam.conf. billw or anyone else have an idea? Maybe there's a command I've overlooked somewhere?
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 07, 2017 1:46 am

chrisoh wrote:I'm aiming to setup a status notification for a camera (and a bunch more in future), but I'm unable to find a way of verifying if 'motion' is currently enabled for PiKrellCam other than the OSD. I've trawled through most -if not all- of this thread & the help page and gleamed a great deal but haven't found a solution to this as yet. Was hoping for something like on_motion_enabled and on_motion_disabled in ~/.pikrellcam/pikrellcam.conf. billw or anyone else have an idea? Maybe there's a command I've overlooked somewhere?
Motion enabled state is always in /var/run/pikrellcam/state. The line if on is:
motion_enable on

Motion is always under external control so there's no on_command for it. Presumably
if you enable it via the at-commands.conf file you can also do something there to
notify something else that motion_enable is being changed. Is there something you
need beyond that?

User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 07, 2017 10:03 am

billw wrote:Motion enabled state is always in /var/run/pikrellcam/state. The line if on is:
motion_enable on
Thankyou, of course I missed that one. I had a hunch that it would be in this thread somewhere, indeed it's on page 15
billw wrote:Motion is always under external control so there's no on_command for it. Presumably
if you enable it via the at-commands.conf file you can also do something there to
notify something else that motion_enable is being changed. Is there something you
need beyond that?
That does make sense. I guess the on_motion_enabled/disabled would be a convenience really, my scenario being: I have a multi-camera dashboard, and rather than enabling through at-commands at preset times, I'm 'requesting' that motion be enabled on groups of cameras simultaneously through fifo. And currently, with /var/run/pikrellcam/state now incorporated, it's necessary to make a second request to each camera after a delay of ~1 second (for motion_enabled to be updated), to confirm motion is indeed enabled. This delay introduces some uncertainty in the setup, and it'd be ideal if each camera 'reported back' through on_motion_enabled as and when that occurs. I.e. instead of one parent asking all the kids if they're OK, the kids can tell the parent they're current mood. Thinking further, on_motion_changed may be better, to incorporate states [enabled|disabled|failed|need cookies].
Secondly, it would also permit on-pi commands to be executed that are motion-dependent, such as lighting etc (e.g. indicating the 'armed' and 'disarmed' status).
I haven't seen much talk of multi-camera management in this thread, so maybe it's an unusual use-case.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 07, 2017 5:20 pm

chrisoh wrote: That does make sense. I guess the on_motion_enabled/disabled would be a convenience really,
Possibly just a convenience, but I guess there's no real reason to not have the commands.
I'm in the middle of some changes but maybe I can get them added soon.

User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jul 10, 2017 12:21 am

billw wrote:Possibly just a convenience, but I guess there's no real reason to not have the commands.
I'm in the middle of some changes but maybe I can get them added soon.
That'd be great, looking forward to the update. I'll see what else I can find...
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 28, 2017 7:53 pm

In my plight for Zen I've managed to cobble together a useful-enough centralised multi-camera web app for PiKrellCam which essentially extracts away from the current camera-specific web interface approach entirely (file management is last on the list).
This is achieved through a custom API layer added to each Pi camera, which enables a central GUI based approach to many of the configuration aspects instead of editing individual conf files for each camera and handles some logic regarding camera state and at-commands etc. A core feature I'm aiming at is the timing management, and in the example below, all the logic behind toggling 'modes' between 24hour surveilance and night-time only is wrapped up into a chunky onscreen button. I've also made a wall-mounted device which serves as a manual remote, much like a traditional alarm control panel but it's on the slab for some reflow right now so no pics.
Bill, would you have any qualms about it if I were to share the web app in the future? I'll try and get some more screen snaps up soon (they're littered with my dev notes currently).

pkmulticam_170721.jpg
pkmulticam_170721.jpg (55.84 KiB) Viewed 6019 times

Following up from the previous posts, I have a further feature suggestion which could be useful but am unsure if it's viable or already existing (I couldn't find it in the confs and docs). Would it be possible to include a config option which enables/disables recording of videos and images? Meaning PiKrellCam can essentially become a motion detection tool as well as a motion recording tool. Possibly two new parameters being capture_video on/off and capture_still on/off, with on_motion_begin and on_motion_end still being called so other processes can be initiated. Personally, I'd currently use it to notify that certain cars have arrived/departed a property (giving me time to put the kettle on), where I don't necessarily need a video of the event. Or maybe that the cat has passed though the cat-flap and cat food should be auto-dispensed 60 seconds later, though that's likely ripe for feline abuse. Thoughts?
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 28, 2017 11:13 pm

chrisoh wrote:
Fri Jul 28, 2017 7:53 pm
Bill, would you have any qualms about it if I were to share the web app in the future? I'll try and get some more screen snaps up soon (they're littered with my dev notes currently).
Sure, it is fine with me if you share use of your web app. I would be very
interested in seeing it.
Following up from the previous posts, I have a further feature suggestion which could be useful but am unsure if it's viable or already existing (I couldn't find it in the confs and docs). Would it be possible to include a config option which enables/disables recording of videos and images? Meaning PiKrellCam can essentially become a motion detection tool as well as a motion recording tool.
While I haven't done this yet, I've already been thinking this is something I
will need to do since I see a use case for it with the loop video recording
feature I'm working on.

The deal is that a 700 MHz Model 1 (single core) just doesn't have enough
power to simultaneously record a loop video and a motion detect video if
also recording audio and there will be lost video and audio frames.
Not sure yet if some degree of overclocking can help enough. So, for those
who have a Model 1 and will want to do audio/video loop recording, having
motion detects triggering something besides a motion video would likely be
very useful.

Since I've been working on this loop feature I just haven't
had the code base in a state where I can push an upgrade and so have been
slow to get to your original on_motion_enable request. Sorry for that.

User avatar
chrisoh
Posts: 217
Joined: Sun Dec 06, 2015 8:50 pm
Location: Essex, UK

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 29, 2017 6:38 pm

billw wrote:
Fri Jul 28, 2017 11:13 pm
Sure, it is fine with me if you share use of your web app. I would be very interested in seeing it.
Great, once I've got it cleaned up I'll be in touch. The web app is fairly independent and 'fails gracefully' but the onboard API is tightly dependent on PiKrellCam's codebase and file formatting so it'd be handy for you to have a quick squiz at it and highlight any potential hiccups before hand if you have the time.
billw wrote:
Fri Jul 28, 2017 11:13 pm
Since I've been working on this loop feature I just haven't had the code base in a state where I can push an upgrade and so have been
slow to get to your original on_motion_enable request. Sorry for that.
Sounds like a very handy feature! Possibly breathing some life into a few dusty Pis I've laying around, I look forward to trying it. And no need to apologise for the on_motion_enable request, you're doing amazing work with PiKrellCam and it's just a convenience thing in the grand scheme of things really.
Raspberry Pi 3 model B Idle @ 250mA
  • HDMI +200mA
  • Minecraft 1.9 Server +100mA
  • 2.4Ghz dongle +20mA

jit
Posts: 33
Joined: Fri Apr 18, 2014 2:52 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 04, 2017 7:17 pm

I couldn't see this in the docs, but was wondering whether its possible to passthrough the date of a motion event to the on_motion_end command?

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 05, 2017 3:38 pm

jit wrote:
Fri Aug 04, 2017 7:17 pm
I couldn't see this in the docs, but was wondering whether its possible to passthrough the date of a motion event to the on_motion_end command?
There's no direct date passing but the date is in the motion video name. Pass the last video name to your script with the $v variable and
parse it. Something like:

Code: Select all

#!/bin/bash

# Test video name.
VIDEO=/home/pi/pikrellcam/media/videos/motion_2017-08-04_10.45.32_207.mp4

# If $v is first arg:
#VIDEO=$1

# get date text after the ".../motion_":
DATE=${VIDEO/*motion_/}

#echo $DATE

YEAR=`expr substr $DATE 1 4`
MONTH=`expr substr $DATE 6 2`
DAY=`expr substr $DATE 9 2`

HOUR=`expr substr $DATE 12 2`
MIN=`expr substr $DATE 15 2`
SEC=`expr substr $DATE 18 2`


echo $YEAR $MONTH $DAY  $HOUR $MIN $SEC


jit
Posts: 33
Joined: Fri Apr 18, 2014 2:52 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Aug 06, 2017 7:38 pm

billw wrote:
Sat Aug 05, 2017 3:38 pm
jit wrote:
Fri Aug 04, 2017 7:17 pm
I couldn't see this in the docs, but was wondering whether its possible to passthrough the date of a motion event to the on_motion_end command?
There's no direct date passing but the date is in the motion video name. Pass the last video name to your script with the $v variable and
parse it. Something like:

Code: Select all

#!/bin/bash

# Test video name.
VIDEO=/home/pi/pikrellcam/media/videos/motion_2017-08-04_10.45.32_207.mp4

# If $v is first arg:
#VIDEO=$1

# get date text after the ".../motion_":
DATE=${VIDEO/*motion_/}

#echo $DATE

YEAR=`expr substr $DATE 1 4`
MONTH=`expr substr $DATE 6 2`
DAY=`expr substr $DATE 9 2`

HOUR=`expr substr $DATE 12 2`
MIN=`expr substr $DATE 15 2`
SEC=`expr substr $DATE 18 2`


echo $YEAR $MONTH $DAY  $HOUR $MIN $SEC

Great, thanks for that @billw.

DaveDJ
Posts: 11
Joined: Tue Jul 18, 2017 2:12 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 19, 2017 10:35 pm

@Billw

As Stretch has just been released would updating a very stable Pikrellcam running on Jessie be of any benefit to performance

Thanks
Dave

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Aug 20, 2017 3:24 pm

DaveDJ wrote:
Sat Aug 19, 2017 10:35 pm
As Stretch has just been released would updating a very stable Pikrellcam running on Jessie be of any benefit to performance
Updating gets you new versions of libraries, but there would have to new optimizations in them for you to see any performance gains.
So I could be wrong, but I doubt you would see anything noticeable. I would upgrade for new versions of programs and new features
in the distribution and not so much for performance.

stainy
Posts: 14
Joined: Thu Mar 08, 2012 1:29 pm
Location: Charlotte, NC

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 25, 2017 12:23 pm

Hi Bill..

Thanks for the great piece of software. I hadn`t use mine since last year, but my little boy wanted to catch which cat was getting into his underwear drawer. So I set it up and caught her :)

But I had a lot of motion detected videos that had no motion in them. I`m using the original pinoir cam with infra red lamps.
Looking at the live feed it`s picking up lots of noise. I`m guessing the noise gets so bad in the night that it kicks off motion detection. How can I lessen that? I had a look at some settings but couldn`t work out which would help me.
thanks

Darren

juan15pablo
Posts: 1
Joined: Sat Aug 26, 2017 4:12 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 26, 2017 4:20 pm

Hi!
Sorry for re open the post.

I have an issue with the timelapse. When I try to make a long timelapse, the RPI crashes and I need to reboot it unplugging the power (loosing all the timelapse data).
It is a RPI 3, 1gb of ram, and a 2.5A power source.

Maybe the avconv saturate the RPI?
Any advice?

Regards!

dmurphydrtc
Posts: 28
Joined: Tue Jan 29, 2013 5:30 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 30, 2017 8:14 am

Hi all,

I would like to include the following information in the header of the still/video "sydney at 18:00: 14 C, fair, 5.7 mps wind from S" prepended with the date. eg 30/08/2017, sydney at 18:00: 14 C, fair, 5.7 mps wind from S. I am using this script "finger o:[email protected]" to get this data "sydney at 18:00: 14 C, fair, 5.7 mps wind from S". My capabilities when it comes to bash are limited but I can't figure out how to modify the pikrellcam.conf or generate a shell script to do the above.

I thought there might be an option (annotate text file) with this but can't find anything even after reading the help docs. Any help would be appreciated.

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 30, 2017 6:47 pm

stainy wrote:
Fri Aug 25, 2017 12:23 pm
Hi Bill..

Thanks for the great piece of software. I hadn`t use mine since last year, but my little boy wanted to catch which cat was getting into his underwear drawer. So I set it up and caught her :)

But I had a lot of motion detected videos that had no motion in them. I`m using the original pinoir cam with infra red lamps.
Looking at the live feed it`s picking up lots of noise. I`m guessing the noise gets so bad in the night that it kicks off motion detection. How can I lessen that? I had a look at some settings but couldn`t work out which would help me.
thanks

Darren
There's a light level where noise gets bad and maybe it can be worse with IR and pinoir, I haven't tried anything like that.
Look in the log and see if the initial detects (lines that start with "first detect") for the ones you don't want are burst or
direction. If burst it's just a lot of noise and the only thing you can do is set under Preset->Settings the burst count and
frames higher.. If the detects are direction, then there's the Vector Magnitude and Limit to play with, but also, turn on
the showing of Preset and Vectors and watch where the noise is. Sometimes there can be certain objects (straight
vertical lines at wall corners is one) where the noise is higher than elsewhere. Then maybe you can adjust the motion
regions to exclude problem areas.

Setting a single motion region that centers on the drawer will probably help also.

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 30, 2017 7:03 pm

dmurphydrtc wrote:
Wed Aug 30, 2017 8:14 am
Hi all,

I would like to include the following information in the header of the still/video "sydney at 18:00: 14 C, fair, 5.7 mps wind from S" prepended with the date. eg 30/08/2017, sydney at 18:00: 14 C, fair, 5.7 mps wind from S. I am using this script "finger o:[email protected]" to get this data "sydney at 18:00: 14 C, fair, 5.7 mps wind from S". My capabilities when it comes to bash are limited but I can't figure out how to modify the pikrellcam.conf or generate a shell script to do the above.

I thought there might be an option (annotate text file) with this but can't find anything even after reading the help docs. Any help would be appreciated.
That's a long line, and turns out I had a line length limit. So, first thing, do an upgrade. I've just put up a fix.

Then you need a script that sends your line to the FIFO.
For example, create ~/pikrellcam/scripts/weather (and make it executable) with contents:

Code: Select all

#!/bin/bash

STR=`finger o:[email protected]`
ID="weather"

echo "annotate_string append $ID $STR" > /home/pi/pikrellcam/www/FIFO
The ID is an identifier and is any string to distinguish from other annotations.
Run it periodically (minute, 5minute, 10minute, 15minute, 30minute, hour) with a command in at-commands.conf. Put in a line:

Code: Select all

daily 5minute "!$C/weather"
The '!' in front of the command prevents logging so you don't fill up your log file.

Or use 'prepend' in the annotate_string command.

dmurphydrtc
Posts: 28
Joined: Tue Jan 29, 2013 5:30 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 30, 2017 8:41 pm

Bill,

Thanks so much for your support and software. Brilliant.

billw
Posts: 389
Joined: Tue Sep 18, 2012 8:23 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Aug 30, 2017 10:18 pm

juan15pablo wrote:
Sat Aug 26, 2017 4:20 pm
Hi!
Sorry for re open the post.

I have an issue with the timelapse. When I try to make a long timelapse, the RPI crashes and I need to reboot it unplugging the power (loosing all the timelapse data).
It is a RPI 3, 1gb of ram, and a 2.5A power source.

Maybe the avconv saturate the RPI?
Any advice?
The timelapse data should still be in the timelapse dir unless the script completed and deleted the files on purpose.
But then I don't know why the Pi would crash. Is the timelapse dir on the SD card or a USB disk? Maybe you could spot
check as conversion is happening to see if you are running out of disk space. If the avconv program fails for some
reason it should not cause a Pi crash. Maybe you are running out of memory and the Pi is swapping. That makes it
look like a crash because all your apps will start freezing up for periods of time.

User avatar
Gavinmc42
Posts: 3150
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Sep 10, 2017 12:23 pm

Got latest Stretch Lite 2017-09-07 and did the normal pikrellcam install
cd /home/pi
git clone https://github.com/billw2/pikrellcam.git
cd pikrellcam
./install-pikrellcam.sh
Seems to be taking longer than normal and I noticed a lots of files being downloaded.
It eventually finished, I rebooted and it seems to work fine apart from thinking it is 3.0.2 version.
Upgrade button says it is 4.0.4 but it says 3.0.2 on the System drop down
uname -a reports 4.9.49

I intend to try to get it working on Zero's on a cluster hat, so USB OTG Ethernet mode.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

arnauld
Posts: 21
Joined: Wed Oct 14, 2015 2:12 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Sep 10, 2017 5:05 pm

Hello,

thank you for PiKrellCam, I use it to record the wildlife in my garden.
I have 2 questions :

-how to attach a usb key and have it recognised to store the videos and pictures?
-How to set the right time and date?

Thank you.

User avatar
Gavinmc42
Posts: 3150
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Sep 11, 2017 4:07 am

Seems to be taking longer than normal and I noticed a lots of files being downloaded.
Found this in the install script.
JESSIE=8.0
DEB_VERSION=`cat /etc/debian_version`
IS_WHEEZY=`echo "$DEB_VERSION < $JESSIE" | bc`
I guess this will need changing for Stretch?
Explains why a bunch of Jessie files were downloaded?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 3150
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Sep 16, 2017 6:29 am

Pikrellcam on Stretch Lite

Changing jessie to stretch seems to work, just don't do it for the nginx part of the install script.
Perhaps nginx is not stretch ready?

Will need to do more testing but it looks like it mostly works on the latest Stretch Lite.
Next to try it on a Zero W ;)
If that works solar powered Zero W cams?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Camera board”