User avatar
CharlyDelta
Posts: 234
Joined: Thu Jul 18, 2013 4:04 am
Location: Near Montreal, Quebec

Re: PiKrellCam: motion vector detect + OSD web interface (BUTTONS)

Mon Mar 29, 2021 4:12 pm

Hello.
Recently I use Pikrellcam for my nesting box cameras because of the possibility to add a microphone, which works very well.
Now I want to add 4 buttons to control white and infrared lights.
I managed to add these buttons but I can't find a way to modify the scripts to make the lights work.

Here are the buttons:

Image

And the script for the first button:

Code: Select all

<?php
// Example custom.php places a button below System panel
echo "<span style=\"color: $default_text_color; margin-left:25px;\"></span>
    <input id='log_button' type='button' value='Blanches'
        style='margin-left:16px;'
        onclick=\"window.location='log.php';\"
        class='btn-control'
        >"
?>
What I changed:

Code: Select all

<?php
// Example custom.php places a button below System panel
echo "<span style=\"color: $default_text_color; margin-left:25px;\"></span>
    <input id='log_button' type='button' value='Blanches'
        style='margin-left:16px;'
        onclick=\"i2cset -y 1 0x70 0x00 0x5a"
        class='btn-control'
        >"
?>
Also, I tried with a sh file (home/pi/pikrellcam/www/blanches.sh

Code: Select all

#!/bin/bash

i2cset -y 1 0x70 0x00 0x5a
And the custom.php:

Code: Select all

<?php
// Example custom.php places a button below System panel
echo "<span style=\"color: $default_text_color; margin-left:25px;\"></span>
    <input id='log_button' type='button' value='Blanches'
        style='margin-left:16px;'
        onclick=\"home/pi/pikrellcam/www/blanches.sh"
        class='btn-control'
        >"
?>
Thank you for your help
nidcornifleur@gmail.com

User avatar
CharlyDelta
Posts: 234
Joined: Thu Jul 18, 2013 4:04 am
Location: Near Montreal, Quebec

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Mar 30, 2021 2:37 pm

Maybe convert the sh file to php?

Code: Select all


#!/bin/bash

i2cset -y 1 0x70 0x00 0x5a
i2cset -y 1 0x70 0x09 0x0f
i2cset -y 1 0x70 0x02 0x32
i2cset -y 1 0x70 0x04 0x32
i2cset -y 1 0x70 0x05 0x32
i2cset -y 1 0x70 0x07 0x32



changed to:

Code: Select all


#!/usr/bin/php

i2cset -y 1 0x70 0x00 0x5a
i2cset -y 1 0x70 0x09 0x0f
i2cset -y 1 0x70 0x02 0x32
i2cset -y 1 0x70 0x04 0x32
i2cset -y 1 0x70 0x05 0x32
i2cset -y 1 0x70 0x07 0x32

Now, the custom.php file:

Code: Select all


<?php
// Example custom.php places a button below System panel
echo "<span style=\"color: $default_text_color; margin-left:25px;\"></span>
    <input id='log_button' type='button' value='Blanches-InfraRouges'
        style='margin-left:16px;'
        onclick=\"window.location='blanches.php';\"
        class='btn-control'
        >"
?>



Instead of lightning leds here is what appears in a window:

#!/usr/bin/php i2cset -y 1 0x70 0x00 0x5a i2cset -y 1 0x70 0x09 0x0f i2cset -y 1 0x70 0x02 0x32 i2cset -y 1 0x70 0x04 0x32 i2cset -y 1 0x70 0x05 0x32 i2cset -y 1 0x70 0x07 0x32

the command does not run. Any idea ?
nidcornifleur@gmail.com

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

Re: PiKrellCam: motion vector detect + OSD web interface (BUTTONS)

Tue Mar 30, 2021 7:13 pm

@CharlyDelta, you have started with an example that "onclick" of the custom button tries to fill a new webpage for the client.

What you need when you create the custom buttons is to put them into a form that posts a message back to the PHP server
so it can run a php script on the sever which can run your commands. Something like this (I tested with an "led" program that turns a gpio pin on and off):

File /home/pi/pikrellcam/www/custom.html:

Code: Select all

<?php
if (isset($_POST['blanches']))
    {
 //  $CMD = "sudo -u pi /usr/local/bin/led on &";
    $CMD = "sudo -u pi /usr/sbin/i2cset -y 1 0x70 0x00 0x5a &";
    exec($CMD);
    }
if (isset($_POST['infrarouges']))
    {
//    $CMD = "sudo -u pi /usr/local/bin/led off &";
    $CMD = "sudo -u pi /usr/sbin/i2cset -y 1 0x70 0x09 0x0fq &";
    exec($CMD);
    }

// Show control buttons below System panel.
//echo "<div class='text-center top-margin'>";
echo "<div class='top-margin'>";
echo "<form method='post'>";
echo "<span style=\"color: $default_text_color; margin-left:25px;\"></span>
    <button type='submit' name='blanches' style='margin-left:16px;' class='btn-control'>Blanches</button>
    <button type='submit' name='infrarouges' style='margin-left:16px;' class='btn-control'>InfraRouges</button>";
echo "</form>";
echo "</div>";
?>
The other issue is that the php server runs as user www-data and has no permission to run i2cset so you have to give www-data sudo permission to do that. You have to create sudoers file, say i2cset:

File: /etc/sudoers.d/i2cset

Code: Select all

www-data ALL=(pi) NOPASSWD: /usr/sbin/i2cset
Best to create this sudoers file with visudo or you risk losing sudo capability.

User avatar
CharlyDelta
Posts: 234
Joined: Thu Jul 18, 2013 4:04 am
Location: Near Montreal, Quebec

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 01, 2021 1:40 pm

Thank you billw.

I'll have a look into it .
nidcornifleur@gmail.com

User avatar
CharlyDelta
Posts: 234
Joined: Thu Jul 18, 2013 4:04 am
Location: Near Montreal, Quebec

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Apr 02, 2021 3:47 am

Total success !! Thank you billw


Image

Code: Select all

<?php
if (isset($_POST['Blanches']))
    {
    $CMD = "sudo -u pi /usr/sbin/i2cset -y 1 0x70 0x00 0x5a &";
    exec($CMD);
    }
if (isset($_POST['InfraRouges']))
    {
    $CMD = "sudo -u pi /usr/sbin/i2cset -y 1 0x70 0x00 0xa5 &";
    exec($CMD);
    }
if (isset($_POST['Éteindre']))
    {
    $CMD = "sudo -u pi /usr/sbin/i2cset -y 1 0x70 0x00 0x00 &";
    exec($CMD);
    }

echo "<div class='top-margin'>";
echo "<form method='post'>";
echo "<span style=\"color: $default_text_color; margin-left:25px;\"></span>
    <button type='submit' name='Blanches' style='margin-left:16px;' class='btn-control'>Blanches</button>
    <button type='submit' name='InfraRouges' style='margin-left:16px;' class='btn-control'>InfraRouges</button>
    <button type='submit' name='Éteindre' style='margin-left:16px;' class='btn-control'>Éteindre</button>";

echo "</form>";
echo "</div>";
?>
nidcornifleur@gmail.com

User avatar
CharlyDelta
Posts: 234
Joined: Thu Jul 18, 2013 4:04 am
Location: Near Montreal, Quebec

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 12, 2021 2:55 am

Hello...

How can I share the image without the buttons. Indeed, my friend wants to monitor but I don't want him to be able to change the settings. I found /live.php but when I click on the image, the buttons come back...

Thanks for your help
nidcornifleur@gmail.com

Rasilon
Posts: 109
Joined: Wed Mar 11, 2015 7:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 13, 2021 5:14 pm

I would very much like to do this myself. I want to be able to put out live without access to the system menu.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 13, 2021 10:22 pm

Rasilon wrote:
Tue Apr 13, 2021 5:14 pm
I would very much like to do this myself. I want to be able to put out live without access to the system menu.
The live.php file has an "onclick" that should not be there. So edit ~/pikrellcam/www/live.php and change the third line from the bottom to remove the onclick. That is, change the line

Code: Select all

<img id="mjpeg_image" style="width:100%" onclick='window.open("index.php","_blank");'>
to

Code: Select all

<img id="mjpeg_image" style="width:100%">

Rasilon
Posts: 109
Joined: Wed Mar 11, 2015 7:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 13, 2021 10:31 pm

Fantastic all fixed tnx

photos4020
Posts: 2
Joined: Wed Apr 14, 2021 2:49 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 14, 2021 3:01 am

Hi,

I did a search on this topic but could not find exactly what I am looking for. I want to use the piKrellCam motion detection to turn on a 5v solid-state relay to take a picture with a DLSR. I am a newbie to Pi, scripts, and python, but I am familiar with VB.NET so I can read and muddle my way through. It looks like I need to modify the pikrellcam.conf file, and I think I should be making the changes in the "on_motion_begin". But I am clueless around adding the LED GPIO option and where I should be doing that.

I have the system setup (PiKrellCam) and the standard version is working great. Can anyone provide some help?

Searching the forum most people are using GPIO to turn on lighting or IR LEDs at set times, not using the motion detection to turn on the LEDs.

regards Tom

toner_cloud
Posts: 16
Joined: Mon Apr 27, 2020 4:47 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 14, 2021 3:54 pm

photos4020 wrote:
Wed Apr 14, 2021 3:01 am
Hi,

I did a search on this topic but could not find exactly what I am looking for. I want to use the piKrellCam motion detection to turn on a 5v solid-state relay to take a picture with a DLSR. I am a newbie to Pi, scripts, and python, but I am familiar with VB.NET so I can read and muddle my way through. It looks like I need to modify the pikrellcam.conf file, and I think I should be making the changes in the "on_motion_begin". But I am clueless around adding the LED GPIO option and where I should be doing that.

I have the system setup (PiKrellCam) and the standard version is working great. Can anyone provide some help?

Searching the forum most people are using GPIO to turn on lighting or IR LEDs at set times, not using the motion detection to turn on the LEDs.

regards Tom
If you know how to turn on an LED and are reasonably familiar with code, try adding a call to python (for example) to switch the relay on and off at regular intervals before connecting it to mains power (or wherever you're going to connect it!). I use a python routine to switch an LED ring off and on at sunrise and sunset.

As for how, in the pikrellcam.conf file, the answer is provided for you. I did this 'cat ~/.pikrellcam/pikrellcam.conf | grep motion' and it shows these lines :-
# Command/script to run when a motion enable changes.
# on_motion_enable $C/motion-enable-script $o

For help with those locations take a look at ~/.pikrellcam/at-commands.conf and not ~/.pikrellcam/at_commands.conf
as the pikrellcam.conf file suggests.

If you take a look at other Raspberry Pi forums, there are lots of examples of hooking up SSRs. For example - viewtopic.php?p=1520399 or elsewhere - https://www.instructables.com/Solid-Sta ... pberry-Pi/

tennisparty
Posts: 30
Joined: Tue Sep 24, 2019 12:36 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri Apr 16, 2021 3:26 pm

Hello,

Does anyone know where the motion detection settings (including vector magnitude etc etc) are stored. I have looked for these in the pikrellcam.conf file but not found them.

I want to keep these settings persistent within a container

The config.c file on GitHub states:
"# PiKrellCam V3.0 stores some motion detect settings in preset-xxx.conf\n"

But I cannot find this file,

Many thanks,
Sam

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 17, 2021 3:11 am

tennisparty wrote:
Fri Apr 16, 2021 3:26 pm
Does anyone know where the motion detection settings (including vector magnitude etc etc) are stored. I have looked for these in the pikrellcam.conf file but not found them.
Motion settings are associated with presets. If you have servos configured the config file is

Code: Select all

~/.pikrellcam/preset-servos.conf
If servos are not configured the file is

Code: Select all

~/.pikrellcam/preset-no-servos.conf

tennisparty
Posts: 30
Joined: Tue Sep 24, 2019 12:36 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 17, 2021 8:38 am

Thanks Bill that's really useful.

Sorry another question as I can't see those files in my containerised install. There are all sorts of permissions errors on the install so I think that will be the reason. Are those files generated by the install script (I can't see any reference in the script) or by the first run of /home/pi/pikrellcam/pikrellcam.sh

Is there a specific user that needs rights to produce the files? I.e. Pi (depending on install) or www-data

Thanks for your help!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 17, 2021 6:35 pm

tennisparty wrote:
Sat Apr 17, 2021 8:38 am
Thanks Bill that's really useful.

Sorry another question as I can't see those files in my containerised install. There are all sorts of permissions errors on the install so I think that will be the reason. Are those files generated by the install script (I can't see any reference in the script) or by the first run of /home/pi/pikrellcam/pikrellcam.sh

