D-Link Forums

The Graveyard - Products No Longer Supported => IP Cameras => DCS-932L => Topic started by: sip06pp on December 25, 2014, 01:29:26 AM

Title: Restart DCS-932L using Curl/Wget/Http Command
Post by: sip06pp on December 25, 2014, 01:29:26 AM
Good day,

I have several DCS932L Cameras and sometimes they freeze randomly. Upon restart everything is fixed.
Can someone please tell me what command i should use to restart them ?

Can be anything, wget, curl or http command. Commands like this are used to connect and control using 3rd party software.
Example would be : http://192.168.1.100:80/cgi-bin/rtpd.cgi?reboot but no reboot command exists.

I searched the forum but no command like above to restart camera
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: RYAT3 on December 25, 2014, 06:18:12 AM
If your camera is unresponsive how is it going to respond to a http request?

Anyways, Dlink and others have power control switches.

http://www.cnet.com/products/d-link-wi-fi-smart-plug/

One of my dlink cameras has a power cycle function you can set for daily reboot. That's located in the firmware menus. I guess that only works if the camera is still responsive.

You might be trying to do too much with your camera that it's locking up? Or is it just defective?
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: sip06pp on December 26, 2014, 12:00:01 PM
Hi,

I plan to automate command to reboot at regular intervals to avoid this camera freeze. Not attempt to perform after camera freeze.

Does anybody know this remote command to reboot ?
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: sip06pp on December 30, 2014, 11:40:44 AM
Forum admins,

any ideas ?
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: JavaLawyer on December 30, 2014, 02:22:17 PM
The DCS-932L does not contain a "Reboot on a Schedule" function. Some users successfully use a house timer to force a scheduled power cycle.
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: paulanthony12 on July 22, 2015, 05:36:39 AM
I am trying to do exactly the same thing.  Searching around the internet I found the following command line for another d-link camera but unfortunately I can't get it to work on my DCS-932L.

wget –http-user=admin –http-password=YOUR-PASSWORD -O /dev/null –post-data=”Reset= Yes ” http://camera1/Reply.html

Did anyone get this working?  I plan to set up a scheduled task locally to run this command once every 24 hours to [hopefully] stop my cameras from being unresponsive.
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: meh on August 02, 2015, 02:41:44 PM
I am trying to do exactly the same thing.  Searching around the internet I found the following command line for another d-link camera but unfortunately I can't get it to work on my DCS-932L.

wget –http-user=admin –http-password=YOUR-PASSWORD -O /dev/null –post-data=”Reset= Yes ” http://camera1/Reply.html

Did anyone get this working?  I plan to set up a scheduled task locally to run this command once every 24 hours to [hopefully] stop my cameras from being unresponsive.

I find a healthy reboot around 1-2 weeks keep's them responding.  Otherwise as previous posters have said they just hard lock and a complete power cycle is required.

Linux with curl:

[command - ideally crontab]
curl --max-time 3 --connect-timeout 1 -u username:password -p -X POST http://IP_ADDRESS_HERE/setSystemReboot
[/command]


Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: meh on August 03, 2015, 12:45:05 PM
While I'm here too;

If your having trouble trying to find the correct url for any other camera models.  Then a quick and dirty way of finding the URL is simply enable developer mode in say firefox and take a look at the transaction as it happens while your browsing.  You should have no problem seeing any uri post to a given script/function.

If all else fails use wireshark and packet trace directly.


EDIT:

93x Range Model (Revision A Hardware)

Linux with curl:

[command - ideally crontab]
curl --max-time 3 --connect-timeout 1 -u username:password -p -X POST http://IP_ADDRESS_HERE/setSystemReboot
[/command]

93x Range Model (Revision B Hardware - new style firmware)

Linux with curl:

[command - ideally crontab]
curl --max-time 3 --connect-timeout 1 -u username:password http://IP_ADDRESS_HERE/www/setSystemReboot
[/command]


The above is called on the rootfs at "/etc_ro/web/"  but on the newer firmware revision B hardware;  "/etc_ro/web/setForm/setSystemreboot"
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: belnox on November 20, 2016, 06:17:35 PM
After some experimentation I've crafted the following command to reboot a camera from a command line using curl

curl --max-time 3 --connect-timeout 1 -p -X POST -H "Host: <IP>" -H "Referer: http://<IP>/file.htm" -H "Authorization: Basic <AuthCode>" --data "ReplySuccessPage=reboot.htm&ReplyErrorPage=reboot.htm&Reset=Reboot+the+Device" http://<IP>/setSystemReboot

Things to change:
<IP> - Multiple times in command, the IP (or hostname) for the Camera
<AuthCode> - I got this from the headers using the FireFox Debugger (F12)

Tested on:
DCS-930L FW v1.16
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: acellier on November 24, 2016, 05:33:02 PM
@belnox -
Please, how do you find the <AuthCode> using FireFox DeBugger?
I can't find that value. Which camera page in the browser? What does it look like?
with various guesses, all I get is
     <html><body><h1>The request is forbidden.</h1></body></html>
Thanks.
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: rjms on November 28, 2016, 09:21:46 AM
You might use the Firefox Network tool instead (Tools > Web Developer > Network), where the Headers will be displayed (select one of the GET line, e.g. the first)

Another way is to use the Firefox Console (Tools > Web Developer > Web Console)
Let's say your password is "1234abc"; then write and execute this in the console:

Code: [Select]
btoa("admin:1234abc")
That should give you the <AuthCode> (the example above gives "YWRtaW46MTIzNGFiYw==" which is just an encoded form of "admin:1234abc")

As for "The request is forbidden" message, this is from DLink developers that fudged the web UI (which is why belnox needed to include the Referer string in his example above, a spoofing that nullifies any pretension of security from DLink).
You can go to the home page of your camera, (http://YOUR_CAMERA_IP) from which you can access the other pages. The home page is sufficient to extract the AuthCode from the Headers (if you're not comfortable with the Console trick above).
Title: Re: Restart DCS-932L using Curl/Wget/Http Command
Post by: acellier on November 30, 2016, 01:53:24 PM
@rjms -
Thanks for that sample, I found it!
Mine was the same up through YWRtaW46, then different.
Finally realized that I needed to delete the "<" and ">" symbols. Then it worked from my Mac's Terminal.
You guys (mch, belnox, rjms) are truly awesome.