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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 30, 2019 3:04 pm

jeff65 wrote:
Tue Apr 30, 2019 10:06 am
Thanks Bill,

I am able to successfully archive media files and also perform the above steps manually. But the media files are created with owner pi:pi and mode: 600. This remains the case with the archived media files, too. This means that the content of the media can't be displayed through the web interface.

So it looks like the media files are the issue and not the directories.

Still scratching my head!

Any further thoughts appreciated.

Cheers
Jeff
The original media files on the Pi (in ~/pikrellcam/media/videos) should have permissions:
~/pikrellcam/media and ~/pikrellcam/media/videos directories:

Code: Select all

    drwxrwxr-x 9 pi www-data
and the mp4 video files:

Code: Select all

    -rw-r--r-- 1 pi pi
On the NFS the parent directories should have the same directory permissions.
Then when videos are archived the archive script just moves the videos into the NFS and the
permissions should remain the same after the move. The mp4 should be -rw-r--r-- 1 pi pi

So if you have a test file on the pi with similar -rw-r--r-- 1 pi pi permissions, can you command line move
it by hand into the NFS and keep those permissions? If so, then something is going wrong during
the archive script move and I could try adding something to try to make sure the permissions
end up right. Otherwise I think it must be something with the NFS export or fstab moujnt permissions
setup, but I'm not sure what could cause the permissions change on your videos to -rwx------ 1 pi pi

Edit: On the pi what do you get when you run getfacl on the mounted NFS? For example, I get:

Code: Select all

[email protected]: /mnt$ getfacl archive/media-archive/
# file: archive/media-archive/
# owner: pi
# group: pi
user::rwx
group::r-x
other::r-x
I was looking at
https://unix.stackexchange.com/question ... y-over-nfs

jeff65
Posts: 6
Joined: Fri Apr 19, 2019 5:57 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 30, 2019 9:16 pm

billw wrote:
Tue Apr 30, 2019 3:04 pm

The original media files on the Pi (in ~/pikrellcam/media/videos) should have permissions:
~/pikrellcam/media and ~/pikrellcam/media/videos directories:

Code: Select all

    drwxrwxr-x 9 pi www-data
and the mp4 video files:

Code: Select all

    -rw-r--r-- 1 pi pi
On the NFS the parent directories should have the same directory permissions.
Then when videos are archived the archive script just moves the videos into the NFS and the
permissions should remain the same after the move. The mp4 should be -rw-r--r-- 1 pi pi

So if you have a test file on the pi with similar -rw-r--r-- 1 pi pi permissions, can you command line move
it by hand into the NFS and keep those permissions? If so, then something is going wrong during
the archive script move and I could try adding something to try to make sure the permissions
end up right. Otherwise I think it must be something with the NFS export or fstab moujnt permissions
setup, but I'm not sure what could cause the permissions change on your videos to -rwx------ 1 pi pi

Edit: On the pi what do you get when you run getfacl on the mounted NFS? For example, I get:

Code: Select all

[email protected]: /mnt$ getfacl archive/media-archive/
# file: archive/media-archive/
# owner: pi
# group: pi
user::rwx
group::r-x
other::r-x
I was looking at
https://unix.stackexchange.com/question ... y-over-nfs
The getfacl output for directories are as you show for both the mounted share and all subfolders created by pikrellcam.

There is no issue with archiving. The media file mode is not changed during the archive process.

The issue is with the media files as they are originally created which is: -rwx------ 1 pi pi
As you say the files need to be -rw-r--r-- 1 pi pi

Is the media file mode set explicitly by pikrellcam after creation? Or does it rely on creation defaults which should be controlled by pi user's umask setting?

The server is NAS storage that uses ZFS, so I am not specifying /etc/exports directly. The export settings are specified through zfs set sharenfs options.

I suspect you are right about it being an issue with the export or mount options. I'll continue to look around.

Would you say pikrellcam relies on a certain version of NFS or ACL support?

I can always switch the share to SMB, but this seems like it should be a simple issue to solve.

Thanks
Jeff

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 30, 2019 10:23 pm

jeff65 wrote:
Tue Apr 30, 2019 9:16 pm
...
The issue is with the media files as they are originally created which is: -rwx------ 1 pi pi
As you say the files need to be -rw-r--r-- 1 pi pi

Is the media file mode set explicitly by pikrellcam after creation? Or does it rely on creation defaults which should be controlled by pi user's umask setting?

The server is NAS storage that uses ZFS, so I am not specifying /etc/exports directly. The export settings are specified through zfs set sharenfs options.

I suspect you are right about it being an issue with the export or mount options. I'll continue to look around.

Would you say pikrellcam relies on a certain version of NFS or ACL support?

I can always switch the share to SMB, but this seems like it should be a simple issue to solve.

Thanks
Jeff
If the original files are -rwx------ 1 pi pi then that is likely the problem. Pikrellcam just does an fopen(mediafile, "w") to
create the videos and the permissions should be governed by umask. Pikrellcam does not try to set modes after
the fopen(). It should be the same as if you just created a simple file with cat > filename or touch filename. So if you
do a touch tmpfile in a media directory, what permissions do you get on tmpfile?

jeff65
Posts: 6
Joined: Fri Apr 19, 2019 5:57 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed May 01, 2019 10:28 am

billw wrote:
Tue Apr 30, 2019 10:23 pm
If the original files are -rwx------ 1 pi pi then that is likely the problem. Pikrellcam just does an fopen(mediafile, "w") to
create the videos and the permissions should be governed by umask. Pikrellcam does not try to set modes after
the fopen(). It should be the same as if you just created a simple file with cat > filename or touch filename. So if you
do a touch tmpfile in a media directory, what permissions do you get on tmpfile?
Resolved!

On the server side I inadvertently had a "non-trivial acl" set on the shared parent directory to inherit permissions of directories and files. This acl was inherited by all of the media folders when pikrellcam created them. But the inherited acl was specified only for the owner, not the group. The umask value is ignored in this circumstance so that the inheritance rules of the acl are followed.

I removed the non-trivial acl from all of the media folders and the shared parent directory since inheritance is not required. The media files are created with the expected mode of 644 now.

Thanks for the assistance. Sorry to have you looking into an issue specific to my environment. At least I was able to learn a little about how pikrellcam works and also about ZFS non-trivial ACLs!

Cheers
Jeff

kajan001
Posts: 16
Joined: Wed Feb 13, 2019 7:15 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat May 18, 2019 1:01 pm

Hi Bill,

Thanks for a great program.

However, I am still having problems with the Pi0w freezing regularly.
Having ruled out Power and Sd-card problems I have now arrived at the wifi connection. Why it seems that on one router the setup works for weeks and with another router it crashes within anything from a few minutes to days.

Do you know it there is anything in pikrelcam that may cause a crash if the wifi drops? Or with the nginx server? Does you program need Internet connection to work?

If I can rule out something within pikrellcam I can start looking at other parts of the OS that may be the cause.

Thanks.

User avatar
lpsw
Posts: 149
Joined: Thu Jun 25, 2015 4:45 pm
Location: USA

Re: PiKrellCam: motion vector detect + OSD web interface

Sat May 18, 2019 5:38 pm

Kajan001,
Is it a relatively new Pi?
I have 6 Pi0Ws streaming from Pikrellcam. The last (newest) one I added started freezing after 1-2 hours. The rest run rock solid 24x7. I stumbled on this thread:
viewtopic.php?f=43&t=230771
And now the new Pi is streaming fine.
To summarize, I added

Code: Select all

over_voltage=8
to config.txt. This effectively raises the core voltage to 1.4V.
May be worth a try.

Update: My previously problematic pi0 has now been running non-stop (and streaming) for over 3 weeks.
Last edited by lpsw on Sat Jun 08, 2019 2:02 pm, edited 1 time in total.
Self-education is, I firmly believe, the only kind of education there is - Isaac Asimov

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun May 19, 2019 12:29 am

Kajan001,
Pikrellcam interfaces with the camera and file system and runs regardless of
wifi or any internet connection. nginx should not care either.

The issues I have had were fixed by replacing the SD card or wifi adapter and
I otherwise typically get hundreds of days of uptime before I reboot (but I
have not used a Pi0w).

So in addition to the over_voltage advice from lpsw, look more at that wifi
connection. Check if there is a wifi signal strength difference and try switching
out wifi adapters. I have had setups where wifi would drop and I fixed this
by changing adapters or repositioning or using a better antenna for better
signal strength. And I had just one setup where wifi would drop and then soon
afterwards the system would crash. Again I replaced the wifi adapter and have
had no problems since.

kajan001
Posts: 16
Joined: Wed Feb 13, 2019 7:15 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun May 19, 2019 12:18 pm

Thanks for the quick reply Billw!

Then I will explore the wifi issue and post the results if I find something useful.

Cheers!

Nestboxtech
Posts: 69
Joined: Fri Apr 11, 2014 9:45 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Tue May 28, 2019 8:20 am

