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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Jun 18, 2019 1:06 pm

Does anyone know how to increase the size of the buttons on the PiKrellCam main page? I would like to increase the size of the Motion, Video, Stills, etc. buttons to make them easier to use on the touch screen I have mounted next to my front door. It's great for seeing who is outside, but the buttons are so small and difficult to activate. I have a similar issue on my phone, though not as much but it would still be great to make them bigger. I've reviewed the various .php files, .js and .css files and don't see anything that is obvious to me. Thanks in advance for any help with this!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jun 19, 2019 2:41 pm

tropho wrote:
Tue Jun 18, 2019 1:06 pm
Does anyone know how to increase the size of the buttons on the PiKrellCam main page? I would like to increase the size of the Motion, Video, Stills, etc. buttons to make them easier to use on the touch screen I have mounted next to my front door. It's great for seeing who is outside, but the buttons are so small and difficult to activate. I have a similar issue on my phone, though not as much but it would still be great to make them bigger. I've reviewed the various .php files, .js and .css files and don't see anything that is obvious to me. Thanks in advance for any help with this!
You can edit the font-size value in the .btn-control section in ~/pikrellcam/www/js-css/pikrellcam.css. Try changing it
from 0.9em to 1.2em for a start.

Any changes you make there will have to be redone after any upgrade because that file will be restored to the distribution
version.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jun 20, 2019 1:52 am

That works perfectly, thank you. 1.8em makes buttons just the right size for my touch screen

pkavanau
Posts: 3
Joined: Wed May 02, 2018 9:13 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jun 21, 2019 3:49 am

My servo interface isn't directly supported by PiKrellCam (it's neither Hardware PWM nor ServoBlaster), but I recently interfaced them rather easily by simulating ServoBlaster as follows:

(Don't install ServoBlaster, or at least don't run it)

Create /dev/servoblaster as a link to a FIFO (named pipe) with read/write access for user pi. As pi:

Code: Select all

dir=~pi/pikrellcam
mkfifo $dir/servoblaster
sudo ln -s $dir/servoblaster /dev
Note: if the FIFO is instead created directly under /dev, characters get dropped; I don't know why: anyone?

In pikrellcam.conf, set servo_use_servoblaster on (and configure pins, etc.)

Stop/start pikrellcam and refresh the browser so the servo buttons will appear

Now, servo commands can be processed in a loop like the following:

Code: Select all

while :
do
	IFS='=' read pin value < /dev/servoblaster
	width=$((value*10))
	echo Setting pin $pin to $width microseconds
done
(Also, a belated thank-you to Bill for his quick answer to my question Wed May 02, 2018.)
Last edited by pkavanau on Mon Jul 01, 2019 11:18 pm, edited 1 time in total.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Jun 25, 2019 6:43 am

As a long time user of pikrellcam, the inevitable has occurred - dead SD Card!

Luckily I documented all the steps I took two years ago when I last set it up. But this has me thinking of a few different things:
  • some kind of simple monitoring; I couldn't tell the card had died until I opened the web console because some aspects of the pi were working
    strategies for lessening the wear on the card; my media is written directly to an NFS share but there are still system logs, etc. being written to the card
    strategies for quick redeployment if the card does fail
I'm curious to hear if anyone has thought about these things and developed simple strategies that work for them.

Thanks in advance!

robinmarlow
Posts: 1
Joined: Thu Jun 27, 2019 1:17 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jun 27, 2019 1:26 pm

PiKrellCam makes a great babymonitor! particularly enjoying the easy timelapses.
I'd really like to be able to hear the audio on a mobile rather than loading the website and turning it on (although that does work).
It seems that to do that I need an rstp server - I've followed the instructions here (and the updated removing "-master")
but testing the stream with mplayer I get

Code: Select all

MPlayer 1.3.0-8.2.0 (C) 2000-2016 MPlayer Team

Playing rtsp://192.168.0.9:8555/stream.high.
Connecting to server 192.168.0.9[192.168.0.9]: 8555...

rtsp_session: unsupported RTSP server. Server type is 'GStreamer RTSP server'.
libavformat version 58.20.100 (external)
libavformat file format detected.
[rtsp @ 0x7f77c63e8840]method DESCRIBE failed: 503 Service Unavailable
LAVF_header: av_open_input_stream() failed
but running the script manually doesn't suggest there are issues....

Code: Select all

[email protected]:~# ./start-gst-variable-rtsp-server.sh 
[1]:main:527 - set debug level to: 99
[1]:main:535 - set port to: 8555
[1]:main:531 - set mount point to: /stream.high
[1]:main:539 - set user pipeline to: ( tcpclientsrc port=3000 do-timestamp=true blocksize=262144   ! video/x-h264,stream-format=byte-stream,profile=high   ! h264parse   !  rtph264pay name=pay0 pt=96 )
Pipeline set to: ( ( tcpclientsrc port=3000 do-timestamp=true blocksize=262144   ! video/x-h264,stream-format=byte-stream,profile=high   ! h264parse   !  rtph264pay name=pay0 pt=96 ) )...
Stream ready at rtsp://127.0.0.1:8555/stream.high
Does anyone have a suggestion for how to troubleshoot or a lighter solution than gstreamer?
I'm running on a PiZero.

Thanks,

Robin

Ouba
Posts: 13
Joined: Sun Jan 01, 2017 4:12 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Jul 05, 2019 10:16 am

It works with VLC or Rtsp player (Android). We also actually use it with unrealmediaserver. Only one stream live, more it is too much for the RPI.

piblackforest
Posts: 2
Joined: Sun Jul 07, 2019 11:22 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 07, 2019 11:27 am

mrmate wrote:
Fri Apr 26, 2019 7:28 am
I also use this script for sending a telegram message with a preview on my handy and it works very well.

Ciao,
Rainer
Dear Fox Mulder, kindly ask your assistance to make sending motion event notifications to telegram.
Will be very thankful for detailed instructions.
I just managed to arrange sending emails, but telegram usage is much needed for me.
Many thanks in advance and Best regards from Ukraine!
[/quote]

Hi,

what a wonderful piece of software! Can you pleases send me the script for the telegram messages?
Thanks a lot!

Greetings
Max

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 10, 2019 9:23 pm

Re: Telegram

I use the curl command and the Telegram api. Not my gist, but like so:
https://gist.github.com/dideler/85de4d6 ... 2304b9caf1

Put the curl command in a script and set that to run in pikrellcam.conf when the desired event occurs. I'm calling a script to send a notification when motion start event occurs and then calling a different script sending the preview image to Telegram chat when the motion preview save event occurs.

Edit: added the details below showing my set up

Follow above gist to create your bot and get <telegram_bot_token> and <chat_id>. Make sure you substitute them in the scripts below.

Create motion-notify script in ~/pikrellcam/scripts/motion-notify

Code: Select all

curl -i -X GET "https://api.telegram.org/bot<telegram_bot_token>/sendMessage?chat_id=<chat_id>&text=motion%20detected"

Set permissions on above script

Code: Select all

chmod 755 pikrellcam/scripts/motion-notify

Edit preview-save script ~/scripts/preview-save. Add the following to the end of script

Code: Select all

curl -F [email protected]$PREVIEW_JPEG -H "Content-Type:multipart/form-data" "https://api.telegram.org/bot<telegram_bot_token>/sendPhoto?chat_id=<chat_id>"

Ensure these two lines are present in ~/.pikrellcam/pikrellcam.conf by uncommenting / adding / editing lines as needed

Code: Select all

on_motion_begin $C/motion-notify
on_motion_preview_save $C/preview-save  $F $m $P $G $A

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 11, 2019 2:37 pm

Does anyone have any idea how we might tie a PiKrellCam feed into Google Assistant, like to the Google Nest Hub/Google Home Hub since it has a screen? Or perhaps to Chrome/Chromecast? I have no clue how this might be accomplished, but am curious to know if it is possible.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Jul 11, 2019 4:41 pm

