DS-2DE3304W-DE - use curl to change image settings

root

n3wb
Joined
May 8, 2016
Messages
10
Reaction score
2
I just picked up this PTZ camera and it's pretty decent. Firmware version 5.4.8. I use an IR flood light next to it and it works great seeing with the built in ir filter; but the auto day/night mode is twitchy and everynight it switches back and forth a dozen times randomly.

I have a few other HikVisions, I've always used curl to do things like control the day/night switchover settings (I usually change exposure/shutter time at least) with something like :
  1. change settings how i want on webpage
  2. (download file)
    Code:
    curl https://user:pass@camera_fqdn/image/channels/1 >filename.xml
  3. (upload file)
    Code:
    curl -T filename.xml https://user:pass@camera_fqdn/image/channels/1
And it works NP with all my other Hik's, just add the push commands to a cron job or HA system. However, with this DS-2DE3304W-DE camera it does not work. I can download the XML, view it, and it is correctly formatted with all the proper Image settings. However, when I go to upload/push the xml I get this response:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
<requestURL>/image/channels/1</requestURL>
<statusCode>3</statusCode>
<statusString>Device Error</statusString>
</ResponseStatus>
I've tried various URL's for a while and haven't found a way to upload the Image settings to this camera. I've tried to find some API documentation recent for Hiks (I assume it's a change in the newer firmwares), but I have yet to find it. I was able to find the API documentation for the PTZ controls and can now automate controlling it by doing something like :
Code:
curl -X PUT "https://user:pass@camera_fqdn/ISAPI/PTZCtrl/channels/1/presets/1/goto"
I also was able to upload a PTZControl xml file to /PTZCtrl/channels/1 . So I know there's still API's to control these cameras (and assumingly change settings), something has just changed from how it was done previously.

If anyone has any idea of other URL's I could use or knows where some HikVision API documentation highlighting this info, that would be most useful.

Thanks!
 

root

n3wb
Joined
May 8, 2016
Messages
10
Reaction score
2
So I figured out the URL to get and push the config xml for the newer firmwares. IDK how I didn't try this the the other night, must've been tired:
Code:
https://user:pass@camera/ISAPI/image/channels/1
was able to download a config xml, modify how i want, upload it back to the same url with curl -T and successfully change the camera settings.


If anyone is interested in the API documentation for more functionality:
http://oversea-download.hikvision.com/uploadfile/Leaflet/ISAPI/HIKVISION ISAPI_2.0-Image Service.pdf
http://www.hikvisioneurope.com/portal/portal/Integration and Development Materials/03--How to/How to integrate Hikvision PTZ function.pdf
 
Last edited:

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
Hi,

I'm interested to buy this model but ... is there a "TLS" option so I can have email alert ? because I bought a perfect working Hikvision mini PTZ but no firmware for "TLS" (just SSL) so I can view picture when I want but will not be informed if movement detected.
 

root

n3wb
Joined
May 8, 2016
Messages
10
Reaction score
2
Hi,

I'm interested to buy this model but ... is there a "TLS" option so I can have email alert ? because I bought a perfect working Hikvision mini PTZ but no firmware for "TLS" (just SSL) so I can view picture when I want but will not be informed if movement detected.
I assume you mean TLS encryption for email authentication. Yes, both my PTZ DS-DE3304W-DE running firmware 5.4.8, and all my bullets DS-2CD2142FWD-I w/ firmware v5.4.1 have an option for TLS to send an email via smtp. I tested this just now with a gmail account using TLS smtp and it sent no problem. Below is a screenshot from my DS-DE3304W-DE:

upload_2017-10-17_2-43-51.png

My (obscured) settings were :
upload_2017-10-17_2-49-44.png

I don't personally use it though. If you have cameras that don't support it and want to continue using those cameras there's plenty of software solutions that will do this. I use ZoneMinder on a VM to manage all my cameras/recording/notifying. I also used a Synology NAS in the past with good success.
 

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
Thanks a lot for your answer.
I'm using my camera just with a TP link router, no PC. This because I'm using solar power and want to have lowest consumption.
 

root

n3wb
Joined
May 8, 2016
Messages
10
Reaction score
2
Thanks a lot for your answer.
I'm using my camera just with a TP link router, no PC. This because I'm using solar power and want to have lowest consumption.
If power efficiency is you goal, I can tell you how much power the DS-2DE3304W-DE draws from my switch. At idle on my 1080p profile, non network streaming, it draws about 3200mW on average. If you engage the PTZ it draws between 4500-6500mW depending on which motors are engaged simultaneously. Keep in mind this camera doesn't have any IR light, so if you need night vision you'll either need another light source, or a separate IR illuminator (which works great with this device/filter).
 

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
Hi

No probem for this. I have 300W solar panels (may be I will add one more) with 2 axis solar tracker and 100Ah battery.
The only thing is that I also have a solar fridge (sometime 6A peak) but I don't think the camera system will do the difference (max power for 4G router and camera=less than 0.6Amp).
For others power consumption (light, laptop, pump...) it's when I'm here so no problem, camera will be used only to look when I'm far away (specially for weather).
 

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
Hi root

One question: I have installed the 3304 camera and it's works with my 4G router. I think it's a very good small outdoor camera for a low price.
But, with "Ivms4200-client" , is it possible to connect to camera on line (4G) ? this because I would like to set things like PTZ positions & limits.
Thanks for answer
 

root

n3wb
Joined
May 8, 2016
Messages
10
Reaction score
2
Hi root

One question: I have installed the 3304 camera and it's works with my 4G router. I think it's a very good small outdoor camera for a low price.
But, with "Ivms4200-client" , is it possible to connect to camera on line (4G) ? this because I would like to set things like PTZ positions & limits.
Thanks for answer
I wouldn't see why not, although streaming capability would depend on your 4G speed. I don't use iVMS since I run Linux, so I haven't tested this. I'd imagine the basic steps would be:
1) If you have a static external IP, find it. If not you may want to setup a DDNS service, either on the camera itself or on your router.
2) Setup a port forward on your router's configuration webpage, to go from the external net to the internal IP of your camera. You'll probably want to use the "Server Port" under Network settings on the camera. Port 8000 seems to be default. You may have to open additional ports for http(s) and rtsp, not sure what all iVMS requires.
3) In iVMS manually type the external IP or hostname/DDNS of your router.

