• March 28, 2024, 02:17:25 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: DSP-W215 not open to any standards or even simple http request  (Read 9535 times)

serge.regina@wanadoo.fr

  • Level 1 Member
  • *
  • Posts: 1
DSP-W215 not open to any standards or even simple http request
« on: November 28, 2015, 06:12:39 PM »

I have been using DLINK wireless systems for years and have been very happy with them. So decided to start some home automation tasks using DSP-W215. What a disappointment. No support for any home standards, no way to read power consumption through a simple http request, etc etC.
This product, even if very good on the hardware side is a joke thanks to myDlink / cloud poor software. How can DLINK release such a thing and keep it so closed ???
When will DLINK support some basic queries which could make this thing useful ???
An previous exploit which made it usable has been killed by DLINK in its new firmware. What a pity. Pleas do something. Thanks.
S.R.
Logged

FurryNutz

  • Poweruser
  •   ▲
    ▲ ▲
  • *****
  • Posts: 49923
  • D-Link Global Forum Moderator
    • Router Troubleshooting
Re: DSP-W215 not open to any standards or even simple http request
« Reply #1 on: November 30, 2015, 07:56:15 AM »

These devices are designed to be simple to use and with little user intervention. I presume any advanced features were not added as most average home users just want to connect and have it work. If you desire more advanced features then you should contact D-Link support and ask them about this.
Logged
Cable: 1Gb/50Mb>NetGear CM1200>DIR-882>HP 24pt Gb Switch. COVR-1202/2202/3902,DIR-2660/80,3xDGL-4500s,DIR-LX1870,857,835,827,815,890L,880L,868L,836L,810L,685,657,3x655s,645,628,601,DNR-202L,DNS-345,DCS-933L,936L,960L and 8000LH.

pzelenka

  • Level 1 Member
  • *
  • Posts: 21
Re: DSP-W215 not open to any standards or even simple http request
« Reply #2 on: December 27, 2015, 05:06:29 AM »

I managed to read measured values using HNAP. If you are intrested I can provide more info.
Logged

Kryptokrates

  • Level 1 Member
  • *
  • Posts: 5
Re: DSP-W215 not open to any standards or even simple http request
« Reply #3 on: December 28, 2015, 02:16:21 AM »

I managed to read measured values using HNAP. If you are intrested I can provide more info.
I'd be interested in how to read these values too.
Logged

128keaton

  • Level 1 Member
  • *
  • Posts: 5
Re: DSP-W215 not open to any standards or even simple http request
« Reply #4 on: December 28, 2015, 05:49:31 PM »

There is a simple way, from what I know, to just grab it via python. I grabbed a large project off of the internet and skimmed it down to something simple. Make sure you have python. Make a new file. Paste these contents:
Code: [Select]
import sys
import urllib.parse
import urllib.request
import random

command = sys.argv[1]



postData = {'request': 'create_chklst'}
postData = urllib.parse.urlencode(postData).encode("ascii")

req = urllib.request.Request("http://{ip}/common/info.cgi?{rand}".format(ip='10.0.0.20', rand=str(random.random())), data=postData)
response = urllib.request.urlopen(req)
ret = response.read().decode("utf-8")
ret = ret.strip()
lines = ret.split("\n")
retVal = None

for line in lines:
if line.startswith("Meter Watt:"):
power = line.split()[-1]
if retVal:
raise ValueError("Two power readings in one response?")
try:
retVal = float(power)
except ValueError:
print("Error on string '%s'" % line)
print("Watts: %s" % retVal);

then run it via python3.
Logged

Kryptokrates

  • Level 1 Member
  • *
  • Posts: 5
Re: DSP-W215 not open to any standards or even simple http request
« Reply #5 on: December 29, 2015, 04:54:38 AM »

That code doesn't work with firmware version V2.20
It seems that info.cgi isn't available anymore.
Logged

Protons

  • Level 1 Member
  • *
  • Posts: 4
Re: DSP-W215 not open to any standards or even simple http request
« Reply #6 on: January 08, 2016, 05:49:47 AM »

That code doesn't work with firmware version V2.20
It seems that info.cgi isn't available anymore.

I just updated my firmware and only got to 1.13, how did you get 2.20?
It works on 1.13.

Code: [Select]
model=DSP-W215
product=mydlink Wi-Fi Smart Plug
brand=D-Link
version=1.13
build=03
macaddr=xx:xx:xx:xx:xx:xx
ipaddr=192.168.0.38
netmask=255.255.255.0
gateway=192.168.0.1
wireless=Yes
Logged

pzelenka

  • Level 1 Member
  • *
  • Posts: 21
Re: DSP-W215 not open to any standards or even simple http request
« Reply #7 on: January 08, 2016, 06:06:17 AM »

Maybe it depends on hardware version. Mine is B1
Logged

Protons

  • Level 1 Member
  • *
  • Posts: 4
Re: DSP-W215 not open to any standards or even simple http request
« Reply #8 on: January 08, 2016, 06:11:15 AM »

You're correct.

http://wrpd.dlink.com.tw/router/firmware/query.asp?model=DSP-W215_Ax_Default

Code: [Select]
<DSP-W215_Ax>
<Default>
<FW_Version>
<Major>01</Major>
<Minor>11</Minor>
<Date>2014-06-19</Date>
<Recommend/>
</FW_Version>
<Download_Site>
<Global>
<Firmware>
http://dlinkpp-s3.s3.amazonaws.com/DSP-W215/Ax/Default/0111/DSPW215A1_FW111b05.bin
</Firmware>
<Release_Note>
http://wrpd.dlink.com/router/firmware/GetReleaseNote.aspx?model=DSP-W215_Ax_Default_FW_0111
</Release_Note>
</Global>
</Download_Site>
</Default>
</DSP-W215_Ax>

http://dlinkpp-s3.s3.amazonaws.com/DSP-W215/Ax/Default/0111/DSPW215A1_FW111b05.bin

vs

http://wrpd.dlink.com.tw/router/firmware/query.asp?model=DSP-W215_Bx_Default
Code: [Select]
<DSP-W215_Bx>
<Default>
<FW_Version>
<Major>02</Major>
<Minor>01</Minor>
<Date>2014-10-13</Date>
<Recommend/>
</FW_Version>
<Download_Site>
<Global>
<Firmware>
http://dlinkpp-s3.s3.amazonaws.com/DSP-W215/Bx/Default/0201/DSP-W215B1_FW_201B02.bin
</Firmware>
<Release_Note>
http://wrpd.dlink.com/router/firmware/GetReleaseNote.aspx?model=DSP-W215_Bx_Default_FW_0201
</Release_Note>
</Global>
</Download_Site>
</Default>
</DSP-W215_Bx>

http://dlinkpp-s3.s3.amazonaws.com/DSP-W215/Bx/Default/0201/DSP-W215B1_FW_201B02.bin
Logged

tombevers

  • Level 1 Member
  • *
  • Posts: 4
Re: DSP-W215 not open to any standards or even simple http request
« Reply #9 on: January 13, 2016, 01:32:27 PM »

Hi,

I recently bought also a Dlink smartplug, DSP-W215.
It works fine with an app on the iPad.

I am interested to control the switch from my home automation system based on Beckhoff CX Controller. My goal is to control the switch with URL’s like:
http:///cgi-bin/relay.cgi?switchon
http:///cgi-bin/relay.cgi?switchoff
http:///cgi-bin/relay.cgi?toggle

The Beckhoff controller can execute these URL’s for example when a light switch is pushed. If this works, the smart plugs will be a cost-efficient extension of my existing hard-wired home automation system.

What do I have to do to achieve this functionality? Or even better: is this possibility already present in the device?

Any help, tips or advise are welcome!

Thanks!
Logged

garce

  • Guest
Re: DSP-W215 not open to any standards or even simple http request
« Reply #10 on: September 08, 2016, 05:09:58 PM »

There is a simple way, from what I know, to just grab it via python. I grabbed a large project off of the internet and skimmed it down to something simple. Make sure you have python. Make a new file. Paste these contents:
Code: [Select]
import sys
import urllib.parse
import urllib.request
import random

command = sys.argv[1]



postData = {'request': 'create_chklst'}
postData = urllib.parse.urlencode(postData).encode("ascii")

req = urllib.request.Request("http://{ip}/common/info.cgi?{rand}".format(ip='10.0.0.20', rand=str(random.random())), data=postData)
response = urllib.request.urlopen(req)
ret = response.read().decode("utf-8")
ret = ret.strip()
lines = ret.split("\n")
retVal = None

for line in lines:
if line.startswith("Meter Watt:"):
power = line.split()[-1]
if retVal:
raise ValueError("Two power readings in one response?")
try:
retVal = float(power)
except ValueError:
print("Error on string '%s'" % line)
print("Watts: %s" % retVal);

then run it via python3.

I wanted to mention that this script worked for me with DSP W215 HW ver A1 firmware 1.24. There is a new HW version B1, I am not sure if this would work with that HW version (I don't believe so since B1 requires a password on scripts to run). I can confirm that my A1 unit doesn't work with scripts for B1 HW version, so they dont see to be backward/forward compatible.
As far as making it run, I don't know python so I had to figure out a couple of things:
1. It needs a parameter when you invoke the script. I don't know whether the parameter is important but it won't run without it. So I run python.exe wattlog.py anytexthere
2. You need to update your smart plug ip address inside (rigth now there is an ip address like 10.x.x.x). I only changed it one place.
3. There is no need to enter the device pin code inside the script (kind of bad if you think about security)
4. (optional) You can call python script inside a DOS bat file if you want to cycle through it and maybe put the output inside a log.txt file. Alternatively, if you know python I am sure you can cycle inside the scrypt.
Logged