tropho wrote:
Thu Jul 11, 2019 2:37 pm
Does anyone have any idea how we might tie a PiKrellCam feed into Google Assistant, like to the Google Nest Hub/Google Home Hub since it has a screen? Or perhaps to Chrome/Chromecast? I have no clue how this might be accomplished, but am curious to know if it is possible.
Well, after a bit of research I found that someone has made a tool to make part of this possible. "Cast All The Things", aka catt is a project on github that allows you to cast media and websites to your Chromecast-enabled devices, including Google Nest/Home Hubs. I just successfully cast the PiKrellCam webpage using the command catt -d "Living Room Hub" cast_site http://username:[email protected], where my Google Nest Hub named "Living Room Hub" displayed the PiKrellCam site running on my deck camera. It's fully controllable from the Nest Hub's screen, too! It requires python v3, so the installed-by-default version of python (v2.7) will not work. You'll need to install the python3 and python-pip3 packages to install and run catt, and I believe you will also need to use the update-alternatives tool to specify there are multiple versions of python available:

Code: Select all

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2
This capability doesn't directly address my initial voice-controlled, Google Assistant/voice-enabled dream to show a PiKrellCam feed on the Nest Hub screen, but it's a step in that direction. That would require either programming actions using the Google Assistant SDK (beyond my skills), or setting up a separate Home Assistant-powered, RPI-based device that can execute actions (scripts) via voice control. Coincidentally, I purchased three of the Google AIY Voice kits at Microcenter recently, as they are discounted to $2.99 (wow!) but you have to supply a Raspberry Pi. They have a Voice Hat with microphone and speakers, and you run Google Assistant on it. It's limited to commands and responses, so no media playback is possible BUT it can control GPIOs, run scripts, etc. since it's aimed at makers and hobbyists. This is how I could execute the catt command above, based on a custom Assistant action.

So the TL;DR here is there is definitely a way to cast the PiKrellCam webpage to a Chromecast-enabled device, and there may be a way to initiate that action via voice using the AIY Voice kit.

I will provide updates as I experiment with this.

CATT site on GitHub: https://github.com/skorokithakis/catt

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 14, 2019 9:13 pm

billw wrote:
Tue Jun 04, 2019 8:49 pm
Sorry, not yet. It's a work in progress.
I have seen that you added a new feature in pikrellcam:

Code: Select all

