background image

7

. Controlling from PC software.

You can control the box from tour own PC-programs via http.
For this there are two “commands”, k0 and k1.

To read status

.

Send a http request for k0 to get current status.
The reply is 4 bytes:
Byte 1 Status of the output. “0” (0x30) means the output is off and “1” (0x31) that it is on.

If you have no rights to read then it is reported as off.

Byte 2 Tells if the output is currently doing a reset sequence. “1” for active reset and “0” else.
Byte 3 Tells if you have rights to read. “1” if you have rights and “0” for no rights.
Byte 4 Tells rights to write in the same way.

Example

:

By sending “GET/k0” via http we get the reply “1011” that means the output is on, reset is not active, we
have rights to read and we have rights to write.

Control

.

To change the box you send a http request for “k1abcd”. Where a,b,c,d are the parameters.

a

Byte for switch on.

One byte with “1” or “0”. ”1” means the output is switched on.

b

Byte for switch off.

One byte with “1” or “0”. ”1” means the output is switched off
Switch on has higher priority than switch off.
If both switch on and switch off is set the output will be on.

c

Byte for reset.

One byte with “1” or “0”. ”1” means the output shall do a reset sequence.

d

Byte to cancel

One byte with “1” or “0”. ”1” means the reset sequence shall be cancelled.

active reset.

Cancel have higher priority than reset.

Example

: By sending "

GET /k11001” via http:

The output is switched on.
The output id not switched off.
No reset is started.
Any running reset is cancelled.

An example in Perl

on how to use these function is on the demo CD Unix\switchbox801.pl.

The output there is switched only to show how to do it.
The code is only meant as an example.

The same thing may of course also be done in other program languages.

You have to change to the IP-address of your box to make the example work.
It is also possible to run the script on Windows with, for example, ActivePerl.

Summary of Contents for IP-SwitchPlug801

Page 1: ...tlet On the reset page reset htm there are in addition a button to make a temporary switching off for a specified time This time can be configured on the configuration page There it is also possible t...

Page 2: ...reset page reset htm has in addition to the ON OFF button also a reset button for the outlet in position ON When the output is in position ON there are a button for reset present When you click it the...

Page 3: ...ged in user The MAC address is also showed IP address and port number The IP address is written in common way with dots between You can also change port number if you want other port number than 80 fo...

Page 4: ...sent status is displayed with a grayed ON OFF button It is not possible to switch the output r w read write Present status is displayed with normal white ON OFF button The output can be switched RARP...

Page 5: ...IP address a second time by this method unless the box has been rest to default values See paragraph 8 Write ping 10 195 70 218 This IP address 10 195 70 218 is to be substituted to the desired addres...

Page 6: ...a Byte for switch on One byte with 1 or 0 1 means the output is switched on b Byte for switch off One byte with 1 or 0 1 means the output is switched off Switch on has higher priority than switch off...

Page 7: ...A thin item musts to be used for example a paper clip a Restore only the IP address 0 0 0 0 3 Switch off the power to the box Push and keep in the button Switch on the power to the box Release the but...

Page 8: ...ted to the desired address and The MAC address 00 50 c2 09 65 01 is to be substituted to the serial number on the back of the box 3 Write ping 10 195 70 218 This IP address 10 195 70 218 is to be subs...

Reviews: