Code: Select all
~ $ systemd-analyze
Startup finished in 1.541s (kernel) + 53.156s (userspace) = 54.697s
Code: Select all
~ $ systemd-analyze blame
39.152s dev-mmcblk0p2.device
35.421s systemd-fsck-root.service
6.832s networking.service
6.709s dphys-swapfile.service
5.776s hciuart.service
5.302s raspi-config.service
4.257s rc-local.service
4.197s nginx.service
4.123s lightdm.service
2.955s php7.0-fpm.service
2.604s keyboard-setup.service
2.525s systemd-logind.service
2.162s [email protected]
1.684s rsyslog.service
1.347s gldriver-test.service
1.224s systemd-journald.service
1.171s ssh.service
1.121s triggerhappy.service
1.091s udisks2.service
1.070s systemd-udev-trigger.service
898ms systemd-udevd.service
882ms systemd-timesyncd.service
829ms dhcpcd.service
803ms systemd-rfkill.service
772ms alsa-restore.service
691ms [email protected]\x2dpartuuid-7e434fc6\x2d01.service
651ms phpsessionclean.service
624ms dev-mqueue.mount
605ms run-rpc_pipefs.mount
527ms systemd-modules-load.service
521ms systemd-tmpfiles-setup.service
514ms systemd-user-sessions.service
461ms sys-kernel-debug.mount
457ms systemd-tmpfiles-setup-dev.service
440ms kmod-static-nodes.service
426ms systemd-update-utmp.service
423ms polkit.service
370ms plymouth-read-write.service
349ms nfs-config.service
305ms sys-kernel-config.mount
301ms systemd-sysctl.service
296ms console-setup.service
242ms systemd-remount-fs.service
224ms systemd-journal-flush.service
220ms boot.mount
207ms plymouth-quit-wait.service
204ms plymouth-start.service
170ms systemd-random-seed.service
149ms systemd-update-utmp-runlevel.service
146ms plymouth-quit.service
121ms systemd-tmpfiles-clean.service
110ms sys-fs-fuse-connections.mount
So now I may record sound in stereo if I buy a stereo mic like the ps3 eye ?I got the 2 channel audio fixed up and audio can now be used as a motion event to trigger a recording.
The PS3 Eye Cam is a good buy. It has better sensitivity than a -35 dB electret mic I was using and is better with noise than those cheap USB soundcards you find on Ebay and Amazon. I've been able to modulate noise with those soundcards just by changing the orientation of the USB extension cable I have them plugged in to. So I do recommend trying the Eye Cam, thanks John for pointing it out.
A bit closer I think..Nestboxtech wrote: ↑Sat Jan 06, 2018 4:22 pmI have a v simple python script that appends a row to a 'event log file', events might include a PIR activation, IR beam breakage, or camera trigger.
I want this to run when motion is detected by PikrellCam to cover the camera trigger bits. I cant locate in the forums how to do this, the nearest I got was adding this to at-commands.conf : on_motion_begin python "/home/pi/sensor_Camera_on_motion_event.py"
which does not work.... am I adding this to the right place, or is the syntax wrong?
any help would be appreciated![]()
Maybe the python command needs the full path or just give the script as the command if it starts with #!/usr/bin/env pythonNestboxtech wrote: ↑Sat Jan 06, 2018 7:12 pmA bit closer I think..
Have switched the command to pikrellcam.conf:
on_motion_begin "python /home/pi/Desktop/BirdCam2/Dec_2017_scripts/live/sensor_Camera_on_motion_event.py"
the script is executable and works if run form a terminal window.
log entry as follows: 19:04:39 : on_motion_begin: - running: "python /home/pi/sensor_Camera_on_motion_event.py"
but does not trigger the script...
figured it out, it was as simple as a misplaced ". So the command should have read as:billw wrote: ↑Sat Jan 06, 2018 8:37 pm
Maybe the python command needs the full path or just give the script as the command if it starts with #!/usr/bin/env python
To see what's going on, stop pikrellcam from the web page and then run pikrellcam from a terminal so you can see if any error messages are printed out when the command tries to run.
If you have nfs-kernel-server installed the archive directory can be mounted with a NFS filesystem. On the computer to be archived to, the /etc/exports file needs to have permission to export. This is what I've just done, maybe it can be a guide. On my gkrellm6 desktop (could be another Pi), I have /home mounted with a partition, so in /etc/exports on gkrellm6 I allow the export mount with a line:
Code: Select all
/home 192.168.0.0/25(rw,nohide,no_subtree_check,no_root_squash)
Code: Select all
sudo systemctl restart nfs-kernel-server
Code: Select all
cd ~/pikrellcam/media
sudo mount -t nfs gkrellm6:/home/bill/pikrellcam archive
pikrellcam saves media files and archives videos to directories and has no concept of client/server. It only runs on the Pi doing the motion detect/recording. So to archive to a remote Pi, a directory on the remote Pi must be mounted on a directory on the Pi running pikrellcam.
Code: Select all
echo "archive_video day today" > ~/pikrellcam/www/FIFO
echo "archive_video day yesterday" > ~/pikrellcam/www/FIFO
The built in archiving doesn't handle those kinds of date selections, so maybe it's scripting time. But you could put a brute force wrapper around calling the builtin archiving script. Not actually tested except for echoing what it would do, but something like:Nestboxtech wrote: ↑Sun Jan 07, 2018 11:15 pmHow do I go about archiving in the following scenarios:
all videos older than 'x' days
all videos in media captured between x->y dates
I located jbeales archive script: viewtopic.php?f=43&t=115583&start=500
But wasnt sure if this functionality had been added withing the program since that was posted. Wanted to double check before dusting off my my basic shell scripting skills. I have >1600 vidoes in media and doing them a day at a time is somewhat tedious
Thanks, Chris
Code: Select all
#!/bin/bash
#archive_script="echo /home/pi/pikrellcam/scripts-dist/_archive-video"
archive_script=/home/pi/pikrellcam/scripts-dist/_archive-video
archive_dir=/home/pi/pikrellcam/media/archive
media_dir=/home/pi/pikrellcam/media
log=/tmp/log-for-this-script
year=2017
days28="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28"
days30="$days28 29 30"
days31="$days30 31"
for day in $days28
do
$archive_script day $year/02/$day $archive_dir $media_dir /dev/null $log
done
for month in 01 03 05 07 08 10 12
do
for day in $days31
do
$archive_script day $year/$month/$day $archive_dir $media_dir /dev/null $log
done
done
for month in 04 06 09 11
do
for day in $days30
do
$archive_script day $year/$month/$day $archive_dir $media_dir /dev/null $log
done
done
If you quit pikrellcam running from the web page and then start a new pikrellcam from a terminal and then try an archive of a video from the web page, you can see any error messages from the commands the archive script is running. Also look at the log file to see what the archiving is trying to do.
Here is an article about Google Drive and Raspberry Pi:
Okay I'll script it. For interest, if I select 'all' from the video screen then 'delete' this fails. No error in log, but works for a single day.billw wrote: ↑Mon Jan 08, 2018 2:05 amThe built in archiving doesn't handle those kinds of date selections, so maybe it's scripting time. But you could put a brute force wrapper around calling the builtin archiving script. Not actually tested except for echoing what it would do, but something like:Nestboxtech wrote: ↑Sun Jan 07, 2018 11:15 pmHow do I go about archiving in the following scenarios:
all videos older than 'x' days
all videos in media captured between x->y dates
I located jbeales archive script: viewtopic.php?f=43&t=115583&start=500
But wasnt sure if this functionality had been added withing the program since that was posted. Wanted to double check before dusting off my my basic shell scripting skills. I have >1600 vidoes in media and doing them a day at a time is somewhat tedious
Thanks, ChrisIf you use this, maybe you should try testing it on a smaller set of days first. A downside is it will create an archive directory structure for each of those days, but should then clean up dirs for empty days if no videos are actually archived for the day.Code: Select all
#!/bin/bash #archive_script="echo /home/pi/pikrellcam/scripts-dist/_archive-video" archive_script=/home/pi/pikrellcam/scripts-dist/_archive-video archive_dir=/home/pi/pikrellcam/media/archive media_dir=/home/pi/pikrellcam/media log=/tmp/log-for-this-script year=2017 days28="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28" days30="$days28 29 30" days31="$days30 31" for day in $days28 do $archive_script day $year/02/$day $archive_dir $media_dir /dev/null $log done for month in 01 03 05 07 08 10 12 do for day in $days31 do $archive_script day $year/$month/$day $archive_dir $media_dir /dev/null $log done done for month in 04 06 09 11 do for day in $days30 do $archive_script day $year/$month/$day $archive_dir $media_dir /dev/null $log done done
Great! Glad you got it set up. I've a few changes to finish up in day or so, but after that I'll make it a priority to get a NFS archiving section into the help page that will have a step by step guide.
Cheers! Ill give it a gojbeale wrote: ↑Tue Jan 09, 2018 10:32 pmHere is an article about Google Drive and Raspberry Pi:
viewtopic.php?t=109587
Google Drive has various general-purpose API examples, here are some in Python:
https://github.com/googledrive/PyDrive
Apparently, Google Photos still uses the old Google Picasa API, which is documented:
https://developers.google.com/picasa-we ... e_protocol
It's working fine. Do I have to change anything else ?# Audio channels. A USB sound card probably supports only mono and
# setting 2 channels for this case would be reverted to 1 when the
# microphone is opened.
#
audio_channels 2