314_PIE
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 18, 2017 10:59 am

Fox Mulder wrote:
314_PIE wrote:I went back into it to get another try, i got it to work but only for ssmtp command below that sent to my Outlook account successfully... i used App passwords for thr Auth section in ssmtp.conf. STARTTLS and port 587.

However, it seems to not work with mpack test command in order to send the jpeg motion images. Im not sure if it can talk to ssmtp.conf but i know ssmtp can.
That's exactly the problem. ssmtp uses it's own configuration where mail and mpack uses the linux wide mail system like postfix, sendmail or exim. So to use these commands you have to install and setup one of these mail systems on the pi properly. But if ssmtp works then why not just use it instead of mpack?

Ciao,
Rainer
I edited smtp.conf ~/pikrellcam/scripts/preview-save
and replaced the mpack script with this as i assume would be correct.

Code: Select all

# EMAIL_JPEG=$THUMB_JPEG

# Edit MY_EMAIL to your email address to email the preview jpeg.
#
## MY_EMAIL=My_Email_Address@outlook.com
## mpack -s pikrellcam@$HOSTNAME $EMAIL_JPEG $MY_EMAIL
## echo "mpack -s pikrellcam@$HOSTNAME $PREVIEW_JPEG $MY_EMAIL" >> $LOG_FILE

ssmtp -4 -au -ap My_Email_Address@outlook.com pikrellcam@$HOSTNAME $PREVIEW_JPEG
From the manual ssmtp: (man ssmtp)
-4 - IPv4 Only
-au - Specifies username for SMTP authentication.
-ap - Specifies password for SMTP authentication.

Edit
Not sure how to add this to the script:

MY_EMAIL=My_Email_Address@outlook.com
From:$MY_EMAIL To:$MY_EMAIL Subject:Pikrellcam_Motion_Detected
Last edited by 314_PIE on Thu Apr 20, 2017 2:26 am, edited 1 time in total.

Fox Mulder
Posts: 41
Joined: Fri Sep 21, 2012 11:24 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 18, 2017 11:41 am

314_PIE wrote:I edited smtp.conf and replaced the mpack script with this as i assume would be correct.

Code: Select all

# EMAIL_JPEG=$THUMB_JPEG

# Edit MY_EMAIL to your email address to email the preview jpeg.
#
## MY_EMAIL=My_Email_Address@outlook.com
## mpack -s pikrellcam@$HOSTNAME $EMAIL_JPEG $MY_EMAIL
## echo "mpack -s pikrellcam@$HOSTNAME $PREVIEW_JPEG $MY_EMAIL" >> $LOG_FILE

ssmtp -4 -au -ap My_Email_Address@outlook.com pikrellcam@$HOSTNAME $PREVIEW_JPEG
From the manual ssmtp: (man ssmtp)
-4 - IPv4 Only
-au - Specifies username for SMTP authentication.
-ap - Specifies password for SMTP authentication.

Edit
Not sure how to add this to the script:

MY_EMAIL=My_Email_Address@outlook.com
From:$MY_EMAIL To:$MY_EMAIL Subject:Pikrellcam_Motion_Detected
When you configured ssmtp.conf with username and password you don't need the -au and -ap parameters. They override the config options. But the main problem i see is that ssmtp seems not to support attachments. So if you want to send an attachment with ssmtp you have to manually mime encode it and add it to the email. I think this disqualifies ssmtp as an easy replacement for mpack (or alternatively mutt) to send the preview jpeg. :|

Seems you first have to configure your mail system on the Rpi with Exim or Postfix to send emails with attachments.

Ciao,
Rainer

punacmc
Posts: 31
Joined: Tue Nov 19, 2013 4:07 am

Re: PiKrellCam: motion vector detect + OSD web interface

Wed Apr 19, 2017 12:59 am