underwhelmd wrote:
Tue Mar 07, 2017 5:44 am
Nestboxtech wrote: The next logical iteration would be to include the video feeds for several PikrellCams into one webpage...

Yup, I'm using a custom version of that code here. It's a good place to start.

Image
Just wondering if anyone can give examples to display multiple pikrellcams on one screen?
The link to the one above is no longer active

Thanks, Chris
http://nestboxtech.blogspot.co.uk/

Nestboxtech
Posts: 69
Joined: Fri Apr 11, 2014 9:45 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Tue May 28, 2019 8:51 am

billw wrote:
Sun May 19, 2019 12:29 am
Kajan001,
Pikrellcam interfaces with the camera and file system and runs regardless of
wifi or any internet connection. nginx should not care either.

The issues I have had were fixed by replacing the SD card or wifi adapter and
I otherwise typically get hundreds of days of uptime before I reboot (but I
have not used a Pi0w).

So in addition to the over_voltage advice from lpsw, look more at that wifi
connection. Check if there is a wifi signal strength difference and try switching
out wifi adapters. I have had setups where wifi would drop and I fixed this
by changing adapters or repositioning or using a better antenna for better
signal strength. And I had just one setup where wifi would drop and then soon
afterwards the system would crash. Again I replaced the wifi adapter and have
had no problems since.
I second the comment about flaky SD cards. I had one running pikrellcam on a Zero W up a tree about 20m from the wifi access point. Connection speed was v slow and unreliable. Replacing the SD card fixed it, and it's my first 'go-to' troubleshooting point for mine (most use zero w) since the all use the same 12-5v transformer so its not a power issue. I've never had an SD card simply die, I think its more that they wear out after a while.
http://nestboxtech.blogspot.co.uk/

Nestboxtech
Posts: 69
Joined: Fri Apr 11, 2014 9:45 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Tue May 28, 2019 8:58 am

billw wrote:
Sat Feb 02, 2019 8:57 pm
Nestboxtech wrote:
Sat Feb 02, 2019 8:13 am
thanks Bill, I'll have alook at example-motion-events.
re your suggestion about capturing output if run from a terminal, pikrellcam is set to run at boot, headless (up a tree). is it possible to capture this output to pipe it to some other process? would I have to start it differently?