Is there a specific user that needs rights to produce the files? I.e. Pi (depending on install) or www-data

Thanks for your help!
The preset config files are not written until pikrellcam is run for the first time after the initial install (not during the install script). So you either need to click the web page "Start" button or run pikrellcam from a terminal to get the initial preset config files written. The install script and the pikrellcam program should be run as user pi and not some other user, so I don't think you should be getting permission errors during the install... for example, what errors?

Interacting with the web page typically sends commands to the FIFO where a running pikrellcam, as user pi, then acts upon the command. However, a few web page commands (media deletion, etc) are done via PHP so are done as user www-data. When you click the "Start" button, PHP under user www-data starts pikrellcam as user pi via a sudo -u pi command,.

Rasilon
Posts: 109
Joined: Wed Mar 11, 2015 7:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 18, 2021 9:29 pm

My prevue is freezing with no error in the log. RPI 4 b 4 gigs latest Raspbian os.

the manual commands work but i get 0mb's.

15:26:40 : command_process: record on
15:26:40 : Manual record start - /mnt/nfs/media/videos/manual_2021-04-18_09.11.57_1.h264
15:26:48 : command_process: record off
15:26:48 : execl[wait:0]: rm -f /mnt/nfs/media/videos/manual_2021-04-18_09.11.57_1.h264
15:26:48 : Manual record stop (size:0.0MB > /tmp:0.0MB) vid_time:18523927609344.00 vid_fps:0.00 audio_frames:0 audio_rate:0
15:26:52 : command_process: still
15:26:52 : still capture failed because jpeg encoder is busy.

