Back to Main Page

Background:

Out of the box the Audrey is set to "sleep" after 300 seconds (5 minutes).

This is the same as hitting the power button.

Audrey isn't really off, it's just sleeping. Personally my Audrey stays in the web browser and displays a page that is set to refresh every 60 seconds.

While in "sleep" mode however the browser is also put to sleep and it won't do the refresh. So I turned off the automatic sleep mode (explained below).

But now all my Audreys glow all night. Nice if you want a night light, but I don't.

So below is a procedure so that you can turn off the screen at will.

Here is the cool part. The command you will issue to the Audrey doesn't put it to sleep, it just turns off the screen!

The browser continues to refresh and it never goes back to the "Explanation of the Buttons" screen. Most people know that in the browser you can issue commands to the Audrey by typing URLs like...

http://localhost/SystemProfile.shtml

To see your Audreys System Settings, or

http://localhost/cgi-bin/SetLEDState?1

To blink the light.
So obviously Audrey has a built in mini Web server! Problem is that it is configured to only accept commands from the Audrey. So first we'll open up the web server to accept commands from any browser (don't worry no one should be able to access your Audrey from the internet.) Then we'll do some simple commands so that you can type a URL into a browser on your Macintosh to turn the Audrey screen on and off.

Required Prerequisites
You must have installed the button to start a "Root Shell"
Audrey must be connected to your home network so it can talk to your Mac

Prefered Prerequisites
Have the "Shutdown" button installed on Audrey options

Procedure
Our First step is to turn off Audreys sleep mode.
1) Start the "Root Shell"
2) type: echo 0>/config/SYSTEM_ScreenSaveSecs

Our second step is to open the Audrey to outside URL requests
1) Start the "Root Shell"
2) type: cd /config
3) type: cp rm-apps rm-apps.copy
4) type: vi rm-apps
You'll be in the editor, editing the "rm-apps" file
About the 14th line down is "rb,/kojak/kojak-slinger, -c -e -s -i 127.1"
You need to delete the "-i 127.1" from the line.
To do this, place the cursor under the right after the "-s"
Type the "x" key so start deleting from the line.
The line should end up looking like...
"rb,/kojak/kojak-slinger, -c -e -s"
If you need to start over type a colon to get to the vi command line
At the colon prompt type "q!" and hit "enter" (this quits without saving)
If it looks good then at the colon prompt type "wq" to save changes
Now restart the Audrey by pushing the "Shutdown" button if you have installed it
Or unplugging the Audrey, waiting 30 seconds and plugging it back in.

Now let's pretend the IP address of your Audrey is 192.168.1.123
You should now be able to go to a Mac, start a browser and type...
http://192.168.1.123/SystemProfile.shtml
To see the Audrey system information in the Mac Web browser.
If you can't do this then something is wrong, sorry.
If it does work then continue on.

The secret is a command program called "gpio".
We need to make this program be owned by root.
To do this you need to be in the Root Shell at the "#" prompt.
BE VERY CAREFUL RIGHT NOW
1) type: cd /kojak
2) type: cp gpio gpiotemp
3) type: rm gpio
4) type: cp gpiotemp gpio
5) type: chmod a+s gpio
6) type: gpio
If the "#" prompts returns with no other messages then all is OK
so continue if you get any message then something went wrong, sorry.
7) type rm gpiotemp

Now we need to create a file that will execute the gpio command for us.
To do this you must be in the "Root Shell" with the "#" prompt.
1) type: vi /data/XML/gpio.shtml
This starts the VI editor to create a new file called "gpio.shtml"
in the directory "/data/XML"
The contents of the file needs to be...


<html><head><title>Shell</title></head><body>
<!--#exec cmd="/kojak/gpio -a 0x40010004 -b6 -m3 -s$QUERY_STRING" -->
</body></html>


2) After getting this typed in save your changes.

If everything went ok you should be able to type these URLs...
(remember we are pretending your Audreys IP address is 192.168.1.123)
Turn off:
http://192.168.1.123/gpio.shtml?0

Turn on:
http://192.168.1.123/gpio.shtml?3

If all of this worked, now you can add a unit to XTension and in its "ON" and "OFF" script
you can write an AppleScript that uses "URL Access Scripting" scripting additions
to issue these URLs. See the dictionary for "URL Access Scripting" it's easy to do.

E-mail the XTension list with any questions.