TweetFollow Us on Twitter

PowerKey Pro 600

Volume Number: 13 (1997)
Issue Number: 12
Column Tag: Tools of the Trade

PowerKey Pro 600

by Christopher Hall

This is not your father's powerstrip... A look at the latest in computer automation technology

Figure 1. Sophisticated Cicuits' PowerKey Pro 600.

That Special Morn

It's a special holiday morning and gift wrapping is flurrying as the gadgets and gizmos are ripped open by eager hands. As the children shriek over their eMates and the adults wince at their credit card bills, what should an intrepid Mac System Administrator find as his gift but... a power strip?

"They couldn't get me a tie or cummerbund or something else I don't need? My gift's another power strip?" our heroic Mac loyalist laments ungratefully. With a brave eye, he slowly opens the elegant biodigradable cardboard box to look at Sophisticated Circuits' newest toy, the PowerKey Pro Model 600.

Rummaging thru the box's contents, our Holiday Geek wonders, "Why would a power strip have such a strange ADB cable? And two RJ-11 phone jacks? And software?" Rushing to his Mac, he excitedly installs the software, shuts down, and moves all of his power cords from his brain-dead power strip to the suddenly fascinating PowerKey.

Perhaps this happy scenario will be repeated for many users this year, because the PowerKey Pro 600 is one of the most useful geegaws a Macintosh-using Inspector Gadget could receive. Under the mild-mannered guise of a handsome power strip, the PK Pro 600 hides a powerhouse power controller with all the smarts needed to control its six outlets from your Macintosh by keystroke, schedule, telephone or AppleScript.

What Can It Do - The Basics

As an intelligent power strip, the PowerKey Pro 600 can do simple and useful tasks; even merely starting up the Mac can be enhanced. Older Macs which lack "soft" power (that is, keyboard power on, such as a Power Mac 6100 series lacks), can now enjoy that convenience. Furthermore, if a system has many peripherals to be started up before the CPU (such as hard disks with a lengthy spin up), setting the CPU's outlet with a delay allows true one-touch startup.

Starting up or shutting down on a schedule, as well as saving energy by powering down an idle Mac's monitor, is also easy with the PowerKey's very well-designed software.

Setup and Use

Setting up the PowerKey is a breeze. The hardware requires nary a moment of thought to properly hook ADB, the phone and the power cords together, while the software requires little more than a reboot and some preference setting. Sophisticated Circuits has wisely given a switch for each outlet, the ability to disable the switches and, for the careless scripter who PowerKey's his Mac into not being able to boot, a simple hardware override.

Figure 2. Hardware Setup of the PowerKey Pro.

The PowerKey Editor is the interface to the PowerKey Extension, the background-only application that does the real work. A simple Schedule window shows all the events created for a given PowerKey. Considering that multiple PowerKey Pros can be daisychained over ADB, this control is appreciated for complex power control needs, such as an array of web servers.

Figure 3. The PowerKey Schedule.

Controlling your system by events is quite easy. A PowerKey event consists of a trigger, which can be modified by qualifiers and actions. For example: At 9AM on Mon, Tue, Wed, Thu and Fri, not between Wed, Oct 1, 1997 and Tue, Oct 7, 1997: start up the computer. In other words, it's easy to set up your Mac to boot every weekday, but the week you're away in the Virgin Islands.

Figure 4. The Event Editor.

It is just as easy to create events that toggle any device's outlet, such as your modem or printer.

Event Triggers

The PowerKey has two general types of triggers: time triggers and system triggers. Time triggers are used to create automatic or repeating events while the system triggers actuate on certain types of computer or phone line activity.

Time triggers include: Once Only, Repeating, Days of Week, Day of Month.

System triggers include: "Power On" Key Pressed When Phone rings, Phone Tones Heard, When Hot Key Pressed, When system is Idle, When Power Returns, At Shut Down, When System Crashes, and When Timer Expires.

Figure 5. Triggers.

Event Qualifiers

Qualifiers refine how and when a trigger activates; all of a trigger's qualifiers must be true for the trigger to fire. For example, a When Phone Rings trigger could have qualifiers that allow it to work only after business hours and on weekends. Qualifiers vary depending on the type of trigger, but include: Time Range, Date Range, Days of Week, System Idle, How Started, and System Running.

Event Actions

The PowerKey has a very useful range of actions. In addition to the expected Switch Outlets, Start Up Computer, Shut Down Computer, and Restart, the PowerKey supports Execute Script, Execute QuicKey, Type a Keystroke, Wait, Open File, Quit Application, Mount SCSI Devices, Answer Phone, Add to Log and External Actions.

