Dahua - Controlling basic camera operations (via an API?) when camera has no dedicated IP

tankman

n3wb
Joined
Jan 14, 2023
Messages
24
Reaction score
6
Location
bc
Hi everyone,

I'd like to set preset PTZ commands using a script to a Dahua camera. I'm wondering if this is possible when the camera doesn't have a dedicated IP.

I know that SmartPSS can allow PTZ functions of the camera, so it is technically possible to access the camera when it is not on a fixed IP, but can we get creative and code commands to it?

Thanks
 

Mark_M

Getting comfortable
Joined
Jul 2, 2019
Messages
992
Reaction score
1,426
Location
Land down down under
Smart PSS and DMSS scan your network for a Dahua device. If the IP address changes, it scans again to find the device.


API format is like this:
Code:
http://192.168.1.108/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=CGI
Your script would need to find the camera's IP addresses through a network scan to communicate with it.

Why can you not set a static IP address of the camera?
Static address can be set in the camera's network interface or in your router's static DHCP pool.
 

tankman

n3wb
Joined
Jan 14, 2023
Messages
24
Reaction score
6
Location
bc
I should have clarified, I will be accessing the camera through the internet, so local network option not possible. Also. internet provider doesn't provide a static ip address for the internet connection that the camera is connected to.
 

Mark_M

Getting comfortable
Joined
Jul 2, 2019
Messages
992
Reaction score
1,426
Location
Land down down under
I should have clarified, I will be accessing the camera through the internet, so local network option not possible. Also. internet provider doesn't provide a static ip address for the internet connection that the camera is connected to.
This adds far more compilation.
Smart PSS and DMSS use P2P to connect to your camera remotely (over the internet). Aside from this being insecure, the way it connects mean you do not need a static IP address or port forwarding the device.

Options:
  • Portforward and use a DDNS service.
  • DDNS and VPN into the network that camera is on, makes your device using the API seem as if it's on the same local network.
A DDNS runs on a device (router or the camera, or something else) and tells the DDNS server what it's IP address is. So the DDNS server knows what the new IP address is when your internet provider changes it.
P2P does this DDNS service in the background.
DDNS is fairly easy to set in the camera. IPcamTalk forum has a DDNS service.

Port forwarding exposes the camera to forces of the internet that it's likely to be attacked. If you're lucky it might even be featured on insecam.org ;).

VPN running on your camera's router would be my suggestion. This makes it's own encrypted communication link from your remote device to the camera.
Your remote device needs to login to the VPN successfully before it can reach the camera's login or API.
This is not paying for a VPN service advertised online, this is making your own VPN connection.
 

tankman

n3wb
Joined
Jan 14, 2023
Messages
24
Reaction score
6
Location
bc
Thanks Mark for your wisdom. I'll need some time to digest your comments and become more educated. If you do consulting services, let me know.
 
Top