I'm sure that disk usage and clean up has been covered before, but I will share my script in case it helps others. I'm sure there are better ways to do this, but so far it has worked in the few tests I have done. If anyone sees any syntax errors or better ways to write the algorithm, just let me know. I'm sure I've forgotten to check for some condition that will break it, but programing isn't my forte. I just got fed up with having to manage multiple security cams daily.

It checks for disk usage where the media folder is stored. If a limit is reached, then it deletes the oldest file in the video and thumbs folder. The script is called from pikrellcam.conf file on the
event_motion_end_cmd option. In my testing, the disk usage stays within several percent of the target limit. It depends on the size of the video files removed and added, so leave some room for that. It defaults at 80%.

Code: Select all

#!/bin/bash

#cdrof.sh (check disk remove oldest file) Created by PuNacMC on 04-17-2017.
#punacmc@gmail.com for questions or suggestions
#This script is freely given to use as you wish on the condition you give credit
#where credit is due.

#The purpose of this script is to check the disk useage on the partition where
#Pikrellcam stores the  media. It then conducts a simple conditional statement
#to determine if the oldest file in the folder should be deleted based on the
#variables the user can define at the begining of the script. The script should
#be set to run by Pikrellcam using "event_motion_end_cmd" in the "pikrellcam.conf"
#file. For example "event_motion_end_cmd $C/cdrof.sh". This will run the script
#after the motion event has ended. This script is not quaranteed to work and you
#use it at your own risk.

#Credit for the syntax for deleting the oldest file goes to the_velour_fog
#located at https://unix.stackexchange.com/questions/355389/delete-oldest-file-in-directory

#Credit for the syntax for checking disk space and storing into variable
#goes to LINOXIDE at https://www.linux.com/blog/linux-shell-script-monitor-space-usage-and-send-email


#Terminate script after the first line that fails (returns nonzero exit code)
set -e

#Echo status on (1) or off (0). This is for debugging outside of Pikrellcam.
ESTAT=0

#Maximum used space variable. Set this to an integer that represents a percentage.
LIMIT=80

#Directory variables. Set these to where your Pikrellcam stores video and thumbnails
DIR="/home/pi/pikrellcam/media/videos"
DIR2="/home/pi/pikrellcam/media/thumbs"

#Navigate to first folder which should point to your videos.
cd $DIR
#Debugging echo statement
if [ $ESTAT -eq 1 ];
   then
   echo "Navigated to $DIR"
   fi

#Get used space of folders partition, and store in variable
USED=`df . | awk '{print $5 }' | sed -ne 2p | cut -d"%" -f1`

#Debugging echo statement
if [ $ESTAT -eq 1 ]; then echo "$USED"
fi
#Debugging echo statement
if [ $ESTAT -eq 1 ]; then echo "Used space is $USED"
fi

#Logic test to see if USED is greater than or equal to LIMIT
if [ $USED -eq $LIMIT ] || [ $USED -gt $LIMIT ];

#If logic test is true
then
   #Find the files in the video folder and sort them by date and time, pull the oldest and delete
   find . -type f -printf '%T+ %p\n' | sort | head -n1 | awk '{print $2}' | xargs rm -v
   #Debugging echo statement
   if [ $ESTAT -eq 1 ]; then echo "Deleted from Videos"
   fi
   #Change directory to second folder which should point to your thumbs
   cd $DIR2
   #Find the files in the thumbs folder and sort them by date and time, pull the oldest and delete
   find . -type f -printf '%T+ %p\n' | sort | head -n1 | awk '{print $2}' | xargs rm -v
   #Debugging echo statement
   if [ $ESTAT -eq 1 ]; then echo "Deleted from Thumbs"
   fi

#If logic test is false, exit conditional statement
else
   #Debugging echo statement
   if [ $ESTAT -eq 1 ]; then echo "Used Space $USED is not over Limit $LIMIT"
   fi
fi

#Script has completed without error
exit 0


314_PIE
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 20, 2017 2:22 am