As an event is constructed, a natural language representation is crafted in the Event Editor Dialog, making the PowerKey one of the simplest-to-use scripting tools available.

Figure 6. Actions Types.

The Not-So-Basics

Remote Control

If that were all the PowerKey could do, it would be useful, but the PowerKey is designed to really shine as true remote control for your system's power. Listening in on the phone line, a PowerKey Pro can do any event based on the phone ringing any number of times, hearing certain touch-tones (DTMF) for security codes, or even distinctive-ring patterns. It was tremendously useful to teach my PowerKey to boot my Mac in any number of different startup configurations. Because an AppleScript (or QuicKey or Frontier script) can be part of an event, altering what software was active at reboot is relatively simple. With a phone call on a distinctive ring (short - long - short) and the entry of a code, my personal Mac can reboot for Apple Remote Access, fax reception, or a quickie web server with never a conflict over which application deserves the serial port. When it's been idle for 20 minutes, the System reboots to the preferred working configuration. As an added bonus, if the Mac was started up or rebooted over the phone, the monitor doesn't need to be powered up, so a nickel's worth of energy is saved.

The only minus with the telephone control is that the PowerKey doesn't understand ISDN lines or PBXes, but that is a small issue; having a dedicated line for computer control can be wise for a mission critical server.

Server Control

No Mac OS server should be without a PowerKey. (Apple, are you listening?) The Server Restart Option, a standard feature of the PK Pro 600 (and an option on the PK Pro 200) is a System Administrator's dream. When a server hangs, the When System Crashes trigger can be set up to restart and make life good again; when the utility company decides to take control of your server's life blood, the When Power Returns trigger can also reset whatever's needed. Many a dollar and much SysAdmin sleep can be saved by this automation. When combined with the secure telephone control of your server, a SysAdmin might actually be able to never touch the server physically except to replace hardware.

Mac-less operation

A Macintosh is needed to program the PowerKeyPro, but a useful feature is that a unit's scheduled events can be programmed at a Macintosh and then placed anywhere. Any Outlet switching action triggered on scheduling or telephone interaction is fully usable.

The User Timer

The PowerKey "pings" the Mac every 10 seconds to determine if the Mac is running; it if fails, the When System Crashes trigger can be fired. Conversely, a mission critical application that must be up and running 24/7, such as a webserver or database, can set the PowerKey User Timer to count down to a restart. As long as the User Timer is reset by the application, the PowerKey serves up power. If the app crashes and cannot reset the User Timer, the PowerKey can restart the Mac and a script or startup alias can have the mission critical application back without a System Administrator's action. Bravo, Sophisticated Circuits. Not only does every Mac OS server need a PowerKey, but every Mac-based info kiosk. (This feature can be implemented without AppleScript by sending an Apple event using Event Class 'PKPr' and Event ID 'Tick'.)

Custom Actions

If the actions the PowerKey Editor offers aren't quite enough, you can write your own External Action. External Actions are nothing more that HyperCard XCMDs. To make the External Action available to the PowerKey software, the compiled XCMD must be placed in a file of type/creator: Xtrn/PKPr and placed in the the PowerKey Folder in the the Preferences folder. After a restart, the new External Action will appear at the bottom of the Action Selector List.

Beeper

A simple PowerKey external, Beeper, plays your beep sound through the Mac's speaker. Beeper takes only one parameter, the number of times to beep the speaker. This code is available on the PowerKey installation disk.

#include<HyperXCmd.h>
#include <string.h>
#include <A4Stuff.h>

static void  xcmd_param_to_string 
              ( Handle param, char *str, short max_len );
static long  xcmd_param_to_num ( Handle param );

pascal void main ( XCmdPtr pb )
{
  // Setup base registers so we can access global variables.
  EnterCodeResource();

  pb->returnValue = nil;  // Setup return value field of pb

  if ( pb->paramCount == 0 )
    SysBeep( 0L );
  else
  {
    long    n, count;
    
    count = xcmd_param_to_num ( pb->params[0] );
    for ( n = 1; n <= count; n++ )
      SysBeep( 0L );
  }
    
  // Restore base registers before we return
  ExitCodeResource();    

}

static void xcmd_param_to_string 
              ( Handle param, char *str, short max_len )
{
  SignedByte  state;
  
  if ((param == 0L) || (str == 0L))
    return;

  state = HGetState (param);
  HLock (param);
  strncpy (str, *param, max_len);
  str [max_len] = '\0';
  
  HSetState (param, state);
  
  return;
}
    
