Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 14, 2016 1:45 am

jbeale wrote:My strategy is to put in a 32 GB USB memory stick ( mounted as /dev/sda1 ) and save the stills and video there, and use the archiving script which runs just after midnight each day so only one day of events is visible on the "thumbs" page: viewtopic.php?t=115583&p=907956#p905001

You can also use a "motion-end" script to, for example transfer a still image and/or video to a remote site.
understand, although not my preferred option as I occasionally want to gain access to the files from outside the local network through my main server. Each of the individual Pis are connected to the internal network and firewalled from external access. The server is available through a 'secure' ssh port (not the standard) so I can scp and ssh into/out of the server. Running a script every 24hours to copy(move?) local files to the server would solve the issue but then which do I use scp or rsync?

Given the server has its ssh ports changed do I need to copy this setting across the network or can I use the standard port 22 on an internal machine to connect with the port <x> on the server? Good job I have a few largish usb sticks hanging around.

By the way with motion going I'm just getting a, very good quality, video saved to the disc. Is there any way to get stills (at higher quality?) also saved for the period of the motion? Timelapse does work but then I get too many, or is that the way to do it? ie have a script that starts timelapse at 1 sec intervals on motion start then stop it on motion ceased. Definitely need to understand the commands and scripting of more.

Oh, I am having issues with 'mounting' a server drive using samba on the networked machines - but then I had the same problem a year ago and solved it then (but have now forgotten!), maybe the latter will help this.

User avatar
jbeale
Posts: 3517
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 14, 2016 3:16 pm

PKCam allows a script to issue a command to the RPi camera to take a full-res 5Mpixel still image when motion is detected. The problem with this is the camera device has to change modes to take the still, which interrupts the video for something like 1 second. If you require continuous video, then as an alternative approach, you can run a post-process job to extract any number of still images from the video after it has been recorded. In that case stills are the same resolution as the video, for example 1920x1080 if you use that mode.

You can extract a still frame from a video at time_offset seconds from the start, with

Code: Select all

avconv -ss time_offset -i input_file.mp4 -frames:v 1 -q:v 2 output_still.jpg
Please note, unless this has changed in the last year or so, you must compile avconv yourself to get any better accuracy than 1 second on still extraction, because the Raspbian apt-get install avconv delivers an old and more limited version. See also: https://libav.org/avconv.html

Note that PKCam can optionally record a .csv file alongside the .mp4 video for each event with (x,y) position and (dx,dy) speed of detected events as a function of time, you just put motion_stats on in /home/pi/.pikrellcam/pikrellcam.conf

This data gives you a clue of which frames might be most interesting to extract as a still. See also:
viewtopic.php?f=43&t=115583&start=375#p848425

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 14, 2016 8:55 pm

I'm using an android app called "IP Cam Viewer" by Robert Chou to view my various ip cameras on an ad hoc on demand basis. Eg if I hear something I fire up the app on my phone and view the various cameras to see if I need to take any action.

I have 2 raspberry pi's running the excellent Pikrellcam and have configured the app to show their output too if I wish.

Now something odd seems to happen when I do view the PiKrellCam outputs via the app. The log files of both the Pikrellcams fill up with this sort of thing:-

' 21:29:43 : new connection from host '127.0.0.1' on port '35634' 21:29:43 : new connection from host '127.0.0.1' on port '35635' 21:29:43 : new connection from host '127.0.0.1' on port '35636' 21:29:43 : closing connection from host '127.0.0.1' on port '35634' 21:29:43 : new connection from host '127.0.0.1' on port '35637' 21:29:43 : closing connection from host '127.0.0.1' on port '35635' 21:29:44 : closing connection from host '127.0.0.1' on port '35636' 21:29:44 : new connection from host '127.0.0.1' on port '35638' 21:29:44 : closing connection from host '127.0.0.1' on port '35637' 21:29:44 : new connection from host '127.0.0.1' on port '35639'