Fox Mulder wrote:
314_PIE wrote:I edited smtp.conf and replaced the mpack script with this as i assume would be correct.

Code: Select all

# EMAIL_JPEG=$THUMB_JPEG

# Edit MY_EMAIL to your email address to email the preview jpeg.
#
## MY_EMAIL=My_Email_Address@outlook.com
## mpack -s pikrellcam@$HOSTNAME $EMAIL_JPEG $MY_EMAIL
## echo "mpack -s pikrellcam@$HOSTNAME $PREVIEW_JPEG $MY_EMAIL" >> $LOG_FILE

ssmtp -4 -au -ap My_Email_Address@outlook.com pikrellcam@$HOSTNAME $PREVIEW_JPEG
From the manual ssmtp: (man ssmtp)
-4 - IPv4 Only
-au - Specifies username for SMTP authentication.
-ap - Specifies password for SMTP authentication.

Edit
Not sure how to add this to the script:

MY_EMAIL=My_Email_Address@outlook.com
From:$MY_EMAIL To:$MY_EMAIL Subject:Pikrellcam_Motion_Detected
When you configured ssmtp.conf with username and password you don't need the -au and -ap parameters. They override the config options. But the main problem i see is that ssmtp seems not to support attachments. So if you want to send an attachment with ssmtp you have to manually mime encode it and add it to the email. I think this disqualifies ssmtp as an easy replacement for mpack (or alternatively mutt) to send the preview jpeg. :|

Seems you first have to configure your mail system on the Rpi with Exim or Postfix to send emails with attachments.

Ciao,
Rainer
Oops, i ment say in my previous post that i configured ~/pikrellcam/scripts/preview-save instead of ssmtp.conf..

I removed ssmtp and started of using Postfix which i heard is more up to date on security than Exim.
Postfix documentation is quite hard to understand, Im not sure if Postfix is lightweight which includes all sorts of configurations. I started by selecting no configuration on install. followed steps to setup as null client. http://www.postfix.org/STANDARD_CONFIGU ... ull_client

Dont know why main.cf is missing from postfix directory in /etc/postfix.

314_PIE
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 22, 2017 1:34 am

Fox Mulder wrote:
When you configured ssmtp.conf with username and password you don't need the -au and -ap parameters. They override the config options. But the main problem i see is that ssmtp seems not to support attachments. So if you want to send an attachment with ssmtp you have to manually mime encode it and add it to the email. I think this disqualifies ssmtp as an easy replacement for mpack (or alternatively mutt) to send the preview jpeg. :|

Seems you first have to configure your mail system on the Rpi with Exim or Postfix to send emails with attachments.

Ciao,
Rainer
Do i need to require a registered domain name for my network in order to setup Postfix? hostname@example.com...

User avatar
Gavinmc42
Posts: 1516
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 22, 2017 5:28 am

JBeale
I have not documented my IR strobe circuit, but it's simple- just a constant-current opamp drive circuit going to a string of IR LEDs which is switched on and off by a 1.5 msec signal from an Arduino at 23.1 Hz (which is the actual frame rate that I get from my Ebay OV5647 IR-cameras running at the default "24 fps" from PiKrellCam).
Got my IR leds and now finally some 12 degree optics for them.
You know the triple optics looks just like the optics you get in a 12V GU5.3 down light.
Hmm, just checked my GU10 spares, house has GU10 fittings now for LED mains.

We get the GU10's when they are on special, some are diffusers, some have 4, some 3 LED+optics.
The 4 LED optics are 60 degrees, the 3 LED optics are 38 degrees.
Got about 10 years of spares :lol:
The 60 degree optics would be good for the standard Pi camera lens.

Made a simple USB A connector resistor/led test setup, just plugs into power bank.
One Osram Platinum Dragon lights up a room for the Noir camera, resistor gets very warm at 350ma :lol:
Dragons can go up to 1Amp.

Now it is time to do a driver for them. I remembered your strobe idea.
Been playing with baremetal coding and found out about the GPCLK0,1,2.
GPCLK0 was used by the camera before EMI testing.
Still comes out on GPIO4 Alt0, have you tried to program GPCLK0 on GPIO4 to output the 23.1Hz?
A mosfet/current limiting transistor on GPIO4 should simplify things.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Fox Mulder
Posts: 41
Joined: Fri Sep 21, 2012 11:24 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 22, 2017 8:47 am

314_PIE wrote:Do i need to require a registered domain name for my network in order to setup Postfix? hostname@example.com...
No. You have to configure postfix to just relay emails to your email provider. There are different kind of setups and you have to use the right one. You can also configure postfix to act as if you have your own domain and send emails directly to the receiver, which is not the case for you. You want to use your existing email provider to sent these email and you just have to forward local emails to your provider.

There exists many simple examples in the internet for this kind of setup. One very basic example is here:
https://www.howtoforge.com/postfix_rela ... mailserver

Ciao,
Rainer

314_PIE
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sat Apr 22, 2017 11:17 am

Fox Mulder wrote:
314_PIE wrote:Do i need to require a registered domain name for my network in order to setup Postfix? hostname@example.com...
No. You have to configure postfix to just relay emails to your email provider. There are different kind of setups and you have to use the right one. You can also configure postfix to act as if you have your own domain and send emails directly to the receiver, which is not the case for you. You want to use your existing email provider to sent these email and you just have to forward local emails to your provider.

There exists many simple examples in the internet for this kind of setup. One very basic example is here:
https://www.howtoforge.com/postfix_rela ... mailserver

Ciao,
Rainer
Thankyou for this link, i got to the end of it and sent a mail attachment with mpack, but it came back as "You have mail in /etc/mail/pi" and it seems to be that STARTTLS is required for outlook, which i did enabled when i setup Ssmtp and it worked with it on port 587.

Im reading this TLS support for Postfix - http://www.postfix.org/TLS_README.html

Following these steps, as it is for Gmail but would be the same for Outlook.. fingers cross - http://mhawthorne.net/posts/postfix-con ... relay.html

Im getting somewhere now, im getting abort message this time:

Code: Select all

Apr 22 22:02:38 PiZeroW postfix/smtp[6960]: warning: database /etc/postfix/sasl_passwd.db is older than source file /etc/postfix/sasl_passwd
Apr 22 22:02:41 PiZeroW postfix/smtp[6960]: 6AD2B20E85: to=<My_Email_Address@outlook.com>, relay=smtp-mail.outlook.com[65.55.163.152]:587, delay=2.7, delays=0.11/0.23/2.1/0.24, dsn=5.7.3, status=bounced (host smtp-mail.outlook.com[65.55.163.152] said: 550 5.7.3 Requested action aborted; user not authenticated (in reply to MAIL FROM command))
Apr 22 22:02:41 PiZeroW postfix/local[6963]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Edit:

Started over again by reinstalling postfix along with mailutils, i followed this tutorial which seems to be the same as the previous tutorial on HowtoForge: https://www.howtoforge.com/tutorial/con ... ail-relay/

I decided to create a new email account which the original email account i used had a hyphen in it which i would think would be the cause of the "invaild email address" that would interfere with the command options when using "mail -s "Test subject" Email-address@outlook.com". But it wasn't, it kept telling me "Invaild Email Address" in /var/mail/pi.. i used a App password for every account i tried previously. I seriously dont understand why ssmtp is the only thing that bloody worked..

Ill get another crack at this tomorrow afternoon.
:cry:

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

Re: PiKrellCam: new audio feature

Mon Apr 24, 2017 4:28 pm

I haven't been paying attention and somehow missed that PiKrellCam now has a audio recording feature! I was able to confirm that it works (at least, the audio meter responds realistically) using a Sony PS3 Eye camera as the input device. For only $6 these work well as just a USB mic, even if you don't need a (low-quality 640x480) camera also: https://www.amazon.com/Sony-PlayStation ... B0072I2240 Note this particular device works on older (2016 & earlier) Raspbian releases, but for unknown reasons does not work with the current (2017) Raspbian: viewtopic.php?f=28&t=181578

There is a much smaller USB mic at the same price which I haven't tried, but looks interesting and is claimed to work with RPi also:
https://www.amazon.com/Kinobo-Microphon ... B00IR8R7WQ
Similar looking devices on ebay at half the price; no idea if they work. I suspect these are lower quality in every way than the PS3 Eye.
Last edited by jbeale on Wed Apr 26, 2017 5:13 pm, edited 2 times in total.

314_PIE
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 25, 2017 3:20 am

I now know whats causing this "invaild Email Address", its the 'From' address that is using the pi@outlook.com which is failing to send to outlook.com becuase the email doesnt exist. I never set this address up until it appeared in the error log when using Mutt instead of Mpack. Mpack just tells me its pi@PiZeroW which i assumed was right. I knew it wasn't something to do with my outlook account or sasl_passwd.

Heres the log:

Code: Select all

Final-Recipient: rfc822; My_Email_Address@outlook.com
Action: failed
Status: 5.5.4
Remote-MTA: dns; smtp-mail.outlook.com
Diagnostic-Code: smtp; 501 5.5.4 Invalid Email address

--0B66420FF1.1493089441/PiZeroW
Content-Description: Undelivered Message
Content-Type: message/rfc822

Return-Path: <pi@PiZeroW>
Received: by PiZeroW (Postfix, from userid 1000)
        id 0B66420FF1; Tue, 25 Apr 2017 13:03:56 +1000 (AEST)
Date: Tue, 25 Apr 2017 13:03:56 +1000
From: pi@outlook.com
To: My_Email_Address@outlook.com
Subject: Testing 1 2 3
Message-ID: <2076533367356.GA4220@outlook.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0"
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)
Changed /etc/mailname to the Hostname, nothing changed.. I think i need to configure main.cf with this: http://www.postfix.org/STANDARD_CONFIGU ... ml#fantasy ... Will this cause issues when using VPN service?

Fox Mulder
Posts: 41
Joined: Fri Sep 21, 2012 11:24 am

Re: PiKrellCam: motion vector detect + OSD web interface

Tue Apr 25, 2017 10:59 pm

314_PIE wrote:I now know whats causing this "invaild Email Address", its the 'From' address that is using the pi@outlook.com which is failing to send to outlook.com becuase the email doesnt exist. I never set this address up until it appeared in the error log when using Mutt instead of Mpack. Mpack just tells me its pi@PiZeroW which i assumed was right. I knew it wasn't something to do with my outlook account or sasl_passwd.

Changed /etc/mailname to the Hostname, nothing changed.. I think i need to configure main.cf with this: http://www.postfix.org/STANDARD_CONFIGU ... ml#fantasy ... Will this cause issues when using VPN service?
I think this is the right answer you found. I still use the "canonical" version which is there marked as obsolete. But it still works so i didn't change it.

For this i had to add to /etc/postfix/main.cf the following line

Code: Select all

sender_canonical_maps = hash:/etc/postfix/sender_canonical
And add to the file /etc/postfix/sender_canonical something like

Code: Select all

root        test@gmx.net
Now create a hashmap with

Code: Select all

postmap /etc/postfix/sender_canonical
After that change i can send emails from the user root and the "from" field is automatically rewritten to "test@gmx.net". That's all i remember late at night. But maybe the newer generic version is better, don't know.

Ciao,
Rainer

314_PIE
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 27, 2017 9:30 am

Fox Mulder wrote:
314_PIE wrote:I now know whats causing this "invaild Email Address", its the 'From' address that is using the pi@outlook.com which is failing to send to outlook.com becuase the email doesnt exist. I never set this address up until it appeared in the error log when using Mutt instead of Mpack. Mpack just tells me its pi@PiZeroW which i assumed was right. I knew it wasn't something to do with my outlook account or sasl_passwd.