tennisparty
Posts: 30
Joined: Tue Sep 24, 2019 12:36 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Mon Apr 19, 2021 4:04 pm

billw wrote:
Sat Apr 17, 2021 6:35 pm
tennisparty wrote:
Sat Apr 17, 2021 8:38 am
Thanks Bill that's really useful.

Sorry another question as I can't see those files in my containerised install. There are all sorts of permissions errors on the install so I think that will be the reason. Are those files generated by the install script (I can't see any reference in the script) or by the first run of /home/pi/pikrellcam/pikrellcam.sh

Is there a specific user that needs rights to produce the files? I.e. Pi (depending on install) or www-data

Thanks for your help!
The preset config files are not written until pikrellcam is run for the first time after the initial install (not during the install script). So you either need to click the web page "Start" button or run pikrellcam from a terminal to get the initial preset config files written. The install script and the pikrellcam program should be run as user pi and not some other user, so I don't think you should be getting permission errors during the install... for example, what errors?

Interacting with the web page typically sends commands to the FIFO where a running pikrellcam, as user pi, then acts upon the command. However, a few web page commands (media deletion, etc) are done via PHP so are done as user www-data. When you click the "Start" button, PHP under user www-data starts pikrellcam as user pi via a sudo -u pi command,.
Thanks Bill, really useful. Strangely the log of the pikrellcam installation inside the container says that several of the scripts folders and symbolic links can't be created but they seem to be present after the install so I am happy. I have managed to get it working! Running the ./pikrellcam file as pi worked but I had to give privilege to all users on /dev/vchiq within the container to allow the user pi to access the camera. As I said before permissions seem to be tricky within containers.

