Page 1 of 1

Auto log-in DAHUA camera's in Dashticz not working

Posted: Monday 09 March 2020 13:19
by dekoene
Hi,

I have 5 Dahua Camera's integrated in my Dash. They are working perfect and refresh the images every x seconds as defined.

Code: Select all

buttons.webcam = {width:12, isimage:true, forcerefresh:true, refreshimage: 3000, image: 'http://192.168.1.130/cgi-bin/snapshot.cgi?', url: 'http://192.168.1.130/cgi-bin/snapshot.cgi?'}
The only thing I have to do after each restart of dashticz is to manually log-in to the camera's one by one. I tried the auto-log-in via the snapshot URL as specified by Dahua but I can't get it to work. I tried following combo's but none of them is working:
  • cgi-bin/snapshot.cgi?chn=[CHANNEL]&u=[USERNAME]&p=[PASSWORD]
  • cgi-bin/snapshot.cgi?loginuse=[USERNAME]&loginpas=[PASSWORD]

Has anyone working this correctly? Is there an alternative?

Thanks,
Koen

Re: Auto log-in DAHUA camera's in Dashticz not working

Posted: Monday 09 March 2020 16:04
by Lokonli
Did you already test the URL directly in a browser?

Re: Auto log-in DAHUA camera's in Dashticz not working

Posted: Monday 09 March 2020 17:05
by dekoene
Yes - thats how I tested in the first place the different URL's.

The camera has an option for 'anonymous' login but enabling that option didn't change anything neither. I'm stuck with the pop-up login boxes.

Re: Auto log-in DAHUA camera's in Dashticz not working

Posted: Monday 09 March 2020 18:44
by clinkadink
Are you passing an unencoded password in the URL? Browsers are clamping down on this. You could try encoding your password and passing that instead. Link below is what I use for my cameras.

https://www.base64encode.org/

Re: Auto log-in DAHUA camera's in Dashticz not working

Posted: Tuesday 10 March 2020 9:30
by dekoene
clinkadink wrote: Monday 09 March 2020 18:44 Are you passing an unencoded password in the URL? Browsers are clamping down on this. You could try encoding your password and passing that instead. Link below is what I use for my cameras.

https://www.base64encode.org/
Thanks for this info. Indeed, I noticed after some more testing that Firefox accepts this way of working (unencoded password) and displayed correctly the camera image. Chrome and Fully Kiosk don't accept it.

How can I integrate the base 64 encode in dashticz?

Thanks,
Koen

Re: Auto log-in DAHUA camera's in Dashticz not working

Posted: Tuesday 10 March 2020 9:48
by clinkadink
I just add my encoded password as the url's password parameter, instead of the unencoded one.

Re: Auto log-in DAHUA camera's in Dashticz not working

Posted: Tuesday 10 March 2020 11:33
by dekoene
clinkadink wrote: Tuesday 10 March 2020 9:48 I just add my encoded password as the url's password parameter, instead of the unencoded one.

Ok thanks - I'll give it a try later today!