#ifdef MOTION_STILLS
	{ "\n# -------------------- Motion Still Recording -----------------------\n"
But I cannot find this code in the conf-file (even after upgrading). How can I activate this feature?
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jul 15, 2019 5:43 pm

andies wrote:
Sun Jul 14, 2019 9:13 pm
billw wrote:
Tue Jun 04, 2019 8:49 pm
Sorry, not yet. It's a work in progress.
I have seen that you added a new feature in pikrellcam:

Code: Select all

#ifdef MOTION_STILLS
	{ "\n# -------------------- Motion Still Recording -----------------------\n"
But I cannot find this code in the conf-file (even after upgrading). How can I activate this feature?
The #ifdef is there because I'm not finished adding the feature. I still need to work out some details on how motion stills interact
with the rest of the program and will remove the #ifdefs when it's ready. If you were to enable MOTION_STILLS in the code that's in
the current PiKrellCam release, the program will crash.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Jul 15, 2019 6:31 pm

OK, I was too fast. Sorry and thanks!
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 17, 2019 10:29 pm

A new camera for the Pi.

Hello,

I just found that arducam has new cameras for the Pi.
I am interested in this one:

'Arducam IMX298 MIPI 16MP Color Camera Module for Raspberry '

https://www.arducam.com/product/16mp-im ... pberry-pi/

and this 13MP one:
'Arducam IMX135 MIPI 13MP Color Camera Module for Raspberry Pi'
https://www.uctronics.com/index.php/ard ... odule.html

Would they work with PikrellCam?

Thank you.

PS: They also have this PTZ camera which may be interesting: https://www.uctronics.com/index.php/ard ... ry-pi.html

Sp4rkR4t
Posts: 4
Joined: Sat Jan 07, 2017 10:10 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Jul 20, 2019 11:58 am

Hey all, I've been using Pikrellcam on a few units now to monitor the wildlife in my garden and todays upgrade was to replace the cheap usb mics with ones that actually work so I built some using the adafruit i2s-mems breakout (https://learn.adafruit.com/adafruit-i2s ... g-and-test) and tested the device with arecord and it is doing a great job but the issue I'm having is it is not being picked up by pikrellcam, I had a look in the conf file and found the audio device line which was set to plughw:1 which should be address the base device but that would be quiet however I have set up volume control which I address in arecord using dmic_sv so I took a punt and changed plughw:1 in the conf file to dmic_sv but that just threw up errors about set format failed, invalid argument when I try to open the audio in the UI.

Does anyone have any ideas, I was pretty proud of myself for built these mics and they work great, just need to get them integrated into pikrellcam.

EDIT: Just to clarify if I use arecord to record from plughw:1 it does pick up sound it's just quieter than if it goes through dmic_sv, however when pikrellcam is set to plughw:1 it picks up nothing but also throws up no errors.

piblackforest
Posts: 2
Joined: Sun Jul 07, 2019 11:22 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Jul 21, 2019 8:46 pm

jeff65 wrote:
Wed Jul 10, 2019 9:23 pm
Re: Telegram

I use the curl command and the Telegram api. Not my gist, but like so:
https://gist.github.com/dideler/85de4d6 ... 2304b9caf1

Put the curl command in a script and set that to run in pikrellcam.conf when the desired event occurs. I'm calling a script to send a notification when motion start event occurs and then calling a different script sending the preview image to Telegram chat when the motion preview save event occurs.

Edit: added the details below showing my set up

Follow above gist to create your bot and get <telegram_bot_token> and <chat_id>. Make sure you substitute them in the scripts below.

Create motion-notify script in ~/pikrellcam/scripts/motion-notify

Code: Select all

curl -i -X GET "https://api.telegram.org/bot<telegram_bot_token>/sendMessage?chat_id=<chat_id>&text=motion%20detected"

Set permissions on above script

Code: Select all

chmod 755 pikrellcam/scripts/motion-notify

Edit preview-save script ~/scripts/preview-save. Add the following to the end of script

Code: Select all

curl -F [email protected]$PREVIEW_JPEG -H "Content-Type:multipart/form-data" "https://api.telegram.org/bot<telegram_bot_token>/sendPhoto?chat_id=<chat_id>"

Ensure these two lines are present in ~/.pikrellcam/pikrellcam.conf by uncommenting / adding / editing lines as needed

Code: Select all

on_motion_begin $C/motion-notify
on_motion_preview_save $C/preview-save  $F $m $P $G $A
Hi,
thanks a lot! Works absolutely perfect, really appreciate this project.
Greetings

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

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Jul 31, 2019 11:33 pm

andies wrote:
Sun Jul 14, 2019 9:13 pm
billw wrote:
Tue Jun 04, 2019 8:49 pm
Sorry, not yet. It's a work in progress.
I have seen that you added a new feature in pikrellcam:

Code: Select all

#ifdef MOTION_STILLS
	{ "\n# -------------------- Motion Still Recording -----------------------\n"
But I cannot find this code in the conf-file (even after upgrading). How can I activate this feature?
I've uploaded a version which has the motion still recording mode available so you can upgrade now and give it a try.

Sp4rkR4t
Posts: 4
Joined: Sat Jan 07, 2017 10:10 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 02, 2019 5:30 pm

I've added a PIR sensor to one of my camera traps and it works well to create a 10 second video by sending "record on 5 5" to FIFO, however I'd like to send a start record command on motion activity and a stop when activity has ended, where can I find the commands I can send to FIFO to do this?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Aug 02, 2019 11:52 pm

Sp4rkR4t wrote:
Fri Aug 02, 2019 5:30 pm
I've added a PIR sensor to one of my camera traps and it works well to create a 10 second video by sending "record on 5 5" to FIFO, however I'd like to send a start record command on motion activity and a stop when activity has ended, where can I find the commands I can send to FIFO to do this?
Simplest is your PIR starts a record you want to have 5 seconds of precapture and you want it to record until you send "record off":

Code: Select all

"record on 5 0"
Thte "0" says recording time is open ended and you need to eventually send:

Code: Select all

"record off"
This will be labelled a "Manual" video on the web page thumb.

There's also the "motion trigger" command which has the benefit of custom labels on the web page thumbs.
For example, start a record with precapture as set by the config of Config->Motion->Pre_Capture, Then continue recording as long as
another "motion trigger" command is sent before the Event_Gap expires. Make the web page thumb have a "PIR" label.

Code: Select all

"motion trigger 0:PIR"
If you want to stop the record before the Event_Gap expires, send a "record off" If you want to always make the decision to end the
video with your "record off", you need to config the Event_Gap to a large value. You can't make pikrellcam ignore the event gap for
a motion recording.

Search for "motion trigger" in the help page. There's a more complete description in the "FIFO Commands" section examples.

Sp4rkR4t
Posts: 4
Joined: Sat Jan 07, 2017 10:10 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Aug 03, 2019 8:25 am

That's perfect, thanks again for this software!

DaveHog
Posts: 2
Joined: Mon Aug 12, 2019 12:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Aug 12, 2019 12:46 pm

First up, massive thanks for putting this great solution together. :D

I'm in need of some advice. I have a pi Zero W with a pi night vision camera.

Where can I find some guidance on tweaking the motion detection to avoid false positives? There's various setting on the web page, but I have no idea what they do.

I also bought a PIR, with the idea that it would be more efficient to use that to detect motion, and only then fire up the camera and the attached IR LEDs. Has anyone tried this and noticed that it was worthwhile?
Last edited by DaveHog on Mon Aug 12, 2019 6:54 pm, edited 1 time in total.

DaveHog
Posts: 2
Joined: Mon Aug 12, 2019 12:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Aug 12, 2019 2:09 pm

duplicate message - will delete
Last edited by DaveHog on Mon Aug 12, 2019 6:52 pm, edited 1 time in total.

Sp4rkR4t
Posts: 4
Joined: Sat Jan 07, 2017 10:10 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Aug 12, 2019 4:17 pm

I tried adding a PIR to my setup and the cameras attached to the mains did work well enough to reduce false positives but the ones on batteries the PIR never stabilised making it record near constantly. Regarding the tuning the motion detection it's my understanding that count represents the size of the object you are trying to detect (lower counts = smaller object) and magnitude seems to be speed of the vector, a lower setting picks up slower moving objects. Have to admit I've not the foggiest when it comes to the burst settings, I know they are a way to deal with objects extremely close to the camera.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Aug 13, 2019 6:38 pm

I had a go at adding the new AWB 'greyworld' parameter to Pikrellcam for V2 NoIR cameras (see sticky at top of camera forum by jamesh).
It's rather trivial :)

As of this writing, you will need to run rpi-update to get the newest firmware. That will change soon, I assume.

In ~/pikrellcam/src/config.c, append the following line to the end of awb_mode_table (found around line 117):

Code: Select all

{ MMAL_PARAM_AWBMODE_GREYWORLD,     "greyworld" }
Then

Code: Select all

make
And restart Pikrellcam. Works great here.

Kudos to billw for the great work.

Edit: Forgot to mention the obvious; pikrellcam.conf needs:

Code: Select all

white_balance greyworld
Self-education is, I firmly believe, the only kind of education there is - Isaac Asimov

Return to “Camera board”