OpenIPC / firmware

Alternative IP Camera firmware from an open community
https://openipc.org
MIT License
1.2k stars 232 forks source link

Include sunwait to support day/night mode on cameras without LDR #852

Closed TimelessNL closed 1 year ago

TimelessNL commented 1 year ago

Some camera's like this model do not have the LDR installed. I'm currently looking for alternatives to control the Day/Night. And one thing that caught my attentions is using sunwait with cron in order to call the Majestic API endpoint to switch Day/Night. Luckily sunwait is in buildroot. Would it be possible to add sunwait to the lite image so camera's without LDR can have an alternative way of switching Day/Night mode?

cronyx commented 1 year ago

alternative auto day/night control for cameras based on the hisilicon or goke chips without light sensors

TimelessNL commented 1 year ago

That seems like a suitable solution indeed, I tried the script but there seems something odd. When I put my finger on the lens (simulating total darkness) the camera switches between day/night mode continuously.

log output:
again_led_off: 1024
again_led_on: 0
Light is still OFF. Nothing changed. Continue
....................
again_led_off: 1024
again_led_on: 1024
Light is still OFF. Nothing changed. Continue
....................
again_led_off: 32381
again_led_on: 1024
LIGHT IS ON
....................
again_led_off: 0
again_led_on: 1024
LIGHT IS OFF
....................
again_led_off: 32381
again_led_on: 1024
LIGHT IS ON
....................
again_led_off: 0
again_led_on: 1024
LIGHT IS OFF
....................
again_led_off: 6387
again_led_on: 1024
Light is still OFF. Nothing changed. Continue
....................
again_led_off: 32381
again_led_on: 1024
LIGHT IS ON
....................
again_led_off: 0
again_led_on: 1024
LIGHT IS OFF
....................
again_led_off: 1024
again_led_on: 1024
Light is still OFF. Nothing changed. Continue
....................

True putting my finger on the lens is not a real world scenario but I prefer not to have it continuously switch between day/night when the lens is blocked somehow.

TimelessNL commented 1 year ago

Ok after some try and error I got it to work properly. Would it be possible to have it included in the lite firmware?

flyrouter commented 1 year ago

This is an external script, depends on your settings, you must install it yourself. You are also welcome to send in your revisions for modernisation.

TimelessNL commented 1 year ago

Thanks, will do when I'm completely comfortable with the script.