Dahua Starlight Varifocal Bullet Z12 5.3-64mm (IPC-HFW5231E-Z12)

Did we ever find a way to fix the Zoom issue in BI with the Dahua 7x35 that was asked earlier in thread. Clicking the PTZ zoom controls in BI, either way, causes it to go max in that direction with no in between stops. I have tried the the Find/Inspect and Max travel time/motion delay, as well as the speed setting and none of these fixes the zoom issues. I have the latest firmware and the setup find is Make:Generic Model:RTSP H.264/H.265/MJPG/MPEG4 PTZ control: Preset Pos is at 5 now and speed 5, Network IP: ONVIF (OXML).
 
The script I posted is run on a computer running Ubuntu Linux. You may be able to do something similar in Powershell.

Im unfamiliar with scripting but have built a few Unbuntu boxes running the GUI. I did some googling and see Python, Shell and Bash scripts come up. If its not a hassle, any chance you would be willing to give just a few more details on what it takes to execute the script you are running to keep the Dahua cams focused the way you want them? Ive not found a way to keep the focus where I want it when using it for LPR. Ive tried the Dahua sunrise sunset service and its not working properly for me.
 
i successfully make a bash script (running in debian) to get sunrise/sunset and switch day/night mode.
I also make the set zoom/focus command but not yet tested
 
There are cameras that have apparently thought through this problem and do not change focus, at least not to the severe degree the Z-12 does.

I am running two legacy Axis cameras that work quite well for tag capture day/night at 120ft. A 1364 and a 1365 mkII
 
Thanks for posting this! It appears to be working great. The only issue is Im unclear if its repeating. My assumption is the 'sleep, 2000' stalls the loop for 30000 milliseconds(30 seconds?). but Im not getting an update on text file.

Figured I would post this in case it is helpful for anyone determining how often they need to refocus.(It turns out that my camera really does not loose focus very often.) You have to have AutoHotKey installed. Place the code in a text file with an .ahk extension. The code will check the current focus, compare it to your desired focus, and write to a log file whether the program needed to change the focus on the camera or if you were already in focus. I plan to run this every hour for a week and then I'll know when I typically loose focus and just run it during those times. You will need to modify the code to include your specific focus and zoom levels, mine are 0.778333 and 0.865225 respectively. You'll also need to enter your own IP and USERNAME and PASSWORD. (I'm not a programmer and so it's probably not the most elegant way to do it, but it works :) The Log file it creates will look like:
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Reset
Nov-15 11:01PM Focus Unchnaged
Nov-16 05:41AM Focus Unchanged

The AutoHotKey Code:

poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP/cgi-bin/devVideoInput.cgi?action=getFocusStatus
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Focus_Status.txt

}

Sleep, 2000

FormatTime, time, A_now, MMM-d hh:mmtt

FileReadLine, FocusRawData, LPR_Focus_Status.txt, 1
StringTrimLeft, CurrentFocus, FocusRawData, 13

ifEqual, CurrentFocus, 0.778333
{
FileAppend, %Time% Focus Unchanged `n, LPR_Focus_Log.txt
Exitapp
}
else {
poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP...tion=adjustFocus&focus=0.778333&zoom=0.865225
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Test_and_Set_Response.txt
FileAppend, %Time% Focus Reset `n, LPR_Focus_Log.txt

}
}
 
Figured I would post this in case it is helpful for anyone determining how often they need to refocus.(It turns out that my camera really does not loose focus very often.) You have to have AutoHotKey installed. Place the code in a text file with an .ahk extension. The code will check the current focus, compare it to your desired focus, and write to a log file whether the program needed to change the focus on the camera or if you were already in focus. I plan to run this every hour for a week and then I'll know when I typically loose focus and just run it during those times. You will need to modify the code to include your specific focus and zoom levels, mine are 0.778333 and 0.865225 respectively. You'll also need to enter your own IP and USERNAME and PASSWORD. (I'm not a programmer and so it's probably not the most elegant way to do it, but it works :) The Log file it creates will look like:
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Reset
Nov-15 11:01PM Focus Unchnaged
Nov-16 05:41AM Focus Unchanged

