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

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom 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
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.