Get P2P qr code via Dahua API

kmax1940

Young grasshopper
Joined
Sep 27, 2016
Messages
42
Reaction score
3
Anyone know if you can grab the qr code for p2p via the Dahua http api?

I looked at a couple versions and I don't see it.

Anyone know a way to grab this qr code programmatically?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,676
Reaction score
14,024
Location
USA
No idea. If you can get the URL, string, or whatever the payload of the QR code is, then you could use a third party QR encoder library on that.
 

kmax1940

Young grasshopper
Joined
Sep 27, 2016
Messages
42
Reaction score
3
Its just the serial number.
I guess I also need to be able to enable and disable p2p via API as well... I dont see that in there either...
But I have no idea if I am using the newest version of the API... or how to even get it. :)
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,831
Reaction score
6,389
Just curious... Why would you want to do this? Can't think of any obvious reason.
 

kmax1940

Young grasshopper
Joined
Sep 27, 2016
Messages
42
Reaction score
3
@Mike A. to automate client camera subscription.
client logs in and sees the qr code to scan.

i wish dahua had better support of the api...
i dont know even if it is possible to enable / disable p2p via the api...
or to grab the qr code...
 

kmax1940

Young grasshopper
Joined
Sep 27, 2016
Messages
42
Reaction score
3

aledcsl

n3wb
Joined
Dec 8, 2021
Messages
6
Reaction score
1
Location
wales
Hi all,

I've used the api command above which does seem to disable P2P, but it dosent untick the 'enable' tick box, which dosent bother me but does make me wonder whether it is truly disabled

any thoughts on this!
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,831
Reaction score
6,389
You probably should wonder. I've seen different behavior for that with different Dahua cams/firmware. For at least one of mine, disabling the 'enable' box at the top does not stop the cam from attempting P2P connections. You have to untick P2P (and/or each of the other services below as desired) to stop the attempts to connect. On another cam unticking the enable box disables the services below. On another cam/firmware, it doesn't matter what you have ticked, it still tries to make a P2P connection or does other similar things (attempting to find Google's DNS) disregarding how you have things set.

I've not tested your case specifically leaving the enable box ticked with the service below unticked on whatever cam/firmware but if this is important, then I'd test it by watching the traffic using WireShark or other sniffer to see what it actually does.
 

aledcsl

n3wb
Joined
Dec 8, 2021
Messages
6
Reaction score
1
Location
wales
Update:

So the api command in the above post doesn't seem to disable P2P, it does stop you connecting remotely but the cameras are still hammering port 8800 on the firewall.
Unfortunately this is still the case if you untick P2P in the browser!
On both NVRs and some cameras P2P is disabled but still trying to route out via port 8800 around 50 times per second!!
I've had a customer complain that their firewall has been hit close to 5 million times over a 24 hour period!!
I know that's what the firewall is there for but it is worrying that this cant be disabled!
 
Top