The AutoHotKey Code:

poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP/cgi-bin/devVideoInput.cgi?action=getFocusStatus
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Focus_Status.txt

}

Sleep, 2000

FormatTime, time, A_now, MMM-d hh:mmtt

FileReadLine, FocusRawData, LPR_Focus_Status.txt, 1
StringTrimLeft, CurrentFocus, FocusRawData, 13

ifEqual, CurrentFocus, 0.778333
{
FileAppend, %Time% Focus Unchanged `n, LPR_Focus_Log.txt
Exitapp
}
else {
poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP...tion=adjustFocus&focus=0.778333&zoom=0.865225
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Test_and_Set_Response.txt
FileAppend, %Time% Focus Reset `n, LPR_Focus_Log.txt

}
}

Thanks for this. I will attempt to fix my Z12 focus issue that happens randomly even in the middle of the day. So what string changes the frequency that this runs? And do you just compile a script and have it run as a scheduled task? Thanks, Andrew
 
I have some home automation software run this twice a day, which is the only time mine loses focus.
 
I use a computer running this script:

Code:
<?php
$login = 'user';
$password = 'pass';
$url = 'http://10.0.0.XX/cgi-bin/configManager.cgi?action=getConfig&name=VideoInMode';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$login:$password");
$result = curl_exec($ch);
curl_close($ch);
$line = strtok($result, "\n");
$dingo = rtrim($line);
$checkdigit = substr($dingo, -1);
if($checkdigit == 1) {
        $url1 = 'http://10.0.0.XX/cgi-bin/devVideoInput.cgi?action=getFocusStatus';
        $ch1 = curl_init();
        curl_setopt($ch1, CURLOPT_URL,$url1);
        curl_setopt($ch1, CURLOPT_RETURNTRANSFER,1);
        curl_setopt($ch1, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
        curl_setopt($ch1, CURLOPT_USERPWD, "$login:$password");
        $result1 = curl_exec($ch1);
        curl_close($ch1);
        $line1 = strtok($result1, "\n");
        $dingo1 = rtrim($line1);
        $pieces = explode("=",$dingo1);
        //echo "$pieces[1]\n";
        if($pieces[1] != "0.165000") {
                //echo "Adjusting focus!\n";
                exec("curl -s -u user:pass --digest -g \"http://10.0.0.XX/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.165&zoom=1\" > /dev/null");
        } else {
                //echo "Focus ok!\n";
        }
}
?>
Hi, I have this same issue. I have ran the link to gather the focus and zoom info. My results are....

status.Focus=0.522222
status.FocusMotorSteps=1800
status.Status=Normal
status.Zoom=0.948419
status.ZoomMotorSteps=1202

How/where do I enter those details into your script to set it every 5 minutes for example? I also have Linux running. Thanks!
 
I've been having the same focusing problems with this camera. I've had it up for about 4 months now. During the day it works pretty well as a LPR but at night it goes out of focus every night. I have day and night profiles that work respectively. It works ok at night at getting license plates until it goes out of focus. I emailed Andy a while ago about locking off the focus and he said he would look into it. he never got back to me....
This camera is basically worthless at using it as a LPR at night. Now during the day that is a different story.
 
I've been having the same focusing problems with this camera. I've had it up for about 4 months now. During the day it works pretty well as a LPR but at night it goes out of focus every night. I have day and night profiles that work respectively. It works ok at night at getting license plates until it goes out of focus. I emailed Andy a while ago about locking off the focus and he said he would look into it. he never got back to me....
This camera is basically worthless at using it as a LPR at night. Now during the day that is a different story.
Yea I'm still having this issue and still haven't found a perfect work around. If I could figure out a way to make Windows Task Schedule events that schedule in relation to sunrise/ sunset I would be in better shape. Or if the focus script was written so it had 2 profiles and changed based on sunrise / sunset. Unfortunately I'm not savvy enough to modify the script that extravagantly.

Currently I have 2 separate focus scripts being executed by 2 separate Windows Task Scheduler. The disadvantage is unless I stay on top of it (I dont this is a remote location with no internet) the sunrise / sunset changes so up to like 3 hrs of video is out of focus depending on season.

Knowing what I know now (I have 4 of these) I would NEVER recommend these for LPR. I don't think I would recommend the Z12 at all point blank period. Mine won't even stay in focus during the day without the focus script. I have 4 and only the one that is zoomed most of the way out exhibits this problem during the day. But I still wont buy another. It should work, and be usable for its entire engineered zoom range.

I have not contacted Andy since so many people have problem. It's a problem with the camera design and I'm not sure there is anything he can do.

Sent from my SM-G965U using Tapatalk
 
Two questions about this camera, I have the IPC-HFW5231E-Z12E but I think for all purposes it's the same as the Z12.

1) Can this camera record to a micro SD card and a NVR at the same time or do I have to pick one or the other?

