background image

_____________________________________________________________________________ 

  IP POWER                                                                                              PAGE 31 OF 32

 

 

out_retries=3 
in_udelay=100000 
in_retries=10 
 
port=$1 
outlets=$2 
cmd=$3 
tmpfile=/tmp/tmp.$$ 
 
if [[ -z "$port" ]] || [[ -z "$outlets" ]] || [[ -z "$cmd" ]]; then 
 

appname=`basename $0` 

 

echo "Usage: $appname <port> \"<outlet> [outlet..]\" on|off|status" 

 

exit 1 

fi 
 
function ipp_chat () { 
 

out=$1 

 

in=$2 

 
 

cat "$port" > $tmpfile & 

 

cat_pid=$! 

 

trap "rm $tmpfile; kill $cat_pid" EXIT 

 

 

 

for (( i=0; i < $out_retries; i++ )); do 

 

 

for (( j = 0 ; j < ${#out} ; j++ )); do 

 

 

 

usleep $out_udelay 

 

 

 

echo -n ${out:$j:1} > $port 

 

 

done 

 

 

echo > $port 

 

 

for (( j=0; j < $in_retries; j++ )); do 

 

 

 

usleep $in_udelay 

 

 

 

line=`grep "$in" "$tmpfile"` 

 

 

 

if [[ -n "$line" ]]; then 

 

 

 

 

break 2 

 

 

 

fi 

 

 

done 

 

done 

 
 

rm $tmpfile 

 

kill $cat_pid 

 
 

if [[ -n "$line" ]]; then 

 

 

echo $line 

 

else 

 

 

echo "Command failed (${out})" 

 

 

exit 1 

 

fi 


 
# Suppress error messages from the shell 
exec 2> /dev/null 
 
# Set up the serial port for the IP Power 

_____________________________________________________________________________ 

  IP POWER                                                                                              PAGE 32 OF 32

 

 

stty 
1400:4:cbe:a30:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:
0:0:0 < "$port" 
 
# Enable serial command mode 
ipp_chat "0\\ADEBUG9258\\Z" "IP9258 DEBUG ON" &> /dev/null 
 
# Get current status 
status_nibble=`ipp_chat "0\\Ap06\\Z" "p.*6:" | sed 's,.*p.*6:.\(.\).*,\1,g'` 
 

# Send the command, the least significant bit is port 1, the most significant 
# is port 4.  A value of 0 is on, 1 is off. 

outlet_mask=0 
for o in $outlets; do 
 

outlet_bit=$(( 1<< ${o}-1 )) 

 

outlet_mask=$(( outlet_mask | $outlet_bit )) 

done 
status_nibble=`printf %d 0x${status_nibble}` 
if [[ "$cmd" == "on" ]]; then 
 

echo "Powering on outlet $outlets" 

 

status_nibble=`printf %X $(( $status_nibble & ~${outlet_mask} ))` 

 

ipp_chat "0\\AP06F${status_nibble}\\Z" "P.*6=F${status_nibble}" &> 

/dev/null 
 

echo "Outlet $outlets powered on" 

elif [[ "$cmd" == "off" ]]; then 
 

echo "Powering off outlet $outlets" 

 

status_nibble=`printf %X $(( $status_nibble | ${outlet_mask} ))` 

 

ipp_chat "0\\AP06F${status_nibble}\\Z" "P.*6=F${status_nibble}" &> 

/dev/null 
 

echo "Outlet $outlets powered off" 

else  
 

for o in ${outlets}; do 

 

 

outlet_bit=$(( 1<< ${o}-1 )) 

 

 

echo -n "Outlet $o is " 

 

 

if [[ $(( $status_nibble & $outlet_bit )) -eq $outlet_bit ]]; then 

 

 

 

echo "off" 

 

 

else 

 

 

 

echo "on" 

 

 

fi 

 

done 

fi 

 
# Disable serial command mode 
ipp_chat "0\\ADEBUG0FF\\Z" "IP9258 DEBUG OFF" &> /dev/null 
 
exit 0

 

Summary of Contents for IP Power 9258

Page 1: ...5A current rating and use power OUT cables with 10A rating for each power outlet For the European Australian model IEC320 C13 220 250V outlets the individual max output current per outlet is 6A and th...

Page 2: ...ion Update details Feb 2007 1 1 Covers 1 38 firmware features July 2009 1 2 Added Telnet and SNMP firmware 1 5 2 and serial command line details firmware 1 5 3 WARNING Any changes to this equipment wi...

Page 3: ...OF 32 1 Introduction The IP power 9258 is a web browser controlled power switch that can be used easily for industrial or commercial power control With the remote network control technology a user co...

Page 4: ...20V use the 15A power cable Hardware installation Connect the IP Power to the hub using a Cat5 network cable for remote control you may then connect the hub or router to the Internet Connect the AC IN...

Page 5: ...s IP address to be on the same subnet as the IP Power by default 192 168 0 50 in Control Panel Network Connections Local Area Connection Properties Internet Protocol TCP IP Properties The default user...

Page 6: ...ol Using Browser To access the IP Power control web pages simply type the IP address of the IP Power into your web browser s address field _____________________________________________________________...

Page 7: ...ed IP address so that it is always known After changing the IP Power s IP address type the new address in the address field of your web browser You can also use the ipEdit exe tool to locate the IP Po...

Page 8: ...b pages Each receiver may be no more than 50 characters Subject The subject of the mail no more than 50 characters Mail Body Type the content of the mail here It must not be left blank _______________...

Page 9: ...onnected to the motherboard or the network port must be integrated into the motherboard After setting up the motherboard and network card use the WOL function by following two steps Go to Network Wake...

Page 10: ...nd menu Enter the IP address and port of the DynDNS server You can find this out on your PC by selecting Start Run then type in cmd and typing ping www dyndns com Enter the number in brackets e g 63 2...

Page 11: ...In the above example all outlets are off Example 2 The HTTP command http admin 12345678 192 168 0 50 Set cmd CMD SetPower P60 1 P61 0 P 62 0 P63 1 ____________________________________________________...

Page 12: ...mand syntax is case sensitive so be selective when using upper and lower case in command format The free tool wget is useful for sending these HTTP commands For example to send the command in Example...

Page 13: ...ans power OFF _____________________________________________________________________________ IP POWER PAGE 26 OF 32 Control outlet command snmpset v 1 c public 192 168 1 55 1 3 6 1 4 1 92 58 2 1 0 inte...

Page 14: ...for a full 5 seconds or until a sustained beep noise is heard this enables manual control mode which can be identified by the flashing outlet lights The outlet light that is not flashing is the one c...

Page 15: ...CONSOLE RS232 port to one of the console server serial ports for CM4001 2 this interconnection will use a standard UTP Cat 5 cable with a 319000 adapter at each end and all other console servers will...

Page 16: ...be a30 3 1c 7f 15 4 0 1 0 11 13 1a 0 12 f 17 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 port Enable serial command mode ipp_chat 0 ADEBUG9258 Z IP9258 DEBUG ON dev null Get current status status_nibble ipp_ch...

Reviews: