Page 2 of 2
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sun Jun 26, 2011 5:14 pm
by juricac
@bb99 thanks for info will do once i completely finish!
@pacolm thanks bro i found it and it works great. its just one small thing im missing, is there a way that i can schedule that zm automatically press presets 1 during night hours and for instance at 7am press presets 3 to switch back to outdoor mode?
is that can be done via run state? im asking because i dont understand run state as of yet.
thanks alot!
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sun Jun 26, 2011 5:25 pm
by PacoLM
I will use a cron job and a script to change the mode. I never did it, as I changed the cameras.
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sun Jun 26, 2011 11:13 pm
by juricac
@pacolm nice bro, are you able to post the script for changing the modes with cron please?
also i forgot to ask from where did you get all parameters about foscam that you were able to add camera modes?
Im wondering is it also possible to add changing contrast and brightness inside the script?
thanks alot bro!
EDIT: ive managed to get everything working including to specify all contrast/brightness while scheduling between modes via crontab
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Mon Jun 27, 2011 5:28 pm
by juricac
oh i forgot to ask, is there a way for instance that zm detects alone when is night and day, and once it detects day or night that i instruct it to execute specific script?
that way i would avoid crontab to execute specifc script at specific time.
thanks guys!
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Tue Jun 28, 2011 7:13 pm
by PacoLM
it will be a good feature to implement in ZM, but I do not think that you could do it right now. About the states/cron jobs, there are a lot of posts in the forum.
Good luck!
PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Wed Jun 29, 2011 9:47 am
by juricac
@PacoLM ive done everything thanks to ipcam foscam sdk, and some scripting, to get sunrise/sunset from the web and cronjob to its time with at and so far it works.
The only thing left so far is since i have camera setup outside, when its windy i get a lot of shadow when moving trees, im wondering how to solve that problem? it gives me alot false alarms. should i specify almost everywhere inclusive and only small areas active zones? what do you suggest?
Also sometimes when i change camera mode its actually change the values just like i want but the picture dosent change, so i need to change camera mode again and put it back and then works.
im wondering if you ever expirienced something like this?
Only one time i expirienced blinking area when i changed the camera mode from night to day, im wondering why that occured maybe you know?
thanks alot
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jun 30, 2011 7:19 am
by PacoLM
@PacoLM ive done everything thanks to ipcam foscam sdk, and some scripting, to get sunrise/sunset from the web and cronjob to its time with at and so far it works.
It will be nice if you share your findings with the forum in the ZM wiki.
The only thing left so far is since i have camera setup outside, when its windy i get a lot of shadow when moving trees, im wondering how to solve that problem? it gives me alot false alarms. should i specify almost everywhere inclusive and only small areas active zones? what do you suggest?
My setup has also the same 'problem', windy and cloudy days are the source of lots of alarms, I tuned as much as I could playing with the zones sensitivity & settings, but still have some false alarms.
Also sometimes when i change camera mode its actually change the values just like i want but the picture dosent change, so i need to change camera mode again and put it back and then works.
im wondering if you ever expirienced something like this?
Only one time i expirienced blinking area when i changed the camera mode from night to day, im wondering why that occured maybe you know?
I think that changing the camera mode switches something in the camera that produces that the CCD gain/sensitivity is messed during some seconds until some auto adjust occurs. I think it's normal in all the low cost cameras, at least in the 4 different cameras I have.
Regards,
PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Fri Jul 08, 2011 11:52 am
by dayton
Hi I got into this thread hoping to resolve my own email alert issues, but after trying all steps in this and about every other email related thread I could find, I'm still not having any luck.
I'm using ssmtp to relay off to gmail. Relay through gmail is working when I test it from the cli.
email options are currently set as
OPT_EMAIL___________checked
EMAIL_ADDRESS______me@gmail
NEW_MAIL_MODULES__currently checked
EMAIL_HOST__________localhost
FROM_EMAIL__________me@gmail
My filter is set to
Frames > 1
email details of matches checked
zmfilter.pl changed both lines according to this thread. (AuthUser=>'me@gmail', AuthPass=>'gmailpw' )
Here is the output of log files when an alarm is triggered.
==> /tmp/zmfilter.log <==
07/08/2011 06:37:58.742448 zmfilter[10298].INF [Creating notification email]
==> syslog <==
Jul 8 06:37:58 ubuntu zmfilter[10298]: INF [Creating notification email]
==> /tmp/zmfilter.log <==
07/08/2011 06:37:58.743278 zmfilter[10298].INF [Sending notification email 'ZoneMinder: Alarm - panasonic-81 (19 - 12 64)']
==> syslog <==
Jul 8 06:37:58 ubuntu zmfilter[10298]: INF [Sending notification email 'ZoneMinder: Alarm - panasonic-81 (19 - 12 64)']
==> /tmp/zmfilter.log <==
07/08/2011 06:37:58.860776 zmfilter[10298].INF [Creating notification message]
==> syslog <==
Jul 8 06:37:58 ubuntu zmfilter[10298]: INF [Creating notification message]
==> /tmp/zmfilter.log <==
07/08/2011 06:37:58.861312 zmfilter[10298].INF [Sending notification message 'ZoneMinder: Alarm - panasonic-81']
==> syslog <==
Jul 8 06:37:58 ubuntu zmfilter[10298]: INF [Sending notification message 'ZoneMinder: Alarm - panasonic-81']
Jul 8 06:38:04 ubuntu zmc_m1[11011]: INF [panasonic: 9000 - Capturing at 15.15 fps]
Here is syslog when I test email from cli
Jul 8 06:47:33 ubuntu sSMTP[11234]: Creating SSL connection to host
Jul 8 06:47:33 ubuntu sSMTP[11234]: SSL connection using RSA_ARCFOUR_SHA1
Jul 8 06:47:36 ubuntu sSMTP[11234]: Sent mail for me@gmail (221 2.0.0 closing connection s2sm6019830ibe.18) uid=1000 username=me outbytes=413
I'm probably overlooking something simple. Any help is appreciated.
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Fri Jul 08, 2011 6:46 pm
by PacoLM
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sun Jul 10, 2011 9:08 am
by juricac
It will be nice if you share your findings with the forum in the ZM wiki.
@PacoLm hey bro, sorry for long delay im still on vacations. When i get home i will post the script. Basically its very simple and has nothing to do with ZM. All what ive done is ive created script that capture infos for my location from gaisma, and execute day/night scripts based on dusk/dawn, with help of sdk and with smaller tweak about double change 50hz mode to outdoor for day and viceversa for the night, switching mode works just perfectly.
Do you suggest to share in zm wiki even it has nothing to do with it?
Thanks
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Sun Jul 10, 2011 9:54 am
by juricac
@dayton im not at home so i cannot post you now how ive done it, but simply
what ive done created 1 email at gmx so i dont need to setup tls setuped relayhost smtp based on it
created two zoneminder local accounts named zoneminder1 and zoneminder2 where postfix is installed with sql+sasl support, tested with mailx so i make sure that email from local account to gmail works, and masking email works otherwise gmail wont accept it.
once that step works ive setuped that zoneminder2 account mail gets forwarded to gmail
and test manually that forwarding works.with mailx by sending mail from local account to zoneminder2 once that works and you get email forwarded to your gmail, make sure you setup a filter email so you get emails based on.
and in email i have setup:
OPT_EMAIL___________checked
EMAIL_ADDRESS______zoneminder2@localhost.localdomain
NEW_MAIL_MODULES__unchecked
EMAIL_HOST__________localhost
FROM_EMAIL__________zoneminder1@localhost.localdomain
change zmfilter 2 lines accordingly based on local account. and restart zm
this setup works for me, of course others may work too but i didnt play with it too much, maybe paco could come with some suggestions.
hope it helps
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Thu Jul 28, 2011 1:10 am
by dayton
Thanks for the help. I got it to work by switching to postfix.
Re: Email alerts are not delivered zm 1.24.2 problem
Posted: Mon Aug 01, 2011 2:19 pm
by juricac
Im back home.
ill posts script that i created that automatically change to outdoor/50hz depends on dawn/dusk each day that gets infos for each day from gaisma for FOSCAM FI8918W.
Code: Select all
#!/bin/bash
#Define link
URL="http://www.gaisma.com/en/location/berlin.html"
TMPFILE1="/home/juricac/gaisma/tmp1.txt"
TMPFILE2="/home/juricac/gaisma/tmp2.txt"
TEMPHTMLNAME="/home/juricac/gaisma/temp.html"
LINK=$(wget -qO $TEMPHTMLNAME $URL)
TMP=$(sed -n '257,268p;268q' $TEMPHTMLNAME > $TMPFILE1|awk '(NR==3){print $2}' $TMPFILE1|awk -vRS="</i>" '/<i>/{gsub(/.*<i>/,"");print}' $TMPFILE1 > $TMPFILE2)
SUNRISE=$(head -1 $TMPFILE2)
SUNSET=$(awk 'NR==2' $TMPFILE2)
DAWN=$(awk 'NR==3' $TMPFILE2)
DUSK=$(awk 'NR==4' $TMPFILE2)
DAYSCRIPT="/home/juricac/gaisma/day.sh"
NIGHTSCRIPT="/home/juricac/gaisma/night.sh"
echo "Sunrise: $SUNRISE"
echo "Sunset: $SUNSET"
echo "Dawn: $DAWN"
echo "Dusk: $DUSK"
#Run scripts at specific time
at -f $DAYSCRIPT $DAWN
at -f $NIGHTSCRIPT $DUSK
#Remove temp files
rm -rf $TMPFILE1 $TMPFILE2 $TEMPHTMLNAME
i saved it as gaisma.sh make this file executable.
change URL directive depending on your location in gaisma, this URL points to Berlin, Germany Location.
you can change at commands to run at $SUNRISE, $SUNSET if you wish
DAYSCRIPT saved as day.sh executable
Code: Select all
#!/bin/bash
#Values such as value=208 under brightness and contrast you can change if it dosent work
#good under your environment, also change value user and pwd, as well as URL of your
#camera depending on your setup.
# Going to outdoor
wget -O - http://192.168.0.75:80/camera_control.cgi?param=3\&value=2\&user=admin\&pwd=yourpassword
# Wait 10 seconds
sleep 10
# Adding brightness
wget -O - http://192.168.0.75:80/camera_control.cgi?param=1\&value=208\&user=admin\&pwd=yourpassword
# Wait 10 seconds
sleep 10
# Adding contrast
wget -O - http://192.168.0.75:80/camera_control.cgi?param=2\&value=3\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera.
sleep 10
#GOING BACK TO 50hZ again to fix camera colors
wget -O - http://192.168.0.75:80/camera_control.cgi?param=3\&value=0\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera.
sleep 10
# Going back to outdoor again!
wget -O - http://192.168.0.75:80/camera_control.cgi?param=3\&value=2\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera.
sleep 10
#Turning off IR
wget -O - http://192.168.0.75:80/decoder_control.cgi?command=94\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera.
sleep 10
NIGHTSCRIPT saved as night.sh executable
Code: Select all
#!/bin/bash
#Parameters such as param=3, value=239 for brightness and contrast,you can change if its no#t looking good under your environment, user and pwd change acc#ordingly on each line as
#well as URL of your camera.
# Going to 50hZ
wget -O - http://192.168.0.75:80/camera_control.cgi?param=3\&value=0\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera
sleep 10
# Adding brightness
wget -O - http://192.168.0.75:80/camera_control.cgi?param=1\&value=239\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera
sleep 10
# Adding contrast
wget -O - http://192.168.0.75:80/camera_control.cgi?param=2\&value=5\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera
sleep 10
# reset mode camera needs to go to outdoor mode again to fix camera colors
# Going back to outdoor
wget -O - http://192.168.0.75:80/camera_control.cgi?param=3\&value=2\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera.
sleep 10
#Going back to 50hZ, now camera colors are fixed
wget -O - http://192.168.0.75:80/camera_control.cgi?param=3\&value=0\&user=admin\&pwd=yourpassword
# Wait 10 seconds for camera
sleep 10
#Turning on IR
wget -O - http://192.168.0.75:80/decoder_control.cgi?command=95\&user=admin\&pwd=yourpassword
#Wait 10 seconds for camera.
sleep 10
as root i added in crontab the line
Code: Select all
10 03 * * * /home/juricac/gaisma.sh
to execute the script every day at 03:10am
hope it helps
to see cgi codes for the camera and change the script if you want look at:
http://corz.org/windows/software/oodlec ... arget_1489