2) Do you recommend upgrading the firmware?
 
Two questions about this camera, I have the IPC-HFW5231E-Z12E but I think for all purposes it's the same as the Z12.

1) Can this camera record to a micro SD card and a NVR at the same time or do I have to pick one or the other?

2) Do you recommend upgrading the firmware?
as with every camera it can record to sd card while simultaneously streaming to nvr.
if you have a reason to upgrade.
 
  • Like
Reactions: brightnight
as with every camera it can record to sd card while simultaneously streaming to nvr.
if you have a reason to upgrade.

Thank you, that clears a lot up for me! Do you know if the pre-record is saved to a buffer in the camera or if it's saved to the SD card and continuously writing over itself? I'm guessing it's not the SD card and that SD cards going bad in these cameras isn't really an issue. If the camera is programmed to only record when motion is detected, is it just a video saved to the card each time motion is detected? (no hassle or programs needed to get the videos off the micro SD card, I can just swap micro SD cards out of the camera and pop it into a computer to view all of the clips).
 
Thank you, that clears a lot up for me! Do you know if the pre-record is saved to a buffer in the camera or if it's saved to the SD card and continuously writing over itself? I'm guessing it's not the SD card and that SD cards going bad in these cameras isn't really an issue. If the camera is programmed to only record when motion is detected, is it just a video saved to the card each time motion is detected? (no hassle or programs needed to get the videos off the micro SD card, I can just swap micro SD cards out of the camera and pop it into a computer to view all of the clips).
1-saved to buffer
2-Only use good quality Sd cards such as the Samsung Evo Plus cards.
3-yes
4-Use the cams web interface to view and download off of Sd card, no card swapping required.
 
  • Like
Reactions: brightnight
1-saved to buffer
2-Only use good quality Sd cards such as the Samsung Evo Plus cards.
3-yes
4-Use the cams web interface to view and download off of Sd card, no card swapping required.


Awesome thank you so much! This is moving me forward in leaps and bounds. Last two questions:
1) When you say "good" card, what does that mean? Just class 10 of higher and not a fake? Like the SanDisk Ultras? Evo Plus aren't that much more.
https://www.amazon.com/SanDisk-128G...eway&sprefix=128gb,aps,270&sr=8-1-spons&psc=1

2) Will I get the same quality (full HD) when downloading videos from the web interface as if I just swapped a card?
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Awesome thank you so much! This is moving me forward in leaps and bounds. Last two questions:
1) When you say "good" card, what does that mean? Just class 10 of higher and not a fake? Like the SanDisk Ultras? Evo Plus aren't that much more.
https://www.amazon.com/SanDisk-128GB-microSDXC-Memory-Adapter/dp/B073JYC4XM/ref=sr_1_1_sspa?crid=2SMHU9VQ0Q8E2&keywords=128gb+micro+sd+card&qid=1553882586&s=gateway&sprefix=128gb,aps,270&sr=8-1-spons&psc=1

2) Will I get the same quality (full HD) when downloading videos from the web interface as if I just swapped a card?

1- by good, I mean they have a good rep here.

2-Yep.
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Is there a newer firmware available that fixes the focus issues? It seems apparent that some of these focus issues also crept into the newer 4mp models as well. Is anyone planning to do a comparison between this 2mp and new 4mp model?