I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods
Amazon Honor System Click Here to Pay Learn More
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / Other I-Appliances / 3Com Audrey
Programmatic access to Audrey's "sleep" mode
Programmatic access to Audrey's "sleep" mode

New MessageProgrammatic access to Audrey's "sleep" mode (modified 0 times) johnhamm
Profile
This might be the wrong place to post it, but I don't think this is a QNX-related question since it has to do with Audrey hardware functions.

I want to write a slideshow app that puts the Audrey in sleep mode at midnight, then brings her out of sleep mode at 6am. I want to do this because it doesn't make any sense for Audrey to run at night. Is this possible, or is the only way to bring her out of sleep mode is to press a key or the screen?

Who would know the answer to this question? Do we have contact with any of Audrey's developers/designers?

11-18-2001 21:32:35

New MessageRE:Programmatic access to Audrey's (modified 0 times) davinci27
Profile
You can use gpio to turn the screen on and off. I don't remeber the exact sytax, but you should be able to find it by doing a searh of this board.

davinci27

11-18-2001 21:37:02

New MessageRE:Programmatic access to Audrey's (modified 0 times) dilligaf
Profile
Here is a good explanation of it:
http://homepage.mac.com/deandavis/audrey/AudreyOnOff.html

dill

11-18-2001 23:19:05

New MessageRE:Programmatic access to Audrey's (modified 0 times) johnhamm
Profile
Awesome, thanks guys!
I wonder if there is some kind of task scheduling program in QNX to run gpio at certain times with certain parameters so I don't need to have an external browser turn the screen on/off?
11-18-2001 23:37:35

New MessageRE:Programmatic access to Audrey's (modified 0 times) davec
Profile
I wonder if you could accomplish this by creating 2 scripts, for example 1 called ScreenOn.sh and another ScreenOff.sh, each w/ the appropriate gpio call. I think you can get an idea of what gpio parameters to use if you look at this line in /kojak/go

#Switch display on!
/kojak/gpio -a 0x40010004 -b5 -m3 -s3

Don't know exactly what the parameters mean, but safe to guess that -a 0x40010004 is an address for some sort of hardware I/O port that controls the screen?

Then you could list ScreenOn.sh and ScreenOff.sh in the /config/kcrontab file to run at the appropriate times.

How's that sound?

DaveC

11-19-2001 01:14:54

New MessageRE:Programmatic access to Audrey's (modified 0 times) inkspoof
Profile
Tried that.. doesn't seem to work. I've changed permissions on the .sh files either... I even tried doing a simple turn the LED to blink and that doesn't work.

Here's what I have:

/Kojak/ScreenOn.sh:
/kojak/gpio -a 0x40010004 -b6 -m3 -s3

/Kojak/ScreenOff.sh:
/kojak/gpio -a 0x40010004 -b6 -m3 -s0

/Kojak/LedBlink.sh:
SetLEDState 2

Tried chmod +x on the three files and a chmod 777 on them also.

They work when you run them under root, but not under kcrontab.

11-19-2001 10:24:40

New MessageRE:Programmatic access to Audrey's (modified 0 times) davinci27
Profile
You might try execv app it allows you to execute .sh scripts like applications. It's worth a shot.

davinci27

11-19-2001 10:47:26

New MessageRE:Programmatic access to Audrey's (modified 0 times) keith721
Profile
hey, folks . . . i once posted the results of # use gpio on another message thread about using the CF as storage. get the use command from QNX RTP, and you can find all the gpio options described...

keith721

11-19-2001 13:55:47

New MessageRE:Programmatic access to Audrey's (modified 0 times) hw_irq
Profile
# use gpio
====
GPIO
----
gpio -m <mask> [-s <state> -d <dir> -p <pullup> -t <type> -b <bitshift>]
All values 32-bit bitmaps corresponding to GPIO values in gpio.h

mask: GPIO bits to set/get
state: State of pin (1 = high)
dir: Direction of pin (1 = output)
pullup: Pull-up of pin (1 = pull-up)
type: Type of pin pull-up (see specs).
bitshift: optional bitshift applied to above values

If pullup or type specified, both must be specified.

===
I/O
---
gpio -i <IO> [-m <mask> -s <set> -1|-2|-4 -b <bitshift>]

IO: absolute physical IO address
mask: Only affects bits within mask
IO: absolute physical IO address
mask: Only affects bits within mask
set: Value to set IO address to. Must also specify mask for bits to set/clear.
-1 1-byte value
-2 2-byte value
-4 4-byte value (default)

======
Memory
------
gpio -a <address> [-o offset -m <mask> -s <set> -1|-2|-4 -b <bitshift>]

address: absolute physical base memory address
offset: offset from base

===
PCI
---
gpio -f <function> -o <offset> [-m <mask> -s <set> -b <bitshift>]

function: PCI device function
offset: offset (bytes)

====
9211
----
gpio -9 -o <offset> [-m mask -s <set> -b <bitshift>]

Set/Get CS9211 register settings

