Dahua day/night switch utility - DahuaSunriseSunset

Discussion in 'Dahua' started by bp2008, Mar 29, 2017.

Share This Page

  1. PointLookout247

    PointLookout247 Young grasshopper

    Joined:
    Feb 12, 2018
    Messages:
    37
    Likes Received:
    20
    Location:
    USA
    where would you put the above linux code on the cam itself? you have to edit a file or setup a cron?
     
  2. patrocle

    patrocle Getting the hang of it

    Joined:
    Jun 5, 2015
    Messages:
    435
    Likes Received:
    54
    Location:
    California
  3. achalmersman

    achalmersman Getting the hang of it

    Joined:
    Jan 26, 2017
    Messages:
    161
    Likes Received:
    50
    Is there a way to make this continue checking focus and adjusting?

    Sent from my VS990 using Tapatalk
     
  4. RicRat2009

    RicRat2009 Getting the hang of it

    Joined:
    Jan 8, 2018
    Messages:
    112
    Likes Received:
    54
    Location:
    Tejas
    @bp2008
    Tried setting this up. Says service started successfully, but when simulating sunrise I get the following error.
    Any ideas?

    4/26/2018 1:02:01 AM TriggerSunriseActions
    4/26/2018 1:02:37 AM Exception thrown attempting web request (http://192.168.1.219:37777/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1): The operation has timed out
    Repeat 5x
    4/26/2018 1:07:01 AM Cancelled web request (http://192.168.1.219:37777/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0) due to the next event time being reached.
    4/26/2018 1:07:37 AM Exception thrown attempting web request (http://192.168.1.219:37777/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1): The operation has timed out
    Repeat 6x
     
  5. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    7,852
    Likes Received:
    4,568
    No, not unless they run Dahua firmware.

    It sends zoom and focus commands (which are in fact the same command) several times a few seconds apart, typically. I think autofocus commands only get sent once.

    The GUI is not necessary for the service to run. When you push Install Service, the service gets configured to start automatically when Windows boots up. You don't even need to log in to Windows.

    To what are you referring? I don't do anything that gets put on the cam itself.

    Try not having multiple panels from the GUI open at once. Configure, close the configuration panel, then view rise/set times. These panels aren't coded to monitor for changes and typically only load data when they open and save data when they close.

    Nope.

    That looks like the error you would get if you typed in the wrong address, port number, or protocol (http vs https). Try the URLs from the error message in a web browser on the same computer running the service.
     
    patrocle likes this.
  6. RicRat2009

    RicRat2009 Getting the hang of it

    Joined:
    Jan 8, 2018
    Messages:
    112
    Likes Received:
    54
    Location:
    Tejas
    That was it, had the wrong port. TCP port instead of http.
    Seems to be working correctly now.
    When simulating sunset, how long does it take to switch back to day mode?

    Edit: Worked great! Thanks a bunch BP!
     
    Last edited: Apr 26, 2018
  7. Jaxon

    Jaxon Getting the hang of it

    Joined:
    Aug 9, 2016
    Messages:
    55
    Likes Received:
    28


    Thanks for this service, works great! Forgive me if it's in the thread and I missed it, but can anyone point me to some decent day/night profile settings?
     
  8. RicRat2009

    RicRat2009 Getting the hang of it

    Joined:
    Jan 8, 2018
    Messages:
    112
    Likes Received:
    54
    Location:
    Tejas
    The best thing to do is experiment with your settings. I think everyone's will be slightly different due to environment and lighting conditions.
    I use Color mode both day and night, I have pretty good lighting and want to see what color vehicles are and what color clothing people have on.
    During the day I use WDR and WB on Auto, at night I use Backlight Correction and WB on Steetlamp.
     
  9. OnePunch

    OnePunch n3wb

    Joined:
    Mar 31, 2018
    Messages:
    15
    Likes Received:
    3
    Absolutely crazy this isnt a native feature of the Dahua experience. I mean REALLY? If this is their level of care for the end-user I gotta say this doesn't make me think they give a damn and I'll be skeptical of buying this from Dahua again.

    Thanks for the script, however. I'll have to try it out.
     
  10. fenderman

    fenderman Staff Member

    Joined:
    Mar 9, 2014
    Messages:
    28,371
    Likes Received:
    8,065
    they dont care about you, the dont sell direct and dont want to sell direct to end users like you.
    this is not an issue for most cams and most scenarios...you dont really have a choice, what will you do, go with hikvision? they dont care about you either...or spend 5-10x on axis/avigilon/hanwah...they have you by the balls.
     
  11. OnePunch

    OnePunch n3wb

    Joined:
    Mar 31, 2018
    Messages:
    15
    Likes Received:
    3
    I am having an issue with the backlight setting. This is not a problem with the app from @bp2008

    When profile = day then backlight = off When profile = night then backlight = on.

    However, when I switch profile from night to day, the camera does not de-activate the backlight. I have to switch profile to "normal" for that to happen. This effectively renders my backlight capability non-operative.

    Anyone know why this might be?
     
  12. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    7,852
    Likes Received:
    4,568
    It won't switch back until the next real sunrise event (or until you simulate sunrise).

    No idea about this. Sorry.
     
    Mike46052 and OnePunch like this.
  13. RicRat2009

    RicRat2009 Getting the hang of it

    Joined:
    Jan 8, 2018
    Messages:
    112
    Likes Received:
    54
    Location:
    Tejas
    Mine does, maybe a issue with your camera or settings.
     
  14. OnePunch

    OnePunch n3wb

    Joined:
    Mar 31, 2018
    Messages:
    15
    Likes Received:
    3
    @bp2008 would it be difficult to have the program instead switch to "normal" from "night" mode instead of "day" mode? For whatever reason that mode indeed deactivates the backlight while the day/night cycle has no effect on backlight (any kind of backlight).
     
  15. OnePunch

    OnePunch n3wb

    Joined:
    Mar 31, 2018
    Messages:
    15
    Likes Received:
    3
    Best I can do i use your app to toggle the "picture" settings: brightness and gamma, etc. The backlight gets set and does not turn off unless I switch to normal mode. Very frustrating ;(
     
  16. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    7,852
    Likes Received:
    4,568
    Here you go. Let me know if it works or not: bp2008/DahuaSunriseSunset
     
    OnePunch likes this.
  17. OnePunch

    OnePunch n3wb

    Joined:
    Mar 31, 2018
    Messages:
    15
    Likes Received:
    3
    Hey thanks so much for taking a sec to look. When I click "simulate sunrise/sunset", the app now hangs and I have to force-quit.

    I have tried configuring my camera with port 554 and 80.


    Code:
    5/6/2018 9:08:19 PM    DahuaSunriseSunset 1.3.0.0 Service Manager Startup
    5/6/2018 9:09:14 PM    TriggerSunsetActions
    5/6/2018 9:10:15 PM    Exception thrown attempting web request (https://192.168.1.108:80/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1): The underlying connection was closed: An unexpected error occurred on a send.
     
  18. OnePunch

    OnePunch n3wb

    Joined:
    Mar 31, 2018
    Messages:
    15
    Likes Received:
    3
    And I did stop/uninstall the 1.2 service before installing the new version, fwiw.
     
  19. OnePunch

    OnePunch n3wb

    Joined:
    Mar 31, 2018
    Messages:
    15
    Likes Received:
    3
    Oops, sorry. I think I know what I did. I entered in x.x.x.x:554 in the "Edit" field where it says host name and port number. Really all it needs is host name.

    Great success!!! Thanks!
     
  20. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    7,852
    Likes Received:
    4,568
    Your error message indicates you had it connecting to port 80 (plain http) but using the https protocol. Https servers normally listen on port 443.

    Of course I didn't notice the port problem until I had already googled the problem "The underlying connection was closed: An unexpected error occurred on a send." and published this minor update 1.3.1 in response: bp2008/DahuaSunriseSunset

    The 1.3.1 update is almost certainly meaningless since I doubt any Dahua camera actually requires the SSLv3 protocol for https.
     
    EMPIRETECANDY and OnePunch like this.