If you need more detailed instruction there seems to be plenty of hits via google on external access for ivms.

If it were me, I'd be a bit concerned about security. These cameras specifically don't (yet) get their firmware published online (like on Hik's europe site), and my chat with their support the other day yielded they have no intention to because these are not supported in their region (even though it's listed on their website). So there will likely be no available firmware updates for these cameras. The problem is when security vulnerabilities do pop up you won't be able to patch the firmware. There was a major one earlier this year that basically would let anyone get unlimited access to the camera. There are also websites dedicated to all the cameras online that are using default/weak passwords and exposed externally like above.. So, if it were me, I'd use a router with something like DDWRT flashed on it, configure an Open VPN server and connect to that whenever you want to access the camera. There's a lot more ways to secure it, that's just one, it's up to you if you're concerned enough about the video feed to do so.
 

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
Thanks a lot. I will look how to connect IVMS ...
 

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
Oups ... today my camera stop working in the middle of the day and I don't know why... :(

Next time I will add my other (indoor) camera. Here I saw my TP link router always answer to ping so this is not a power problem (camera & router has the same power).
I hope it has not been robbed (usually there is nobody here). If so, that's mean camera has crashed and can't re-start.
 

root

n3wb
Joined
May 8, 2016
Messages
10
Reaction score
2
Oups ... today my camera stop working in the middle of the day and I don't know why... :(

Next time I will add my other (indoor) camera. Here I saw my TP link router always answer to ping so this is not a power problem (camera & router has the same power).
I hope it has not been robbed (usually there is nobody here). If so, that's mean camera has crashed and can't re-start.
I can say in the 6+ months I've had mine I haven't had any lock ups or need to reboot it. Maybe a power fluctuation from your inverter left in it in limbo somehow?
 

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
I works again today !
I will put a (own made) module to cut the main power for router & camera if needed.

I don't think it's a power fluctuation: power come from solar controller which has a 40Amp controled output and, also, my solar battery has less than 1 year old. Consumption, when I'm not here, is less than 1 amp (I shut down pump, light...).
Is there any option to restart camera if no communication ?

Some nice quality pictures a few minutes ago (question: can I increase picture resolution ?):






 
Last edited:

root

n3wb
Joined
May 8, 2016
Messages
10
Reaction score
2
I works again today !
I will put a (own made) module to cut the main power for router & camera if needed.

I don't think it's a power fluctuation: power come from solar controller which has a 40Amp controled output and, also, my solar battery has less than 1 year old. Consumption, when I'm not here, is less than 1 amp (I shut down pump, light...).
Is there any option to restart camera if no communication ?

Some nice quality pictures a few minutes ago:
There's no option in the camera firmware itself. You can get a cheap WiFi/Lan power switch. If you're using a DDWRT router or something you can write custom scripts on you can easily set it up trigger a reset if it stops responding to ping or a curl fetch or something. Or you can just actuate the switch manually (with whatever url/app the wifi switch uses) if you notice it's not responding. I don't have much experience with WiFi switches to suggest one, I use Z-Wave mainly. If you're comfortable/adventurous with Arduino tinkering you could definitely accomplish this as well.

It's definitely the best PTZ for the money, good quality photos.
 

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
It's OK for camera resolution, it was just a question.
I use STM32 (Arm) "C" langage. I think I will quickly add a simple module switch to cut off power during night and, after, I will re-use an "old" project with ethernet connection to add an IP adress to the router and do many things: for example I need to know lower temperature, rain (if rain come ... one day !!) , powering parts ...

Also I saw that when camera re-start, alarms came back (I disconnected them online because of too many alarms and google stop my account for 24h)
 
Last edited:

orphee

Young grasshopper
Joined
Jul 23, 2017
Messages
34
Reaction score
1
Update:

In fact I'm now sure router "freeze" sometime. When I arrived , I saw ethernet and 4G LED where not active.
I don't really know if camera do the same.

So I decided to add a own made module:

I look at theTP-Link router 4G LED. If LED is not on during 3 minutes, router and camera shut off for 15 seconds and re-start.
Same thing with ethernet camera connection: no connection during 15 seconds -> restart.
I just put two optocouplers to have the LED level on my module (I disconnected the corresponding router LEDs too because consumption & level risks).

This works perfectly ... but I just tested a few hours ;) from now. (of course I did some quick tests at the router & camera place too). I will see in a few days.

Now I have a question: I open ports but I'm unable to access to the camera or whatever.
This probably because I'm in 4G mode.
The problem is that, in final, I would like to add to my module the capability for some controls (watering, lights...) with an ethernet connection to the router.

Is there a low-cost solution for this ?
 
Top