Etc etc etc

Note the ever increasing port number.

This seems to happen while I'm actually viewing the PiKrellCams via the app, and stops when I switch to other cameras or switch away from the app on my phone.

Next time I view them though it happens again, with the next port number up, and continues the same until I stop.

After a while the Pikrellcams lock up and I end up ssh-ing and rebooting (both are headless).

I suspect that the two things are connected?

Can anyone please comment /analyse what's happening and what to try to address?

Thanks in advance
Tashman

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 17, 2016 5:33 am

jbeale wrote:PKCam allows a script to issue a command to the RPi camera to take a full-res 5Mpixel still image when motion is detected. The problem with this is the camera device has to change modes to take the still, which interrupts the video for something like 1 second. If you require continuous video, then as an alternative approach, you can run a post-process job to extract any number of still images from the video after it has been recorded. In that case stills are the same resolution as the video, for example 1920x1080 if you use that mode.

You can extract a still frame from a video at time_offset seconds from the start, with

Code: Select all

avconv -ss time_offset -i input_file.mp4 -frames:v 1 -q:v 2 output_still.jpg
Please note, unless this has changed in the last year or so, you must compile avconv yourself to get any better accuracy than 1 second on still extraction, because the Raspbian apt-get install avconv delivers an old and more limited version. See also: https://libav.org/avconv.html

Note that PKCam can optionally record a .csv file alongside the .mp4 video for each event with (x,y) position and (dx,dy) speed of detected events as a function of time, you just put motion_stats on in /home/pi/.pikrellcam/pikrellcam.conf

This data gives you a clue of which frames might be most interesting to extract as a still. See also:
viewtopic.php?f=43&t=115583&start=375#p848425
thanks, I've ended up doing it slightly differently although I am sure there is a way of doing it entirely within pikrellcam. Firstly the topology of the network, relatively simple.

A modem <-> A Server (PiG) |<-> Camera G attached to PiA
|<-> Camera 1 attached to PiC

PiG is as secure as I have been able to make it with ssh on a port other than 22. Samba is up and running on all three but for some reason I cannot mount a samba directory on the external USB drive on either of PiA or PiC. I know I should be able to but don't have the time to be able to get it to work properly (at the moment). Yes, I did check the firewall was open for all of the ports samba uses although the modems firewall isn't.

As a workaround I have ssh key-pairs between the 3 machines (PiA to PiG and PiC to PiG). Then, using a shell script run just after midnight, I use scp to copy the pikrellcam www/camera directory structure to the USB drive on PiG into a new directory structure for each camera. After copying the files I use rm to delete all the files in each of the pikrellcam www/camera directories then reboot the machine. This should then give me a clean base to start the next 24 hours (less the reboot time). Note that I crontab the shell scripts to run one after the other so the network doesn't overload whilst transferring the files.