--------------
Other options:
-% format
Specify printf format for output (x = hex (default), d = decimal)
Executable returns current value (before sets if any)
With "-%", value also printed.

11-19-2001 22:22:22

New MessageRE:Programmatic access to Audrey's (modified 0 times) bungee
Profile
inkspoof
kcrontab doesn't really seem to allow you to enter any arbitary programs, get cron from 6.0 or from my site
http://www.bloodyeck.com/projects/audrey/
05-03-2002 12:21:53

New MessageRE:Programmatic access to Audrey's (modified 0 times) bungee
Profile
I've found that the GPIO option doesn't really put the audrey into sleep mode, it just turns off teh screen. to get out of the GPIO'd 'sleep' mode I need to hit the power button twice (once to power down and again to power up).

is there a better way to request sleep mode? perhaps throwing a 1 into the /config/SYSTEM_ScreenSaveSecs file?

Alex.


http://www.bloodyeck.com/projects/audrey/
05-03-2002 16:20:06

New MessageRE:Programmatic access to Audrey's (modified 0 times) bungee
Profile
I've tried fireKey and it doesn't work with string=@PWR :(
http://www.bloodyeck.com/projects/audrey/
05-03-2002 16:52:48

New MessageRE:Programmatic access to Audrey's (modified 0 times) Sketchy
Profile
Seeing this old thread brought up again got me motivated to figure some stuff out. I can't keep my hands off of my poor Audrey! I went digging around in the kojak libraries and found a way to control sleep mode programmatically. Today I wrote a quick utility for it. Here it is. This really changes sleep mode, not just the screen backlight.

You can control sleep mode from the command line, or with kcron, or remotely from any web browser. You can also test the current status of sleep mode. It seems to work just fine, but I'd be happy to hear of any bugs. Note that turning off the screen via the command line requires a "sleep 1;" before the command, or else the key-up event causes it to instantly wake up again.

The utility and the source code are here. Note that it requires the libkojak.so library, which I think everyone still must have.


-- Jim
ACID and other Audrey apps
05-04-2002 20:58:01

New MessageRE:Programmatic access to Audrey's (modified 0 times) bungee
Profile
Jim this is great! just what I was looking for! I put the code into my picture frame app, and I'll be able to test it once I copy over libkojak.so to my qnx dev environment.

I'm intrigued by you mentioning you could run it from kcron, I never got any commands other than the defaults running from kcron and moved over cron and crontab from my QNX machine and that works fine.

I'll keep you posted on developments with this and ACID talking to palm DB's!

05-06-2002 17:29:08

New MessageRE:Programmatic access to Audrey's (modified 0 times) booya
Profile
Sketchy can you explain how you got this working in kcron? I can not get it to work in cron or kcron. Thanks.
Get help, chat, and be merry..
Join #audrey on Efnet
05-07-2002 22:36:49

New MessageRE:Programmatic access to Audrey's (modified 0 times) booya
Profile
here is my cron setup.. for testing.. the date one is working fine every minute.
# crontab -l
#cron entries
* * * * * /nto/bin/date >/tmp/date.txt
* * * * * /nto/bin/screen t 2> /tmp/stat
#

I put the "2> /tmp/stat" at the end of the screen line to output errors to the /tmp/stat file. Here is what I see.
# cat /tmp/stat
Could not find library libkojak.so
#

Interesting.. I can run screen fine by its self. Any Idea's?


Get help, chat, and be merry..
Join #audrey on Efnet
05-07-2002 22:50:33

New MessageRE:Programmatic access to Audrey's (modified 0 times) booya
Profile
lalalala... set cron to run set and save output to a file.. here is what I see.

# cat /tmp/set
HOME=/
IFS='
'
KSH_VERSION='@(#)PD KSH v5.2.14 99/07/13.2'
LOGNAME=root
MAILCHECK=600
OPTIND=1
PATH=/bin:/usr/bin
PPID=6815766
PS1='# '
PS2='> '
PS3='#? '
PS4='+ '
PWD=/
RANDOM=5541
SECONDS=0
SHELL=/bin/sh
TMOUT=0
TZ=PST8PDT

I see no "LD_LIBRARY_PATH"

I created a script that exports the LD_LIBRARY_PATH=/kojak:/proc/boot:/nto/lib:/nto/photon/lib:/nto/photon/dll:/real/plugins:/real/common
and then runs sceen 1 or screen 0 and it works now, but there must be a way to set this path for cron to automatically know the LD_LIBRARY_PATH. Anyone know how? Thanks.


Get help, chat, and be merry..
Join #audrey on Efnet
05-07-2002 23:13:01

New MessageRE:Programmatic access to Audrey's (modified 0 times) Sketchy
Profile
Oops! I'm sorry, I never actually tested in in cron/kcron. I just assumed it would work. The cron commands appear to be running in an environment that is set up before all the kojak env. variables are set up. I haven't looked into it yet, but perhaps you should investigate where kcron gets launched, and export the right variables just before then.
-- Jim
ACID and other Audrey apps
05-08-2002 00:25:27

New MessageRE:Programmatic access to Audrey's (modified 0 times) davinci27
Profile
Well I'm glad to see I'm not alone with cron. I'm having the same problems booya's having I've been diggin through to find where this stuff get set, but to no avail. The interesting thing is it happens when I run it from a PTERM where the environment variables are already established.

I think the file that setsup all the initial environment variables is /proc/boot/.script. But I don't think this is where cron is getting it's values. Has anybody found a way to edit the .script

By the way, I just had cron echo the variables to see if they were setup

davinci27

05-08-2002 04:34:28

New MessageRE:Programmatic access to Audrey's (modified 0 times) booya
Profile
I found this URL witch mentions the default Enviroment Variables and that if you need different variables you will have to set them from a shell script.

http://sdx1.uky.edu/cgi-bin/man.cgi?section=all&topic=crontab

I think I have screen working now in cron from a shell script that sets the enviroment and then runs screen 1 or 0. I have set cron for shutting off and turning on the screen at certain times. I will let you know if it works ok.. a side note is that the "date" line that bungee has in cron works flawless. Every minute I get a new entry.. I changed it slightly to overwrite date.txt rather than append though.


Get help, chat, and be merry..
Join #audrey on Efnet
05-08-2002 09:44:04

New MessageRE:Programmatic access to Audrey's (modified 0 times) davinci27
Profile
I think booya and I are following each other around the web. I just found the same information over at qnx.com

http://qdn.qnx.com/support/docs/qnx4/utils/c/crontab.html

davinci27

05-08-2002 10:36:59

New MessageRE:Programmatic access to Audrey's (modified 0 times) davinci27
Profile
going on booya's script, I threw this together.

#!/nto/bin/sh
export PATH=/proc/boot:/nto/bin:/nto/photon/bin:/kojak:/nto/voyager/x86/bin:/real/bin:/tmp:/kojak/CGI:/kojak
export LD_LIBRARY_PATH=/kojak:/proc/boot:/nto/lib:/nto/photon/lib:/nto/photon/dll:/real/plugins:/real/common:/kojak
`"$@"`

save this as cronenv and chmod +x then when you want to run something in cron for example screen, just use 'cronenv screen t' This will setup the environment then execute the program

davinci27

05-08-2002 20:15:24

New MessageRE:Programmatic access to Audrey's (modified 0 times) booya
Profile
Davinci,
It work's great! Much cleaner than the way I was planning to set it up with a custom shell script for each app. Thanks.
Get help, chat, and be merry..
Join #audrey on Efnet
05-09-2002 17:37:17

New MessageRE:Programmatic access to Audrey's (modified 0 times) bungee
Profile
you can also solve the LD_LIBRARY path issue like this

echo $LD_LIBRARY_PATH >/kojak/ldpath.txt

and now in your crontab have something like this

5 * * * * LD_LIBRARY_PATH=`cat /kojak/ldpath.txt` commandToRun

works for me for starting my screensaver, and now I can make it turn the screen on and off

as usual you can get cron for audrey here
http://www.bloodyeck.com/projects/audrey/#cron

Alex


http://www.bloodyeck.com/projects/audrey/
05-10-2002 13:53:08

New MessageRE:Programmatic access to Audrey's (modified 0 times) booya
Profile
Bungee, I noticed on your page that you mention the "-" hyphen doesn't work in QNX cron but it does. A "-" then a "," doesn't work though. "0-5,23" Didn't work. I have noticed that the "/" doesn't work either.. "*/5" Didn't work. My crontab list is below.

0,5,10,15,20,25,30,35,40,45,50,55 0,1,2,3,4,5,23 * * * cronenv screen 0 1>/dev/null 2>>/tmp/err
Run screen 0 every 5 minutes from the hours of 11PM to the hours of 5:55AM

0,5,10,15,20,25,30,35,40,45,50,55 8-16 * * 1-5 cronenv screen 0 1>/dev/null 2>>/tmp/err
Run screen 0 every 5 minutes from the hours of 8AM to 4:55PM, Monday thru Friday

0 17 * * 1-5 cronenv screen 1 1>/dev/null 2>>/tmp/err
Run Screen 1 at 5PM on Monday thru Friday

0 6 * * * cronenv screen 1 1>/dev/null 2>>/tmp/err
Run Screen 1 at 6AM


Get help, chat, and be merry..
Join #audrey on Efnet
05-10-2002 15:57:50

New MessageRE:Programmatic access to Audrey's (modified 2 times) booya
Profile
Not to beat a dead horse since Davinci and Bungee came up with great work arounds, but....

This is probably what we need to do when running cron to start it with the proper enviroment.
http://qdn.qnx.com/support/docs/neutrino_qrp/utilities/e/env.html


Get help, chat, and be merry..
Join #audrey on Efnet
05-10-2002 16:10:28

Reply to Thread | Printer |
All times are PSTPowered by UltraBoard v1.62



Copyright © 2000, Netmake Inc. All Rights Reserved.
See Terms and Conditions for more information.




i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3