Changed /etc/mailname to the Hostname, nothing changed.. I think i need to configure main.cf with this: http://www.postfix.org/STANDARD_CONFIGU ... ml#fantasy ... Will this cause issues when using VPN service?
I think this is the right answer you found. I still use the "canonical" version which is there marked as obsolete. But it still works so i didn't change it.

For this i had to add to /etc/postfix/main.cf the following line

Code: Select all

sender_canonical_maps = hash:/etc/postfix/sender_canonical
And add to the file /etc/postfix/sender_canonical something like

Code: Select all

root        test@gmx.net
Now create a hashmap with

Code: Select all

postmap /etc/postfix/sender_canonical
After that change i can send emails from the user root and the "from" field is automatically rewritten to "test@gmx.net". That's all i remember late at night. But maybe the newer generic version is better, don't know.

Ciao,
Rainer
Do i need to own a ISP mail account? Or just a random account without login that forwards the mail attachments to outlook.com, the generic version confuses me to how its set out which doesn't suit my needs. Its more for a user to user configuration knowing both the local host and addresses.

I think this is how it sends it out with a valid 'From' address.

Code: Select all

         Local Network                  ISP                Outlook.com
+------------------------------+  +--------------+     +--------------+
|   Hostname.lan               |  | Valid iSP    |     |              |
| +--------------------+-----+ |  |  Address     |     |  My Outlook Account
| | RPi        Postfix | Mpack----->            +--------->           |
| +--------------------+-----+ |  |              |     |              |
|       +------------+         |  |              |     |       +      |
|       |Email Client<-----------------------------------------+      |
+------------------------------+  +--------------+     +--------------+

Fox Mulder
Posts: 41
Joined: Fri Sep 21, 2012 11:24 am

Re: PiKrellCam: motion vector detect + OSD web interface

Thu Apr 27, 2017 6:41 pm

Here is an example for a standard email relay configuration if you have an existing email address at the provider gmx.net for example.
Let's say you have an email account at gmx.net like test@gmx.net. Then your email provider gmx has a smtp server available to accept emails from you at mail.gmx.net where you authenticate with your username and password. When you want to send email via postfix you set up your email accout data within "/etc/postfix/sasl_passwd" like "test@gmx.net username:password". The name sasl_passwd can be called like you want and just have to match the corresponding entry in main.cf. Then you set up your email relay in the file "/etc/postfix/sender_relay" like "test@gmx.net mail.gmx.net" which shows postfix that emails for test@gmx.net account should be sent through the mail.gmx.net server from your email provider. And last you set "/etc/postfix/sender_canonical" to something like "root test@gmx.net" which tells postfix to use test@gmx.net for all emails from the user root.

Then you hash all files with help of the program postmap. In main.cf you need at least the following options set.

Code: Select all

sender_canonical_maps = hash:/etc/postfix/sender_canonical
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sender_dependent_authentication = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
Additionally you need some other config options in main.cf, but these are for the mentioned files above.

Ciao,
Rainer

tvjon
Posts: 557
Joined: Mon Jan 07, 2013 9:11 am

Re: PiKrellCam: new audio feature

Fri Apr 28, 2017 8:35 am

jbeale wrote:... Raspbian releases, but for unknown reasons does not work with the current (2017) Raspbian: viewtopic.php?f=28&t=181578
...
I've just replied to your troubleshooting thread, as with the recent fw/kernel update, sound recording works again from the ps3 camera. I was unaware of it not working, as I've been busy with other things.

I've installed pikrellcam onto jessie lite, plugged into an A+ RPi, & the ps3cam audio is muxed in fine to the resulting mp4 file. I sshfs'd the A+ from a Pi3 to watch/listen to the result.