re the videos, would it be possible to add some sort of switch to bypass the video generation? one thing I wold like to do is have motion running all the time, but only generate videos during the day, the easiest way (for me!) woul be to have a FIFO command the enabled/disabled the camera while will having motion running all the time to generate an equivalent to the output from motion_stats. that way I could still capture videos during the day (low activity and more interesting when it happens) versus all night (sleeping bird = less interesting & full SD card.

Thanks very much, Chris
If you can ssh into your headless pi, just quit pikrellcam from the web page, then start it by running "pikrellcam" in the ssh terminal.
Otherwise you would need to modify the example-motion-events script to write to a file.

There is a lot of interaction with various parts of the program when motion starts a video, so I don't think I want to overload that with
a mode where videos are suppressed. But there could be a separate and independent interface for writing motion events to a fifo.
Motion videos functions would remain unchanged and if you don't want videos, just turn them off/on at say sunset and sunrise
with an at-commands.conf "@motion_enable off" or "@motion_enable on"

Then separately I can add a fifo interface for reading motion events that works independently of motion enabled and this could also be
controlled with at-commands.conf commands. A python script would read from a motion events fifo for as long as it wants and
get all motion events. The script would not be started as an on_motion_begin command but would be started externally by hand
or by at-commands.conf or even cron. This would give pikrellcam the option of being a motion detect front end for some other
app that wants to do something besides generate videos - which is what you want.

Offhand, I would say it would write the events in the same format as is written to the /var/run/motion-events
file except it would be a continuous stream of events for as along as the interface is on and would not have begin/end states
associated with videos. Your python app would read the stream for as long as it wants - probably there should be a way to tell
your app to terminate so it could be set up to run only at night via an at-commands.conf command.

So I'll look into this. I think it would be nice to have the option for pikrellcam to be a general purpose motion detect front end.
Hi Bill, were you able to make any progress with this?
Thanks, Chris
http://nestboxtech.blogspot.co.uk/

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue May 28, 2019 8:18 pm

Nestboxtech wrote:
Tue May 28, 2019 8:58 am
billw wrote:
Sat Feb 02, 2019 8:57 pm
There is a lot of interaction with various parts of the program when motion starts a video, so I don't think I want to overload that with
a mode where videos are suppressed. But there could be a separate and independent interface for writing motion events to a fifo.
Motion videos functions would remain unchanged and if you don't want videos, just turn them off/on at say sunset and sunrise
with an at-commands.conf "@motion_enable off" or "@motion_enable on"

Then separately I can add a fifo interface for reading motion events that works independently of motion enabled and this could also be
controlled with at-commands.conf commands. A python script would read from a motion events fifo for as long as it wants and
get all motion events. The script would not be started as an on_motion_begin command but would be started externally by hand
or by at-commands.conf or even cron. This would give pikrellcam the option of being a motion detect front end for some other
app that wants to do something besides generate videos - which is what you want.

Offhand, I would say it would write the events in the same format as is written to the /var/run/motion-events
file except it would be a continuous stream of events for as along as the interface is on and would not have begin/end states
associated with videos. Your python app would read the stream for as long as it wants - probably there should be a way to tell
your app to terminate so it could be set up to run only at night via an at-commands.conf command.

So I'll look into this. I think it would be nice to have the option for pikrellcam to be a general purpose motion detect front end.
Hi Bill, were you able to make any progress with this?
Thanks, Chris
Oh, this is a bit embarrassing, but I have implemented that but have apparently not uploaded the upgrade for it yet. Looks like
I got sidetracked adding something else that I have let drag out. Anyway, I'll try to get things cleaned up and get an upgrade
uploaded within a couple of days.

Just to preview so you'll know what to expect, it is a FIFO (~/www/motion_detects_FIFO) which you will be able to read
anytime independent of motion enabled state. There will be an example scripts-dist/example-motion-detects-fifo to get you
started.

So, sorry about that, and thanks for giving me a nudge on it because before checking I really was thinking I had already
uploaded the feature.

Bill

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu May 30, 2019 7:49 pm

Nestboxtech wrote:
Tue May 28, 2019 8:58 am
Hi Bill, were you able to make any progress with this?
Thanks, Chris
There's an upgrade ready. An external app can now read the motion_detects_FIFO to get all motion detects independent of
video recordings. See the help page and scripts-dist/example-motion-detects-fifo.

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jun 03, 2019 8:26 am

That is great. If I understand it correctly one can use PiKrellCam to tell that a motion occurred and trigger a still picture without triggering video. This was a feature that was requested a while ago.

Did I get this right? And is there a wiki or something else where we can put some more information on the web? I find the current description (sorry if my bad english does not hit the right ton) rather terse. I have difficulties, for example, establishing the solution I described here.
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

tropho
Posts: 55
Joined: Mon Feb 26, 2018 11:36 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Jun 04, 2019 12:13 am

billw, thank you so much for PiKrellCam! I have built multiple cameras, 3D printed custom-designed cases and have them mounted both outside and inside my home. It's absolutely amazing and every second you have spent (and hopefully will spend!) on this project has benefited many people.

Do you or anyone else know of a good solution we could use to produce audio output, to enable the viewer to speak to the person on the other side of the camera? PiKrellCam already does everything that Ring/Nest/etc. does for video and audio input, but lacks audio output capability. It would be great if this feature could be added but I know it would likely not be a trivial effort to get working. Is there a solution we could use in the meantime for audio output, sort of walkie-talkie style? Only output is required since the microphone is already in use by PiKrellCam, and would not be available to whatever program would request it. I have no idea how a user would activate the audio send, perhaps an API or something similar, via a website or mobile app. If the backend support is in place I'm sure some clever PiKrellCam user would be happy to code a frontend app for audio. Heck, just having a button on the current website would be awesome!

Keep up the amazing work and if you have a Patreon or other donation site I would gladly contribute to the future of this project.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Jun 04, 2019 6:37 pm

andies wrote:
Mon Jun 03, 2019 8:26 am
That is great. If I understand it correctly one can use PiKrellCam to tell that a motion occurred and trigger a still picture without triggering video. This was a feature that was requested a while ago.

Did I get this right? And is there a wiki or something else where we can put some more information on the web? I find the current description (sorry if my bad english does not hit the right ton) rather terse. I have difficulties, for example, establishing the solution I described here.
That is the idea, for a user to do something specialized with motion detection. However, in the case of taking stills, I have started
adding the feature for stills to be taken instead of videos.

I haven't done anything about starting a wiki since I have tried to cover most things on the help page. If somebody sees a need for more
than that, then they could start a wiki if they want.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Jun 04, 2019 7:14 pm

tropho wrote:
Tue Jun 04, 2019 12:13 am
billw, thank you so much for PiKrellCam! I have built multiple cameras, 3D printed custom-designed cases and have them mounted both outside and inside my home. It's absolutely amazing and every second you have spent (and hopefully will spend!) on this project has benefited many people.

Do you or anyone else know of a good solution we could use to produce audio output, to enable the viewer to speak to the person on the other side of the camera? PiKrellCam already does everything that Ring/Nest/etc. does for video and audio input, but lacks audio output capability. It would be great if this feature could be added but I know it would likely not be a trivial effort to get working. Is there a solution we could use in the meantime for audio output, sort of walkie-talkie style? Only output is required since the microphone is already in use by PiKrellCam, and would not be available to whatever program would request it. I have no idea how a user would activate the audio send, perhaps an API or something similar, via a website or mobile app. If the backend support is in place I'm sure some clever PiKrellCam user would be happy to code a frontend app for audio. Heck, just having a button on the current website would be awesome!

Keep up the amazing work and if you have a Patreon or other donation site I would gladly contribute to the future of this project.
Pi cases are a great use for 3D printers, and I'm glad I've been able to help keep your printer busy!

Audio to PiKrellCam is interesting and would take implementing a VOIP interface. On the server side I could see building audio
receiving into Pikrellcam with moderate effort but as you say the issue would be a client side VOIP audio sending app. The client
PiKrellCam interface is browser based and javascript doesn't provide for launching client programs so I don't see how an audio sending
app could be managed with browser buttons. And to come up with something that works from other than Linux (Android, iPhone,
Windows, etc) makes it a bigger project. But it would be nice and is something to think about.

I don't have a way to take donations, but thanks much for the thought.

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Jun 04, 2019 7:30 pm

billw wrote:
Tue Jun 04, 2019 6:37 pm
However, in the case of taking stills, I have started
adding the feature for stills to be taken instead of videos.
Is there a documentation for this feature?
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Jun 04, 2019 8:49 pm

andies wrote:
Tue Jun 04, 2019 7:30 pm
billw wrote:
Tue Jun 04, 2019 6:37 pm
However, in the case of taking stills, I have started
adding the feature for stills to be taken instead of videos.
Is there a documentation for this feature?
Sorry, not yet. It's a work in progress.

andies
Posts: 141
Joined: Mon Nov 11, 2013 8:12 pm
Location: Berlin

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jun 05, 2019 5:47 am

billw wrote:
Tue Jun 04, 2019 6:37 pm
I haven't done anything about starting a wiki since I have tried to cover most things on the help page. If somebody sees a need for more
than that, then they could start a wiki if they want.
I just did that and I used the github account (they have a template for a wiki). I simply copied and pasted text from the initial help page to have at least something to start with. It would be great if those who think they can contribute start adding their comments to the wiki.
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

Nestboxtech
Posts: 69
Joined: Fri Apr 11, 2014 9:45 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jun 05, 2019 10:51 pm

billw wrote:
Tue May 28, 2019 8:18 pm
Nestboxtech wrote:
Tue May 28, 2019 8:58 am
billw wrote:
Sat Feb 02, 2019 8:57 pm
There is a lot of interaction with various parts of the program when motion starts a video, so I don't think I want to overload that with
a mode where videos are suppressed. But there could be a separate and independent interface for writing motion events to a fifo.
Motion videos functions would remain unchanged and if you don't want videos, just turn them off/on at say sunset and sunrise
with an at-commands.conf "@motion_enable off" or "@motion_enable on"

Then separately I can add a fifo interface for reading motion events that works independently of motion enabled and this could also be
controlled with at-commands.conf commands. A python script would read from a motion events fifo for as long as it wants and
get all motion events. The script would not be started as an on_motion_begin command but would be started externally by hand
or by at-commands.conf or even cron. This would give pikrellcam the option of being a motion detect front end for some other
app that wants to do something besides generate videos - which is what you want.

Offhand, I would say it would write the events in the same format as is written to the /var/run/motion-events
file except it would be a continuous stream of events for as along as the interface is on and would not have begin/end states
associated with videos. Your python app would read the stream for as long as it wants - probably there should be a way to tell
your app to terminate so it could be set up to run only at night via an at-commands.conf command.

So I'll look into this. I think it would be nice to have the option for pikrellcam to be a general purpose motion detect front end.
Hi Bill, were you able to make any progress with this?
Thanks, Chris
Oh, this is a bit embarrassing, but I have implemented that but have apparently not uploaded the upgrade for it yet. Looks like
I got sidetracked adding something else that I have let drag out. Anyway, I'll try to get things cleaned up and get an upgrade
uploaded within a couple of days.

Just to preview so you'll know what to expect, it is a FIFO (~/www/motion_detects_FIFO) which you will be able to read
anytime independent of motion enabled state. There will be an example scripts-dist/example-motion-detects-fifo to get you
started.

So, sorry about that, and thanks for giving me a nudge on it because before checking I really was thinking I had already
uploaded the feature.

Bill
I'm only too grateful that you've looked at it. Just so I understand, if I send an @motion_enable off it can still trigger some event/script when motion is detected?
Just so you can see your work in action, this happened today:
https://twitter.com/NestboxTech/status/ ... 7234974720
Many thanks, Chris
http://nestboxtech.blogspot.co.uk/

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jun 06, 2019 2:55 pm

Nestboxtech wrote:
Wed Jun 05, 2019 10:51 pm
I'm only too grateful that you've looked at it. Just so I understand, if I send an @motion_enable off it can still trigger some event/script when motion is detected?
Just so you can see your work in action, this happened today:
https://twitter.com/NestboxTech/status/ ... 7234974720
Many thanks, Chris
Nice to see your video, thanks!

No, this interface does not trigger a script. You run your script by at command, cron, or by hand and it then reads all motion events for as long as it runs. So when you turn motion_enable off it's up to you to run your script for the times you want to get motion detects. It runs continuously during that time. Look at the example-motion-detects-fifo script for ways it can be terminated.

This interface is independent of motion videos enabled and so has no knowledge of the configured video times confirm_gap, event_gap, etc. It just reads all motion detects and you do with that what you want.

nintwala
Posts: 2
Joined: Thu Jun 13, 2019 4:17 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jun 13, 2019 4:22 am

Hi,

First of all, thank you for this awesome software. I want to set it up to capture photos for my son when there is a bird in our backyard.

I have tried to follow your instructions on taking still images when a motion is detected. But I am so lost... :(

What exactly do I need to do in order to take a still image when a motion is detected? Right now, I am only able to configure it to take videos. I looked in the OSD but there is no option to enable still image on motion capture. Please help...

Thank you...

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jun 13, 2019 7:59 pm

nintwala wrote:
Thu Jun 13, 2019 4:22 am
Hi,

First of all, thank you for this awesome software. I want to set it up to capture photos for my son when there is a bird in our backyard.

I have tried to follow your instructions on taking still images when a motion is detected. But I am so lost... :(

What exactly do I need to do in order to take a still image when a motion is detected? Right now, I am only able to configure it to take videos. I looked in the OSD but there is no option to enable still image on motion capture. Please help...

Thank you...
I am currently working on adding an option to the OSD so that motion stills can be taken instead of motion videos.

But if you want to have a still image and have a motion video at the same time, you will have to set this up yourself by having
an on_motion_begin script that sends a still command to the command FIFO.

But note that the camera has to change modes to take a still so the video can have a glitch.

To do this put a script, say motion-still in ~/pikrellcam/scripts (and make it executable):

Code: Select all

#!/bin/bash

echo still > ~/pikrellcam/www/FIFO
And edit ~/.pikrellcam/pikrellcam.conf to have an on_motion_begin line like:

Code: Select all

on_motion_begin $C/motion-still

nintwala
Posts: 2
Joined: Thu Jun 13, 2019 4:17 am

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 14, 2019 2:46 am

Hi,

thank you for the quick reply. I think I made some progress. But not sure where it is storing the stills. I see the message "image_2019-06-13_21.38.05_8.jpg" show up on the OSD, but I dont see the images in the Stills section or in the "~/pikrellcam/media/stills/" folder. Where is it storing the jpg file?

Just like you suggested, I created a script called "motion-still" under ~/pikrellcam/scripts/ with the following

Code: Select all

#!/bin/bash

echo still > ~/pikrellcam/www/FIFO
And under ~/.pikrellcam/ I edited the pikrellcam.conf and un-commented the section on_motion_begin to make it

Code: Select all

on_motion_begin $C/motion-still
Do I need to do something else?

Thank you and sorry... I feel like I am missing something obvious....


EDIT: I fixed my own issue. I must have changed something while I was tinkering with the scripts from because which caused the stills not saving to the folder. I deleted both ~/.pikrellcam and ~/pikrellcam folder and started from scratch. It seems to work now. Thank you!!!!

Return to “Camera board”