[Om2008.9] power on GPS

2008-10-29 Thread Matthias Apitz

Hello,

what is the diffference of these two driver files:

[EMAIL PROTECTED]:~# cat 
/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
0
[EMAIL PROTECTED]:~# cat 
/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
0
[EMAIL PROTECTED]:~# echo 1  
/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
[EMAIL PROTECTED]:~# cat 
/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
1
[EMAIL PROTECTED]:~# cat 
/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
1

and: where to put the statement to power on best? in /etc/init.d/gpsd?
Thx

matthias
-- 
Matthias Apitz
Manager Technical Support - OCLC GmbH
Gruenwalder Weg 28g - 82041 Oberhaching - Germany
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e [EMAIL PROTECTED] - w http://www.oclc.org/ http://www.UnixArea.de/
b http://gurucubano.blogspot.com/
A computer is like an air conditioner, it stops working when you open Windows
Una computadora es como aire acondicionado, deja de funcionar si abres Windows

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [Om2008.9] power on GPS

2008-10-29 Thread Alastair Johnson
Matthias Apitz wrote:
 Hello,
 
 what is the diffference of these two driver files:
 
 [EMAIL PROTECTED]:~# cat 
 /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
 0
 [EMAIL PROTECTED]:~# cat 
 /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
 0
 [EMAIL PROTECTED]:~# echo 1  
 /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
 [EMAIL PROTECTED]:~# cat 
 /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
 1
 [EMAIL PROTECTED]:~# cat 
 /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
 1
 
 and: where to put the statement to power on best? in /etc/init.d/gpsd?

They are two routes to the same file IIRC.

/etc/init.d/gpsd is a fair place to do it, but it may be overwritten if 
you update the gpsd package. I used to use a pair of scripts to start 
and stop bluetooth under 2007.2 but they should still work. You could 
always combine them with a check on the current power state to make it 
toggle, which would be better if you want to add a .desktop file.

#!/bin/sh
# Bring up gps - power up module and start gpsd
echo 1  /sys/bus/platform/devices/neo1973-pm-gps.0/pwron
/etc/init.d/gpsd start

#!/bin/sh
# Bring down gps - stop gpsd and turn off the module
/etc/init.d/gpsd stop
echo 0  /sys/bus/platform/devices/neo1973-pm-gps.0/pwron

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [Om2008.9] power on GPS

2008-10-29 Thread arne anka
/sys contains usually at least as many links as there are real files, i  
find it rather confusing but there's probably a reason.
simply do

ls -alF

or

file

for both files

ls -alF /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron
ls -alF  
/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron

most likely one of it is a link pointing to the other one.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [Om2008.9] power on GPS

2008-10-29 Thread Matthias Apitz
El día Wednesday, October 29, 2008 a las 09:43:42AM +, Alastair Johnson 
escribió:

 /etc/init.d/gpsd is a fair place to do it, but it may be overwritten if 
 you update the gpsd package. I used to use a pair of scripts to start 
 and stop bluetooth under 2007.2 but they should still work. You could 
 always combine them with a check on the current power state to make it 
 toggle, which would be better if you want to add a .desktop file.
...

There is a bug in the script /etc/init.d/gpsd: When it wants to stop the
gpsd daemon it uses:

killall gpsd

which kills the daemon and the script itself:

# /etc/init.d/gpsd stop
Shutting down gpsd: Terminated

I have renamed this script to /etc/init.d/gpsd.sh and now it works fine
and as well powers down the card writing 0 into the device file;

matthias
-- 
Matthias Apitz
Manager Technical Support - OCLC GmbH
Gruenwalder Weg 28g - 82041 Oberhaching - Germany
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e [EMAIL PROTECTED] - w http://www.oclc.org/ http://www.UnixArea.de/
b http://gurucubano.blogspot.com/
A computer is like an air conditioner, it stops working when you open Windows
Una computadora es como aire acondicionado, deja de funcionar si abres Windows

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [Om2008.9] power on GPS

2008-10-29 Thread Christophe Badoit
Matthias Apitz a écrit :
 El día Wednesday, October 29, 2008 a las 09:43:42AM +, Alastair Johnson 
 escribió:
 
 /etc/init.d/gpsd is a fair place to do it, but it may be overwritten if 
 you update the gpsd package. I used to use a pair of scripts to start 
 and stop bluetooth under 2007.2 but they should still work. You could 
 always combine them with a check on the current power state to make it 
 toggle, which would be better if you want to add a .desktop file.
   ...
 
 There is a bug in the script /etc/init.d/gpsd: When it wants to stop the
 gpsd daemon it uses:
 
   killall gpsd
 
 which kills the daemon and the script itself:
 
 # /etc/init.d/gpsd stop
 Shutting down gpsd: Terminated
 
 I have renamed this script to /etc/init.d/gpsd.sh and now it works fine
 and as well powers down the card writing 0 into the device file;
 
   matthias

Hi,

TIMTOWTDI :)

instead of

killall gpsd

There are lots of better solutions :

pkill -x -o gpsd

Or,

pgrep -x gpsd | grep -v $$ | xargs -r kill

Or, more standard I think :

kill `pidof -x -o %PPID gpsd`

Or even simpler,

kill `pidof gpsd`

since, by default, pidof ignores scripts.



-- 
Christophe Badoit



___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [Om2008.9] power on GPS

2008-10-29 Thread Matthias Apitz
El día Wednesday, October 29, 2008 a las 12:02:10PM +0100, Christophe Badoit 
escribió:

  
  killall gpsd
  
  which kills the daemon and the script itself:
  
  # /etc/init.d/gpsd stop
  Shutting down gpsd: Terminated
  
  I have renamed this script to /etc/init.d/gpsd.sh and now it works fine
  and as well powers down the card writing 0 into the device file;
  
  matthias
 
 Hi,
 
 TIMTOWTDI :)
 
 instead of
 
 killall gpsd
 
 There are lots of better solutions :
 
 pkill -x -o gpsd

The abvove method will as well kill a script with the same name 'gpsd';

 
 Or,
 
 pgrep -x gpsd | grep -v $$ | xargs -r kill

this is fine now; thx

matthias

-- 
Matthias Apitz
Manager Technical Support - OCLC GmbH
Gruenwalder Weg 28g - 82041 Oberhaching - Germany
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e [EMAIL PROTECTED] - w http://www.oclc.org/ http://www.UnixArea.de/
b http://gurucubano.blogspot.com/
A computer is like an air conditioner, it stops working when you open Windows
Una computadora es como aire acondicionado, deja de funcionar si abres Windows

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community