Use a program of your choice like Java, PHP or Curl to make a packet request via HTTP protocol.
This request can also be done via modern web browser by typing in the target URL and entering
credentials in the pop up dialog.
Example
URL: 192.168.3.1/control.cgi?outlet=1&command=3
Use HTTP Script to Control Outlet and Get Status
Control Outlet:
Packet Request:
"GET" <target> "HTTP/1.1"CRLF
"Host:" <host ip>CRLF
"Keep-Alive: 300"CRLF
"Connection: keep-alive"CRLF
"Authorization: Basic" <auth>CRLFCRLF
;auth:encoded account(admin:1234) with base-64
Request Description:
Target: "control.cgi?<action>"
Action: outlet=<0/1/2>
0 means outlet all,
1 means outlet 1,
2 means outlet 2
command=<0/1/2/3/4/5>
0 means power off,
1 means power on,
2 means power switch(i.e. from On
→
Off, or from Off
→
On)
3 means power reset,
4 means UIS on,
5 means UIS off (/4/5 MNS only)
Example:
control.cgi?outlet=1&command=3(Outcome: outlet 1 reset)
Packet Response:
XML format:
"<?xml version='1.0'?>" "<request>"
"<outlet1_status>”{OUTLET1_STATUS}”</outlet1_status>”
"<outlet2_status>”{OUTLET2_STATUS}”</outlet2_status>”
"<uis_status>”{UIS_STATUS}”</uis_status>” "</request>"
XML Description:
OUTLET1_STATUS / OUTLET2_STATUS / UIS_STATUS: 0 means off, 1 means on