The next 48 hours will show whether this is working the way I want it to. Why do I reboot? Well for some reason one of the cameras (running on a RPi-B machine seems to lock up every so often. I suspect it is due to me running the video in a FireFox window all of the time for both machines and swapping backwards and forwards between them (and the video directories). I've also noticed that on this machine the USB drive seems to disconnects for some reason then reconnect on a different I/f (/dev/sdb rather than /dev/sda) which might be throwing pikrellcam into hysterics. Again not sure why but I thought I would try rebooting every 24 hours first.

Tashman
Maybe the above is a similar problem to the one you are having but I can sort of see that if pikrellcam is opening a port each time you open a connection for a video then it could easily increment to a point where it runs out of ports (especially if a certain number of ports is hard-wired into the programme - billw?).

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 17, 2016 3:55 pm

Tashman wrote:I'm using an android app called "IP Cam Viewer" by Robert Chou to view my various ip cameras on an ad hoc on demand basis. Eg if I hear something I fire up the app on my phone and view the various cameras to see if I need to take any action.

I have 2 raspberry pi's running the excellent Pikrellcam and have configured the app to show their output too if I wish.

Now something odd seems to happen when I do view the PiKrellCam outputs via the app. The log files of both the Pikrellcams fill up with this sort of thing:-

' 21:29:43 : new connection from host '127.0.0.1' on port '35634' 21:29:43 : new connection from host '127.0.0.1' on port '35635' 21:29:43 : new connection from host '127.0.0.1' on port '35636' 21:29:43 : closing connection from host '127.0.0.1' on port '35634' 21:29:43 : new connection from host '127.0.0.1' on port '35637' 21:29:43 : closing connection from host '127.0.0.1' on port '35635' 21:29:44 : closing connection from host '127.0.0.1' on port '35636' 21:29:44 : new connection from host '127.0.0.1' on port '35638' 21:29:44 : closing connection from host '127.0.0.1' on port '35637' 21:29:44 : new connection from host '127.0.0.1' on port '35639'

Etc etc etc

Note the ever increasing port number.

This seems to happen while I'm actually viewing the PiKrellCams via the app, and stops when I switch to other cameras or switch away from the app on my phone.

Next time I view them though it happens again, with the next port number up, and continues the same until I stop.

After a while the Pikrellcams lock up and I end up ssh-ing and rebooting (both are headless).

I suspect that the two things are connected?

Can anyone please comment /analyse what's happening and what to try to address?

Thanks in advance
Tashman
It seems the app closes and reopens the stream continuously rather than just let
it stream - kind off defeats the purpose of a stream I think...
Anyway, that mjpeg stream code was contributed to pikrellcam so I'm not 100% sure of what is
going on, but I do notice that there is no close of the socket fd in the code. I'll add a close and
also block out the logging unless pikrellcam is running verbose because besides possibly running out
of file descriptors which could cause the lock up, you're likely getting a huge log file which could fill
up the file system.

I'll have those two changes in the next release and you'll have to test to see if that stops the lock ups.
In the meantime, can the app work by just connecting to live.php instead of mjpeg_stream.php?

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 17, 2016 4:07 pm

billw wrote: It seems the app closes and reopens the stream continuously rather than just let
it stream - kind off defeats the purpose of a stream I think...
Anyway, that mjpeg stream code was contributed to pikrellcam so I'm not 100% sure of what is
going on, but I do notice that there is no close of the socket fd in the code. I'll add a close and
also block out the logging unless pikrellcam is running verbose because besides possibly running out
of file descriptors which could cause the lock up, you're likely getting a huge log file which could fill
up the file system.

I'll have those two changes in the next release and you'll have to test to see if that stops the lock ups.
In the meantime, can the app work by just connecting to live.php instead of mjpeg_stream.php?
Thanks Billw.
Afraid it doesn't mean much to me as I'm not too technical, but I'll be pleased to see what happens with the changes - although if you stop it logging this I'll probably never spot it - until the Pikrellcams stop working....?

I tried the live.php but the app couldn't get an image.

Thanks

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 17, 2016 6:09 pm

Tashman wrote: Thanks Billw.
Afraid it doesn't mean much to me as I'm not too technical, but I'll be pleased to see what happens with the changes - although if you stop it logging this I'll probably never spot it - until the Pikrellcams stop working....?

I tried the live.php but the app couldn't get an image.

Thanks
Should only be a few more days before I get an upgrade out. I have too many changes to do that
before I check things out a bit longer.

There can be a Verbose_Logging setting you can toggle from the OSD. There's some other things
logged I could end up putting under this verbose check. Or maybe I'll leave logging as it is.
I'll think about it. It's just that if the problem is the socket close, that could get fixed and the next
problem would be the log file filling up the file system...

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 18, 2016 1:18 am

A quick question, the answer of which I couldn't find in the various help areas (or missed it).

I wish to use a specific motion region on startup. I've tried adding a command into at-commands.conf viz

start "@motion load_regions Level_1"

perhaps this is in the wrong file or something is wrong with the command?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 18, 2016 2:55 am

Tim Barker wrote:A quick question, the answer of which I couldn't find in the various help areas (or missed it).

I wish to use a specific motion region on startup. I've tried adding a command into at-commands.conf viz

start "@motion load_regions Level_1"

perhaps this is in the wrong file or something is wrong with the command?
At commands need to be: frequency time "command"
so you need a frequency which is day of week frequency so should be daily:

Code: Select all

daily start "@motion load_regions Level_1"
It might seem the "daily" should be understood for start times, but you might want to do
something different at start on different days of the week.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 18, 2016 5:17 am

Thanks, billw

Wasn't sure whether I needed to use daily or time as I was just after running the command after reboot, whenever this occurs. As it happens I'm rebooting daily just after midnight after copying files across to a server. I was worried that it would see the daily and not run it being well past midnight and also it doesn't really need to be reloaded daily, only once on starting.

Is this the file that the command should go in (at-commands.conf) or is there another more appropriate config file? Perhaps an 'on reboot' section of the main pikrellcam.conf file to set up all of the parameters on wants to use?

Tashman
Posts: 16
Joined: Tue Mar 08, 2016 11:23 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 18, 2016 6:55 am

Tim Barker wrote:Thanks, billw

Wasn't sure whether I needed to use daily or time as I was just after running the command after reboot, whenever this occurs. As it happens I'm rebooting daily just after midnight after copying files across to a server. I was worried that it would see the daily and not run it being well past midnight and also it doesn't really need to be reloaded daily, only once on starting.

Is this the file that the command should go in (at-commands.conf) or is there another more appropriate config file? Perhaps an 'on reboot' section of the main pikrellcam.conf file to set up all of the parameters on wants to use?
I save my regions and settings with the "default" name. These settings are then loaded on every restart of pikrellcam or reboot of the Pi.

User avatar
jbeale
Posts: 3517
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 18, 2016 3:49 pm

Tim Barker wrote: I've also noticed that on this machine the USB drive seems to disconnects for some reason then reconnect on a different I/f (/dev/sdb rather than /dev/sda) which might be throwing pikrellcam into hysterics.
Be careful about that. I had that happen on one system too with a 128 GB USB stick; apparent cause was a marginal power supply. During heavy I/O the current increased enough that there was a voltage dip, and subsequently the USB system ended up connecting sda1 as sdb1. My fix was to use a higher capacity power supply and better USB power cord. See also: viewtopic.php?t=115583&p=907956#p914438

I had gotten away with that supply using a 32 GB USB stick, but it seems the 128 GB stick draws more current.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 18, 2016 10:36 pm

jbeale wrote:
Tim Barker wrote: I've also noticed ...throwing pikrellcam into hysterics.
Be careful about that. I had that happen on one system too with a 128 GB USB stick; apparent cause was a marginal power supply. During heavy I/O the current increased enough that there was a voltage dip, and subsequently the USB system ended up connecting sda1 as sdb1. My fix was to use a higher capacity power supply and better USB power cord. See also: viewtopic.php?t=115583&p=907956#p914438

I had gotten away with that supply using a 32 GB USB stick, but it seems the 128 GB stick draws more current.
Supposed to be a 2A supply, I might swap a couple of the supplies over and see whether the problem goes with the supply. Have had the power supply problem before but it was a wifi stick and a 1A supply and it just kept rebooting forever. With this problem I'm going to have to bring it back in the house and plug into the tv to see what the hdmi output is showing me - I can't seem to log in via ssh and check so either it is continuously rebooting or locking up the processor in some way.

No change when swapping power supplies and they are both 2A with similar setups and one works fine, something else involved.

Have repositioned it and attached the hdmi lead to see the boot sequence. Obviously having problems with the file systems and entering a maintenance shell. messages are:-

[....] Checking file systems...fsck from util-linux 220.1
fsck.ext4: No such file or directry while trying to open /dev/sda1
Possible non-existant device?
fsck died with exit status 8
failed (code 8).
[FAIL] File system check failed. A log is being saved in /var/log/fsck/checkfs if that location is writable. Please repair the file system manually. ... failed!
sulogin: root account is locked , starting shell
[email protected]:~#

Clearly something either wrong with the USB stick (although I used a new one and reformatted to ext4 on another Pi) or it is being found too late in the boot sequence. Oh, worth saying that the fsck of the root file system went ok. Have to come back to this later as I have other things to do now.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 19, 2016 10:35 am

well it appears to be fixed now (at least for a time). The Pi was rebooting but getting caught on the fsck as either the USB stick was appearing as sdb or sdb1 and mount was looking for sda1. Probably made worse by asking mount to do a filesystem check when mounting (using a 2 as the last charater on the line in /etc/fstab). As a result it was starting a shell for manual repair and not getting to the point where sshd runs.

I reformatted the USB stick then remounted and relinked the drive to my 'camera' directory and it now seems to be back working. Again, only time will tell if that is all. Interestingly the stick is now sda not sda1, not sure why, I must have reformatted using a slightly different command.

User avatar
jbeale
Posts: 3517
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 19, 2016 2:01 pm

Tim Barker wrote:No change when swapping power supplies and they are both 2A with similar setups and one works fine, something else involved.
Just to confirm your point, my problem Pi had the sda -> sdb USB remount issue last night, despite the new 2A supply which had been for working some weeks. Had a bunch of file i/o errors shown in 'dmesg'. Fixed for now with a reboot. I have many RPi running PKCam and this is the only one that has ever had this problem. Now wondering if it's just that particular Sandisk 128GB USB stick that is the problem (all my others have 32G cards). Not sure but in my case, the problem may be triggered by viewing saved video while also recording a new event. This is a model 2 RPi.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 20, 2016 4:47 am

jbeale wrote:
Tim Barker wrote:No change when .... else involved.
Just to confirm your point, my problem Pi had the sda -> sdb USB remount issue last night, despite the new 2A supply which had been for working some weeks. Had a bunch of file i/o errors shown in 'dmesg'. Fixed for now with a reboot. I have many RPi running PKCam and this is the only one that has ever had this problem. Now wondering if it's just that particular Sandisk 128GB USB stick that is the problem (all my others have 32G cards). Not sure but in my case, the problem may be triggered by viewing saved video while also recording a new event. This is a model 2 RPi.
Possible cause here as well as the 'hanging' event has occurred around the time I have been viewing something - perhaps the Pi isn't up to it (does get hot!). I've also changed the USB stick although using somewhat smaller ones (4Gb) but then they are also a couple of years old and not the 'freshest'. The Pi is also running on an original 4Gb Raspberry SD card hence the need for more space. Need to get this sorted in the next week as it will be left alone for long periods after then.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 20, 2016 6:48 am

it's just happened again! First off I'll replace the 4Gb SD card with the software on it and forget using a USB drive... Fortunately I think I have a spare 16Gb Micro-SD somewhere.

A couple of days later... Replaced the 4Gb SD with a 16Gb micro-SD, copied a new base system onto the new mSD and reloaded pikrellcam et al. Changed the cron to copy files to the main server and adjusted the script to send log to a file if running as a cron job and to the screen if running from within a terminal. Seems to be working ok now and hasn't yet locked up. Sounds like it might have been the USB stick causing the issues. The other RPi has been adjusted to run the same way as this one and still seems to be working well even with a USB stick in place.

YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 23, 2016 7:05 am

@billw, i am interesting using servos for the picam module. Do you have some already and where did you buy it?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 23, 2016 1:35 pm

YvesG wrote:@billw, i am interesting using servos for the picam module. Do you have some already and where did you buy it?
I now have three pikrellcams with servos and soon will be moving all my installations to servos.
So far I've been using MG90D servos but I want to try the MG90S as they are cheaper. I like to go
with metal gear because the horns attach with machine screws. I'm in the US and ordered from
Circuit Specialist in Arizona:
https://www.circuitspecialists.com/mg90 ... servo.html
I don't know why their web page says 360 degree rotation because they are not. Max is about 180.
For some reason ebay is more expensive for MG90D which is why I want to try the MG90S.
Positioning with the servos seems to be accurate and repeatable.

Actually, I'm looking to get the pikrellcam with servo control upgrade out soon today and after that
I'll post some pics of how I mount the servos. I made a PCB layout with mounting pieces I cut out
and assemble into servo brackets. Then I mount the servo bracket assembly on another PCB that
attaches to the Pi 40 pin header. This PCB is pretty simple and mainly has a reserved area for
attaching the servo bracket assembly, a DC-DC down converter and 3 pin headers to break out the
Pi PWM GPIOs. I'm making my own servo brackets because I could not find one to buy that was
compact enough to fit into the outside enclosures I build.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 23, 2016 3:36 pm

I just put up the pikrellcam V3.0 upgrade that has presets and builtin servo control.

The new stuff is convered in the help page, but the main thing for everybody
(servos or not) is that motion detect settings (vector and burst counts/limits)
along with a set of motion regions are now grouped as settings presets.
This lets presets be configured for different weather or other conditions and
cycled through with single clicks.

Servos connected to the Pi hardware PWM GPIOs can be directly controlled with no
additional install. Or ServoBlaster with an install up to you is an option for servos
on other GPIOs. Servo positions can be saved as presets and each position preset can
have its own set of settings presets.

Servo configuration is done in pikrellcam.conf for servo GPIO numbers and then
using the OSD you set servo pan/tilt limits, set servo move speeds, edit
presets, etc. There's OSD drawn servo pan/tilt scales that show current servo
position and position presets.

The usage of motion regions save/load by name is a bit changed. See the help page.

tomtgrp, I did not change _timelapse_convert because I believe I have
fixed pikrellcam so there will no longer be any size 0 files in the sequence.
Let me know if you find otherwise.

Tashman, I could not decide on a good way to handle that verbose logging you got, so
I just block the logging after it has logged "too much". But I added the socket
close so let us see if that will fix your problem.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 23, 2016 10:46 pm

billw wrote: Actually, I'm looking to get the pikrellcam with servo control upgrade out soon today and after that
I'll post some pics of how I mount the servos. I made a PCB layout with mounting pieces I cut out
and assemble into servo brackets. Then I mount the servo bracket assembly on another PCB that
attaches to the Pi 40 pin header. This PCB is pretty simple and mainly has a reserved area for
attaching the servo bracket assembly, a DC-DC down converter and 3 pin headers to break out the
Pi PWM GPIOs. I'm making my own servo brackets because I could not find one to buy that was
compact enough to fit into the outside enclosures I build.
Here is my picam-mount PCB and how I cut it and assemble it. It's what I have working, but I've made
small revisions to it and am waiting to send it off to Itead until I see the rumored Pi camera V2. I want
to make sure of its dimensions.
picam0.jpg
picam0.jpg (17.14 KiB) Viewed 3685 times
Also a pic of close to the final assembly with the servos attached to my second PCB that plugs into
the Pi header.
picam2.jpg
picam2.jpg (35.41 KiB) Viewed 3685 times

rpiatf2f10
Posts: 27
Joined: Sat Apr 23, 2016 10:16 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 23, 2016 11:49 pm

HI Billw,

I have tried your software for a week and it works well off SD card. Now I tried extra functions and I have need some help. BTW, I just upgraded to v3.0 today.

cat ~/.pikrellcam/pikrellcam.conf
on_motion_preview_save $C/preview-save $F $m $P $G

cat ~/pikrellcam/scripts/preview-save

MY_EMAIL=[email protected]
mpack -s [email protected]$HOSTNAME $PREVIEW_JPEG $MY_EMAIL
echo "mpack -s [email protected]$HOSTNAME $PREVIEW_JPEG $MY_EMAIL" >> $LOG_FILE

I don't see any emails in inbox; though I do see attempts in /tmp/pikrellcam.log of sending email.

mpack -s [email protected] /run/pikrellcam/motion_2016-04-23_17.58.36_9.jpg [email protected]

Question 1,

Is system using (mpack) direct outgoing tcp 25 smtp session to recipent email server? Will it leverage "ssmtp" to setup "smart relay host" details (user/pass,etc) so that email be relayed to a relay, like Gmail or others, which are accepted SMTP server?

Most of residential ISP blocking outgoing AND incoming port 25 for smtp. If we're using a direct SMTP 25, it will not work in many of these situations; although, my IP is allowed for both direction of port 25 as I am paying extra $5/month.

If we can leverage "smart host relay", it may help.

Question 2,

For copying file (video/stills) to remote server after motion event, will it try until a successful result? Sometimes, we may have a network disconnect and PI can not reach host. Will it queue the actions for later try or will it simply drop the action?
If not very complex, can we make it like Printer Method? When we try to print stuff, if printer is not available, it will queue those action items and send to printer once remote printer is available. That would be nice, as I often turn off power at night to same some energy. :-) People may experience network loss some time too.


