Dahua API with Arduino.

Mattias

Young grasshopper
Joined
Nov 1, 2015
Messages
35
Reaction score
8
Is there anyone here sending API commands to a Dahua camera from an Arduino?
I have an Arduino program that is working good with sending and receiving HTTP commands to Blue Iris.
I have now tried to modify it to work with the Dahua camera with no success, I think my main problem is to get the basic authentication to work.
I’ve read several post here about the Dahua API but I’m just too lousy programmer to get this to work with my Arduino.
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
Is there anyone here sending API commands to a Dahua camera from an Arduino?
I have an Arduino program that is working good with sending and receiving HTTP commands to Blue Iris.
I have now tried to modify it to work with the Dahua camera with no success, I think my main problem is to get the basic authentication to work.
I’ve read several post here about the Dahua API but I’m just too lousy programmer to get this to work with my Arduino.
There is a PDF of HTTP API commands for dahua, make sure you have the username and password username:password at the front, I'm on my phone so I can't paste an example but someone else might have one handy.
 

Mattias

Young grasshopper
Joined
Nov 1, 2015
Messages
35
Reaction score
8
Yes I do have that and I get everything to work when typing it in a web browser but unfortunatly its not the same when programming it to send similar commands from the Arduino.
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
Yes I do have that and I get everything to work when typing it in a web browser but unfortunatly its not the same when programming it to send similar commands from the Arduino.
I dunno what language you are using on the arduino, but I'd find an example of how to send any sort of http command from it and maybe test something that doesn't need authentication, if that works then your method for sending the commands is correct, but the language you are using may have a different way to do basic auth than just putting the username and password in the http command. what are you using?
 

Mattias

Young grasshopper
Joined
Nov 1, 2015
Messages
35
Reaction score
8
Arduino is an open-source platform used for building electronics projects. The programming language is similiar to C I think. I can send commands to Blue Iris and there the autentication is diffrent. This was a long shot posing this I don't think so many people use and Arduino for sending commands to a dahua camera.
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,421
Reaction score
3,655
Trying to do ethernet based stuff on an Arduino or other low power micro controller is a bit of a pain, especially if you want to implement security like tls. In my opinion you're better off with something like a Raspberry Pi.

I think Dahua switched to digest authentication which may be your problem.
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
Arduino is an open-source platform used for building electronics projects. The programming language is similiar to C I think. I can send commands to Blue Iris and there the autentication is diffrent. This was a long shot posing this I don't think so many people use and Arduino for sending commands to a dahua camera.
can you call curl or something? then you should just be able to do something like curl 'http://username:password@10.0.0.126/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0'

for switching day/night mode for instance.
 
Joined
Aug 3, 2015
Messages
3,820
Reaction score
12,272
Location
Charlotte
Trying to do ethernet based stuff on an Arduino or other low power micro controller is a bit of a pain, especially if you want to implement security like tls. In my opinion you're better off with something like a Raspberry Pi.

I think Dahua switched to digest authentication which may be your problem.
I agree. A Raspberry Pi running Raspbian Linux gives you a MUCH larger range of flexibility and power.
 

Mattias

Young grasshopper
Joined
Nov 1, 2015
Messages
35
Reaction score
8
Yes, Also I agree that the raspberry PI would be better. I even have one laying around. But I don't know how to make a program as easy as on the Arduino... (My alarm system is operating on the Arduino and working good) I don't have any software programming skills, so thats is the main problem, thats why I asked if anyone have done any http commands to a dahua camera from the Arduino, just so I could steal that code!
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
Yes, Also I agree that the raspberry PI would be better. I even have one laying around. But I don't know how to make a program as easy as on the Arduino... (My alarm system is operating on the Arduino and working good) I don't have any software programming skills, so thats is the main problem, thats why I asked if anyone have done any http commands to a dahua camera from the Arduino, just so I could steal that code!
You can't send this from arduino?

HTML:
http://10.0.0.124/admin?camera=CameraName&trigger&user=Username&pw=Password
 

Mattias

Young grasshopper
Joined
Nov 1, 2015
Messages
35
Reaction score
8
You can't send this from arduino?

HTML:
http://10.0.0.124/admin?camera=CameraName&trigger&user=Username&pw=Password
Yes that I can send, but this is for triggering Blue Iris... I have made a workaround now, I first trigger Blue Iris and then I trigger the camera from Blue Iris!
 

hmjgriffon

Known around here
Joined
Mar 30, 2014
Messages
3,386
Reaction score
979
Location
North Florida
Yes that I can send, but this is for triggering Blue Iris... I have made a workaround now, I first trigger Blue Iris and then I trigger the camera from Blue Iris!
sorry that's what I thought you were trying to do, you can send http api commands directly to the camera too.
 
Top