As you point out, this ps3 camera audio is very good quality for its low price, & a very useful test device.

Billw, thank you kindly for your pikrellcam software.

User avatar
Gavinmc42
Posts: 1516
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 30, 2017 6:35 am

I haven't been paying attention and somehow missed that PiKrellCam now has a audio recording feature!
I missed that too, mine have been working fine for months so never checked for updates.
Billw gets sound working and the Eyecam driver get broken :o
Looks like that's now fixed. Does it take Eyecam videos at the same time?

The Eyecams are a bit big for the Zero Cluster cams I am now trying to get going.
What other microphones work/have been tested with Pikrellcam?
Anything alsa/arecord can detect? i2s mems mics?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

314_PIE
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 30, 2017 12:19 pm

Fox Mulder wrote:Here is an example for a standard email relay configuration if you have an existing email address at the provider gmx.net for example.
Let's say you have an email account at gmx.net like test@gmx.net. Then your email provider gmx has a smtp server available to accept emails from you at mail.gmx.net where you authenticate with your username and password. When you want to send email via postfix you set up your email accout data within "/etc/postfix/sasl_passwd" like "test@gmx.net username:password". The name sasl_passwd can be called like you want and just have to match the corresponding entry in main.cf. Then you set up your email relay in the file "/etc/postfix/sender_relay" like "test@gmx.net mail.gmx.net" which shows postfix that emails for test@gmx.net account should be sent through the mail.gmx.net server from your email provider. And last you set "/etc/postfix/sender_canonical" to something like "root test@gmx.net" which tells postfix to use test@gmx.net for all emails from the user root.

Then you hash all files with help of the program postmap. In main.cf you need at least the following options set.

Code: Select all

sender_canonical_maps = hash:/etc/postfix/sender_canonical
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sender_dependent_authentication = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
Additionally you need some other config options in main.cf, but these are for the mentioned files above.

Ciao,
Rainer
Thanks, Got it working now. Used the generic version:

/etc/postfix/generic:

Code: Select all

@PiZeroW My_Email_Address@ISP.com
IMG_4987.JPG
IMG_4987.JPG (42.34 KiB) Viewed 2258 times
It turned up in Junk folder, i marked it as not Junk. All good

Should i encrypt my images individually when sending? Ill check for packages.

Thanks, ill start a test of the motion regions alert via email tomorrow :)

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

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 30, 2017 3:06 pm

Gavinmc42 wrote:
I haven't been paying attention and somehow missed that PiKrellCam now has a audio recording feature!
I missed that too, mine have been working fine for months so never checked for updates.
Billw gets sound working and the Eyecam driver get broken :o
Looks like that's now fixed. Does it take Eyecam videos at the same time?

The Eyecams are a bit big for the Zero Cluster cams I am now trying to get going.
What other microphones work/have been tested with Pikrellcam?
Anything alsa/arecord can detect? i2s mems mics?
It needs the CSI connected Raspberry Pi camera for video because of needing motion vectors,
but the mic from the Eyecam could be used.

Any microphone detected by arecord -l should work, just note the card number and possibly edit
pikrellcam.conf to match the device. So if you can get arecord to see a paper cup at the end of
a string, that should work fine!

But seriously, you might want to lean towards a more sensitive mic if you want to pick up sounds
away from the mic. Cheap ebay plastic hand held mics work but you will probably be disappointed
in the sensitivity. If yoiu don't have any mics on hand to try, electret mics around -40dB or better
soldered to a 3.5mm plug can be a cheap way to start.

habropoda
Posts: 6
Joined: Sun Apr 30, 2017 6:19 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Sun Apr 30, 2017 6:31 pm