Thanks again for your help. Out of interest a few months ago I had asked on another thread whether one could adapt pikrellcam to use an ov9281 (or similar) camera with pikrellcam - viewtopic.php?f=43&t=302145&p=1814218&h ... 1#p1814218. I had a go but the MMAL code was far too complex for me to understand. I realise you have spent a huge amount of time on the software but do you think it would be possible to implement support for others (without spending an inordinate amount of time :P )? The high quality camera has been excellent for me as I am recording in infrared at night time so thanks again for adding support for it

Sam

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

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 20, 2021 9:42 am

toner_cloud wrote:
Thu Mar 25, 2021 9:46 am
kajan001 wrote:
Wed Mar 24, 2021 6:10 pm
I have now updated to piOS and latest version of pkc.So far I have had no issues but I have only had them running for short while.
How long is a 'short while'? Can you put another posting out when you've had this setup for say, a month? And also if you had any of these problems during that month?

That would be appreciated. Ta.
@toner_cloud
Ok, with PiOS (version as of beginning 2021) and with latest version of pikrellcam I have been running several pi's (pi0, pi3+, pi3a, pi 4) in intervals of 1-2 weeks without GUI or camera freezing.

The following settings have been applied:
GPU: 128 (not more than a fourth of total capacity)
Moderate filesizes and video lengths - not much more than 100mb per video. 2-5 minute clips, lower framerate than 24fps, bitrate about 4-5 mbs, 702p or less resolution)
Proper PSU (dont use phone chargers, the majority always crash the pi)
"over_voltage=4" for pi0 (in config.txt)