static long xcmd_param_to_num ( Handle param )
{
  long    num = 0L;
  char    temp [256];
  char    *s;
  
  temp [0] = '\0';    
  xcmd_param_to_string (param, temp, 255);
  s = temp + strspn (temp, " ");
  CtoPstr (s);
  StringToNum ( (StringPtr)s, &num);
  
  return num;
}

AppleScript and The PowerKey Pro

Although able to run any OSA-compliant script, the PowerKey itself is scriptable, so any event can be scripted and executed. The Core Suite's Standard Events are supported (Get Data, Set Data, Quit Application) as well as PowerKey's own suite.

execute: execute a specified event
execute reference

Class application: An application program

Elements:
unit by numeric index, by name
Properties:
version string [r/o]
timer integer
log file specification [r/o]

Class unit: a PowerKey unit

Plural form:
units
Elements:
outlet by numeric index, by name
event by numeric index, by name
Properties:
name string
serial number integer [r/o]

Class outlet: an outlet

Plural form:
outlets
Properties:
name string
level integer

Class event: an event

Plural form:
events
Properties:
name string
serial number integer [r/o]
owner type class
enabled boolean

Scripting the PowerKey is simple, whether one uses AppleScript, Frontier, or QuicKeys. A simple (and rather useless) script to flash Outlet # 6 on is

on |pause|(length)
  local endTime
  set endTime to (current date) + length
  repeat while (current date) < endTime
  end repeat
end |pause|

on flicker(cycles, delay)
  repeat cycles times
    tell application "PowerKey Extension"
      set level of outlet 6 of unit 1 to 100 - (level of outlet 6 of unit 1)
    end tell
    |pause|(delay)
  end repeat
end flicker

Calling the above script could look like the following:

flicker(4, 1)

Third-Party Integration

The PowerKey has inspired some third party tools and integrates well with others. Acme Technologies offers PowerGate, a CGI (Common Gateway Interface) to the PK Pro, thereby allowing the PK Pro to be controlled securely from the web. Pacific Coast Software also offers a freeware ACGI, SiteMonitor, available at

http://www.pacific-coast.com/st_pages/Product_Dist/sitemcust.html.

Maxum Development's PageSentry is also an excellent fit with a PK Pro. PageSentry checks to see if a web server if up by requesting a page from the server; upon an error, it notifies the administrator. With the addition of a PowerKey Pro 600, PageSentry can merely activate a PowerKey Script to restart the web server. If WebSTAR (or whatever server you use) is set to launch at startup, the web server is back up and serving pages. Notice that this technique requires a Mac to handle the PowerKey, but the web server could be of any flavor: Mac, WinNT, Unix, or BeOS.

Real Uses

The PowerKey has some very special uses. Offering a level of one touch power control and scriptability is a very empowering aid and a blessing for the differently abled. (In fact, it's handy for those of us with more powered peripherals than we might really need.) A PowerKey Pro or three and some diligent scripting can allow the control of almost any electrical thing around someone with limited or nil mobility. Interesting uses can also include turning appliances on and off with your cordless phone, a script, hot key, or even speech recognition, scheduling a computer's startups and shutdown, as well as leaving the monitor off until needed.

Even though I know of no one currently using a PowerKey Pro to do this, having a group of routers controllable via a PowerKey Pro could allow routers to be power cycled so they can properly ping their seed router. The possibilities for creative System Administration abound.

One Year Later

It's a blizzardy New England Sunday afternoon and our snowed-in, yet still intrepid Mac SysAdmin is snug at home surfing the 'Net when the peaceful whine of the monitor's flyback transformer is shattered by a dreaded pager vibrating off the desk. The pager shows an notification from the Southeastern region's sales manager that the Florida sales force's main database is down during the weekend upload of sales figures. Ms. Manager wants it up right away no matter that Mr. SysAdmin's house can't see out of the 8 foot drift and a snowplow is considered a mythical beast.

He calls Ms. Manager and calmly assures her that the database will be up if there is power to the Mac and asks her to call right back if the system isn't up in 5 minutes.

Our System Administrator has little to worry about -- his PowerKey Pro 600 is ready.


When not whipping out articles, Christopher Hall, christopher@macconnect.com, is senior consultant for the chrysalis group/the Software Brewing co. of Memphis, TN and has been consulting since 1985. He is also selling a lovely home in Memphis which would cost $415,000 if it were in California. (3 BR, 2 Bath, pool, ethernet, cheap ISDN, $140K OBO.)

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.