Question 3,
For copying file to remote host, how many methods can we use? scp will be one, Jbeale mentioned curl FTP. Any others?
Maybe, we can have a wiki of of this topic, to include tested ways of , copying file to remote server via scp, sftp, etc. as well as mount remote shares, like nfs, smb, curlftps, sshfs, without loosing web function like reading thumnails, etc.

Question 4.
Jbeagle, contributed a Cron script to delete files after some time to save space on SD card/USB drive, can we integrate this function into your web interface so to make it bit easier for us.

Thanks and great software!
Last edited by rpiatf2f10 on Mon Apr 25, 2016 10:42 am, edited 1 time in total.

Tim Barker
Posts: 40
Joined: Sun Oct 05, 2014 5:02 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 24, 2016 2:48 am

Great assembly :) . Ideal setup for such a small camera module. Makes me want to look at servo control as well... Can think of a couple of likely locations.

User avatar
jbeale
Posts: 3517
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 24, 2016 7:05 am

Not just curl, but one thing I've found useful for automatically transferring images to remote sites is curlftpfs which allows your remote FTP site to appear mounted as if it is simply part of your local filesystem, so you just use ls, cp, rm as with any other directory. sudo apt-get install curlftpfs

EDIT: removed link to code on Sourceforge site, which has apparently fallen into disrepute[?]
Last edited by jbeale on Sun Apr 24, 2016 6:43 pm, edited 1 time in total.

YvesG
Posts: 46
Joined: Wed Oct 03, 2012 6:54 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 24, 2016 8:15 am

billw wrote:
billw wrote: Actually, I'm looking to get the pikrellcam with servo control upgrade out soon today and after that
I'll post some pics of how I mount the servos. I made a PCB layout with mounting pieces I cut out
and assemble into servo brackets. Then I mount the servo bracket assembly on another PCB that
attaches to the Pi 40 pin header. This PCB is pretty simple and mainly has a reserved area for
attaching the servo bracket assembly, a DC-DC down converter and 3 pin headers to break out the
Pi PWM GPIOs. I'm making my own servo brackets because I could not find one to buy that was
compact enough to fit into the outside enclosures I build.
Here is my picam-mount PCB and how I cut it and assemble it. It's what I have working, but I've made
small revisions to it and am waiting to send it off to Itead until I see the rumored Pi camera V2. I want
to make sure of its dimensions.
picam0.jpg
Also a pic of close to the final assembly with the servos attached to my second PCB that plugs into
the Pi header.
picam2.jpg
Really nice and impressive the HW is at the same level than the software : very well done

Return to “Camera board”