Things that frequently look like crashes:
- wifi dropout
- some browsers will always put https instead of http in front of IP-address (firefox for one) = "cannot find address"
- Pi suddenly logging onto different network (prioritize correctly in wpa_supplicant.conf - higher number = first choice

toner_cloud
Posts: 16
Joined: Mon Apr 27, 2020 4:47 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 21, 2021 9:36 am

kajan001 wrote:
Tue Apr 20, 2021 9:42 am
toner_cloud wrote:
Thu Mar 25, 2021 9:46 am
kajan001 wrote:
Wed Mar 24, 2021 6:10 pm
I have now updated to piOS and latest version of pkc.So far I have had no issues but I have only had them running for short while.
How long is a 'short while'? Can you put another posting out when you've had this setup for say, a month? And also if you had any of these problems during that month?

That would be appreciated. Ta.
@toner_cloud
Ok, with PiOS (version as of beginning 2021) and with latest version of pikrellcam I have been running several pi's (pi0, pi3+, pi3a, pi 4) in intervals of 1-2 weeks without GUI or camera freezing.

The following settings have been applied:
GPU: 128 (not more than a fourth of total capacity)
Moderate filesizes and video lengths - not much more than 100mb per video. 2-5 minute clips, lower framerate than 24fps, bitrate about 4-5 mbs, 702p or less resolution)
Proper PSU (dont use phone chargers, the majority always crash the pi)
"over_voltage=4" for pi0 (in config.txt)

Things that frequently look like crashes:
- wifi dropout
- some browsers will always put https instead of http in front of IP-address (firefox for one) = "cannot find address"
- Pi suddenly logging onto different network (prioritize correctly in wpa_supplicant.conf - higher number = first choice
Thanks for the info. Much appreciated.

Rasilon
Posts: 109
Joined: Wed Mar 11, 2015 7:30 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 24, 2021 5:49 pm

I had to set the video fps to 18 to stop the camera freezing

photos4020
Posts: 2
Joined: Wed Apr 14, 2021 2:49 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 29, 2021 4:57 am

toner_cloud wrote:
Wed Apr 14, 2021 3:54 pm
photos4020 wrote:
Wed Apr 14, 2021 3:01 am
Hi,

I did a search on this topic but could not find exactly what I am looking for. I want to use the piKrellCam motion detection to turn on a 5v solid-state relay to take a picture with a DLSR. I am a newbie to Pi, scripts, and python, but I am familiar with VB.NET so I can read and muddle my way through. It looks like I need to modify the pikrellcam.conf file, and I think I should be making the changes in the "on_motion_begin". But I am clueless around adding the LED GPIO option and where I should be doing that.

I have the system setup (PiKrellCam) and the standard version is working great. Can anyone provide some help?

Searching the forum most people are using GPIO to turn on lighting or IR LEDs at set times, not using the motion detection to turn on the LEDs.

regards Tom
If you know how to turn on an LED and are reasonably familiar with code, try adding a call to python (for example) to switch the relay on and off at regular intervals before connecting it to mains power (or wherever you're going to connect it!). I use a python routine to switch an LED ring off and on at sunrise and sunset.

As for how, in the pikrellcam.conf file, the answer is provided for you. I did this 'cat ~/.pikrellcam/pikrellcam.conf | grep motion' and it shows these lines :-
# Command/script to run when a motion enable changes.
# on_motion_enable $C/motion-enable-script $o

For help with those locations take a look at ~/.pikrellcam/at-commands.conf and not ~/.pikrellcam/at_commands.conf
as the pikrellcam.conf file suggests.

If you take a look at other Raspberry Pi forums, there are lots of examples of hooking up SSRs. For example - viewtopic.php?p=1520399 or elsewhere - https://www.instructables.com/Solid-Sta ... pberry-Pi/
Hi toner_cloud,

thank you for your reply. As I said before I am completely muddling my way through. After several attempts and re-reading the post and "motion-enable-scripts" I did get it to do what I wanted. I backed up the motion-enable-scripts and then gutted it and renamed it motion_events_trigger, then put my code inside. Added the on_motion_begin $C/motion_events_trigger $o inside the pikrellcam.conf if it helps anyone else here is my code

Code: Select all

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(24,GPIO.OUT)    #GPIO24 is pin18
print ("LED on")
GPIO.output(24,GPIO.HIGH)  #GPIO24 is pin18
time.sleep(1)
print ("LED off")
GPIO.output(24,GPIO.LOW)   #GPIO24 is pin18

now I have a relay turning on at the moment the threshold of motion detection is detected. Thanks all for the help and pointers

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

updated but new verson won't start

Sat May 01, 2021 3:36 pm

I have been running PiKrellCam on an old Pi model A board and it's worked for years. I just clicked the "update" button on the PKC webpage, and it apparently updated but then when restarted, the camera view would not start. I then rebooted, and removed and reinstalled PiKrellcam and it still will not start. I did sudo apt update && sudo apt upgrade, reboot, and still no joy. Is my Pi now hopelessly out of date?

EDIT: Given I was still on 'stretch', I guess the answer is "yes". https://www.raspberrypi.org/documentati ... pdating.md

Code: Select all

pi@rp31:~/pikrellcam $ ./pikrellcam 
./pikrellcam: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.27' not found (required by ./pikrellcam)
./pikrellcam: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by ./pikrellcam)

pi@rp31:~/pikrellcam $ uname -a
Linux rp31 4.19.66+ #1253 Thu Aug 15 11:37:30 BST 2019 armv6l GNU/Linux

pi@rp31:~/pikrellcam $ ldd --version
ldd (Debian GLIBC 2.24-11+deb9u4) 2.24

pi@rp31:~/pikrellcam $ sudo apt update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Get:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Get:4 http://raspbian.raspberrypi.org/raspbian stretch/contrib armhf Packages [56.9 kB]                                             
Get:5 http://raspbian.raspberrypi.org/raspbian stretch/non-free armhf Packages [98.9 kB]                                            
Get:6 http://raspbian.raspberrypi.org/raspbian stretch/rpi armhf Packages [1,360 B]                                                 
Fetched 11.8 MB in 42s (278 kB/s)                                                                                                   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

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

Re: updated but new verson won't start

Sat May 01, 2021 7:55 pm

jbeale wrote:
Sat May 01, 2021 3:36 pm
I have been running PiKrellCam on an old Pi model A board and it's worked for years. I just clicked the "update" button on the PKC webpage, and it apparently updated but then when restarted, the camera view would not start. I then rebooted, and removed and reinstalled PiKrellcam and it still will not start. I did sudo apt update && sudo apt upgrade, reboot, and still no joy. Is my Pi now hopelessly out of date?
See if a compile on that Stretch board will work (so pikrellcam uses Stretch intalled libs).

Code: Select all

cd ~/pikrellcam/src
make

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sat May 01, 2021 8:04 pm

I decided to get current and I did upgrade the OS via dist-upgrade; that took a while to complete but it worked and I am pleased to see that the stock PiKrellCam now works OK again. I have not tried compiling it myself.

Code: Select all

pi@rp31:~ $ uname -a
Linux rp31 5.10.17+ #1403 Mon Feb 22 11:26:13 GMT 2021 armv6l GNU/Linux

pi@rp31:~ $ ldd --version
ldd (Debian GLIBC 2.28-10+rpi1) 2.28

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

uploading .mp4 files by default?

Sun May 02, 2021 5:19 am

Just by the way, in the current github code, it looks like ~/.pikrellcam/pikrellcam.conf has this line
on_motion_end $C/motion-end $v $P $G

active (eg. not commented out, as I believe it was in the past) and these lines ~/pikrellcam/scripts/motion-end are also not commented out
scp_video $VIDEO_FILE ${machine1[@]}
scp_video $VIDEO_FILE ${rpi2[@]}


so after every motion detect, the log shows it is trying to send the video clip to local device 'rpi2' on port 20002 failing, and more concerning, it is sending the .mp4 clip to remote host 'user@machine1.com' and as there is no failure notice, possibly succeeding?

Code: Select all

  sshpass -p password scp -P 22 /home/pi/pikrellcam/media/videos/motion_2021-05-01_18.06.14_11.mp4 user@machine1.com:/home/pi/motion_videos
  Cannot connect to rpi2:20002.  scp of /home/pi/pikrellcam/media/videos/motion_2021-05-01_18.06.14_11.mp4 failed.
"machine1.com" is a real site... is every un-modified new install of PiKrellCam pinging their server?

Code: Select all

$ ping machine1.com
PING machine1.com (70.40.208.88) 56(84) bytes of data.
64 bytes from 70-40-208-88.unifiedlayer.com (70.40.208.88): icmp_seq=1 ttl=49 time=50.9 ms

Return to “Camera board”