Gavinmc42 wrote: Now it is time to do a driver for them. I remembered your strobe idea.
Been playing with baremetal coding and found out about the GPCLK0,1,2.
GPCLK0 was used by the camera before EMI testing.
Still comes out on GPIO4 Alt0, have you tried to program GPCLK0 on GPIO4 to output the 23.1Hz?
A mosfet/current limiting transistor on GPIO4 should simplify things.
For some coding to sync the Beale Infrared Strobe (BIS) to the camera frames see this thread:
viewtopic.php?t=143820&p=950814

I'm using a BIS to good effect but have not tried the sync code.

User avatar
Gavinmc42
Posts: 1516
Joined: Wed Aug 28, 2013 3:31 am

Re: PiKrellCam: motion vector detect + OSD web interface

Mon May 01, 2017 7:27 am

Thanks for the link habropoda.

Wonder if the jitter from the PLL clocks plays a part.
Can the 19.2MHz be divided accurately enough by the PWM or GPCLK0?
GPCLK0 will only give 50% duty cycle clock so a one shot pulse circuit will be needed to reduce LED duty cycle.

It's too bad RPF did not bring the strobe out of the sensor, even a test pint would be nice.
But RPF have a 5 year roadmap and "know" what they are doing so we don't have to tell them this for version V3.
Or V2.?

The software shenanigans needed are a little beyond me at this point.
Still getting latest kernel going with Jessie Lite.
Might just bite the bullet and figure out piCore, much easier to maintain and I have tested the camera working.
But BillW's code has so many dependencies it might take me forever to figure it out :(
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: updated auto-delete files script (disk space usage)

Fri May 05, 2017 8:57 am

jbeale wrote:Someone else posted a script to auto-delete the oldest files, and I've been happily using it.
Sorry for being ignorant if this was already mentioned in any of the 43 pages. I just found out to erase older days using a simple curl:

Code: Select all

http://your_url_here/media-archive.php?mode=archive&year=2017&m0=4&d0=1&m1=5&d1=1&delete_all
m0 is starting month, d0 starting day, m1 ending month and d1 ending day of that month. All stills and videos will be erased within both days.
raspberry B, Noir camera, Mac Book Air, iPhone, Bezzera

jamesw1
Posts: 2
Joined: Fri May 05, 2017 3:25 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri May 05, 2017 3:28 pm

I've been using pikrellcam a while now and it's fantastic.

Quick query... Is there a way I can auto-archive video files to the archive folder, once a day (for example)?

I know I could write a script to do this using at-commands, but when you click the 'archive' button in the GUI it puts the videos in useful folders by month and date. Does anybody know if there's a way of automating this?

Many thanks.

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri May 05, 2017 4:53 pm

jamesw1 wrote:I've been using pikrellcam a while now and it's fantastic.

Quick query... Is there a way I can auto-archive video files to the archive folder, once a day (for example)?

I know I could write a script to do this using at-commands, but when you click the 'archive' button in the GUI it puts the videos in useful folders by month and date. Does anybody know if there's a way of automating this?

Many thanks.
Use an at-command, but you don't have to write a script, just use a builtin archive_video command.
For example, do a daily archive of all of yesterdays videos at some time during the day that gives you
a chance to review them first and delete ones you don't want before the archive runs:

Code: Select all

# daily at 1:00PM archive all of yesterdays videos:
daily 13:00 "@archive_video day yesterday"

jamesw1
Posts: 2
Joined: Fri May 05, 2017 3:25 pm

Re: PiKrellCam: motion vector detect + OSD web interface

Fri May 05, 2017 5:01 pm

Ah ha... didn't know there was an @archive_video command. Thanks!

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri May 05, 2017 5:15 pm

the built-in @archive_video is very helpful. Is there anything built-in that could automatically delete the oldest archived files to maintain X % disk space free?

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

Re: PiKrellCam: motion vector detect + OSD web interface

Fri May 05, 2017 7:07 pm

jbeale wrote:the built-in @archive_video is very helpful. Is there anything built-in that could automatically delete the oldest archived files to maintain X % disk space free?
No, but such a command does seem appropriate to have. I'll see about adding one.

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 14 guests