IPC-HFW5241E-Z12E keeps losing focus

alwaysoff

Getting the hang of it
Joined
Nov 26, 2018
Messages
85
Reaction score
65
Location
Australia
My IPC-HFW5241E-Z12E focus mode is set to Manual. However, every now and then (about 1-2 months maybe?) I would discover that it had gone out of focus and needed refocusing. I never could remember the exact value for the focus so I have to do a manual focus by parking a car where it's aimed and do the focusing.

1655467609688.png

Any ideas why this is happening? The camera is securely mounted (I believe), and nothing is bumping / touching it.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,438
Reaction score
47,563
Location
USA
Could be a few things.

Camera reboots in the middle of the night and reverts to daytime focus number (especially if you use the sunrise/sunset utility).

Daily movement of the lens can wear it out over time and requires a new number for focus.

Next time it happens, look in the camera log and see if it rebooted. If it did then you know why.

And write down the focus number so you know if it is sliding.
 

alwaysoff

Getting the hang of it
Joined
Nov 26, 2018
Messages
85
Reaction score
65
Location
Australia
Wait.... the focus settings are different for each profile (day / night)? Didn't know that!
I think I wrote down the focus settings, but alas I forgot where I kept it!
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,438
Reaction score
47,563
Location
USA
In some instances the color and infrared b/w focuses can be different. One of mine they are the same and the other is a 20 point difference.
 

alwaysoff

Getting the hang of it
Joined
Nov 26, 2018
Messages
85
Reaction score
65
Location
Australia
I don't think it's the case of day/night difference. Both the day and night are out of focus in my case. The camera isn't set to reboot but even so, it should keep its focus though right?

For now I'm just going to set the focus via dahua API / cgi every day, or even every hour. Does this not happen to other people?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,438
Reaction score
47,563
Location
USA
Just because it isn't set to reboot doesn't mean it doesn't happen. A failing SD card can cause a reboot as can a poe switch rebooting and then in startup the camera gets wonky on focus. Or your focus is sliding over time.

Some have the focus sliding issue and have set up an API to run every x minutes to ensure the focus doesn't sway.
 
Last edited:
Joined
Aug 8, 2018
Messages
7,386
Reaction score
25,889
Location
Spring, Texas
I have two of those cams for LPR. I use the Dahua Day/Night utility to place them into the proper profiles.

One cam does, rather infrequently, change focus. It generally happens when the cam reboots itself for what ever reason. It is a PITA when it happens, but I screen shot every one of the settings for day and night for both cams and keep those grabs for reference. It has also helped other folks to see what we use for settings.

The other cam has never done it. Have yet to hunt down why it happens.
 

alwaysoff

Getting the hang of it
Joined
Nov 26, 2018
Messages
85
Reaction score
65
Location
Australia
I've written code to reset the zoom and focus every hour. Note my zoom isn't drifting, only the focus.

The api to do it is documented in this doc latest Version of DAHUA HTTP API FOR IPC Documentation ??

http://{ip}/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus={focus}&zoom={zoom}
This can be done using however method you prefer, e.g. curl + cron. I personally use a rule in my openhab automation so it's all in the same spot as my other camera handling code.

Note the focus and zoom values are floating point values between 0 and 1. The easiest way to figure it out is by getting the current level from http://{ip}/cgi-bin/devVideoInput.cgi?action=getFocusStatus
 
Top