User:PWerken

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (fix typo)
(add device-hook script for adding agps support to gpsd)
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
== [[Special:Emailuser/PWerken|Peter van de Werken]] ==
+
== Peter van de Werken [[Special:Emailuser/PWerken|(email)]] ==
  
 
Freerunner A5, with
 
Freerunner A5, with
 
[http://www.handheld-linux.com/wiki.php?page=Buzz-Rework Buzz],
 
[http://www.handheld-linux.com/wiki.php?page=Buzz-Rework Buzz],
 
[http://www.handheld-linux.com/wiki.php?page=Bass-Rework Bass], and
 
[http://www.handheld-linux.com/wiki.php?page=Bass-Rework Bass], and
[http://www.handheld-linux.com/wiki.php?page=1024-Rework 1024] reworks.
+
[http://www.handheld-linux.com/wiki.php?page=1024-Rework 1024] reworks,
 
<br/>
 
<br/>
At the moment the [[Freerunner Navigation Board v2]] is being installed.
+
and "Standard" [[Freerunner Navigation Board v2]] installed.
  
 
OS: [http://www.debian.org debian] (sid)
 
OS: [http://www.debian.org debian] (sid)
* [http://build.shr-project.org/shr-unstable/ SHR unstable] uImage.bin-2.6.32.21-oe3.3+gitr6+a9254be10ac2294ea20165a87c09ea6afcf66d94-r0
+
* [[Kernel#Building_the_2.6.32_branch|Kernel building]]
*  NAND with [[Ubifs]] contains most of the system
+
** [http://github.com/shr-distribution/linux shr] [http://github.com/shr-distribution/linux/commits/om-gta02/2.6.39/om-stable om-gta02/2.6.39/om-stable]
*  µSD (class 2, 15.9Gb) layout:
+
*  µSD (16G, class 2):
** p1 (504MB): <tt>/boot /usr/{lib,local} /var/{cache,spool}</tt>
+
** p1 <tt>rootfs</tt>     (1G)
** p2 (14+GB): <tt>/home /srv</tt>
+
** p2 <tt>/home,/srv</tt> (14+G)
** p3 (128MB): swap
+
** p3 <tt>swap</tt>       (128M)
/etc/fstab:
+
debian tweaks:
rootfs          /              auto    defaults                    0 1
+
/dev/mmcblk0p1  /mnt/card1      ext3    defaults,relatime          0 2
+
/dev/mmcblk0p2  /mnt/card2      ext3    defaults,relatime          0 2
+
/dev/mmcblk0p3  swap            swap    defaults                    0 0
+
proc            /proc          proc    defaults                    0 0
+
+
tmpfs          /tmp            tmpfs  defaults,relatime,size=32m  0 0
+
tmpfs          /var/lock       tmpfs  defaults,relatime,size=2m  0 0
+
tmpfs          /var/run        tmpfs  defaults,relatime,size=2m  0 0
+
system tweaks:
+
 
** localepurge
 
** localepurge
 
** dpkg with "path-exclude /usr/share/doc/*"
 
** dpkg with "path-exclude /usr/share/doc/*"
** [http://www.enlightenment.org Enlightenment] (svn [http://home.a-eskwadraat.nl/~pwerken/debian/ r51890])
+
** [http://www.enlightenment.org Enlightenment] ([http://home.a-eskwadraat.nl/~pwerken/debian/ self build packages])
 +
** [[#gpsd device-hook|gpsd with device-hook]] that handles both fso resource and agps data
  
----
+
== Links ==
 
+
*  [http://www.dealextreme.com/details.dx/sku.7127 sku.7127 at dealextreme]: a 2.5mm to 3.5mm converter cable
+
** It has the following pin-layout: TRRS: left, right, mic (unconnected), ground
+
** Unfortunately this is incompatible with the FR which uses [[Headset#Pinout|TRRS: mic, right, left, ground]]
+
*  [http://www.dealextreme.com/details.dx/sku.3541 sku.3541 at dealextreme]:
+
** Looks promising, comments suggest it has a compatible pin-layout.
+
 
+
----
+
  
 
* [http://lists.openmoko.org/pipermail/community/2010-January/059014.html Handset sound volume issues]
 
* [http://lists.openmoko.org/pipermail/community/2010-January/059014.html Handset sound volume issues]
Line 44: Line 27:
 
* [[Tethering#Turning_your_FreeRunner_into_a_Network_Address_Translation_.28NAT.29_gateway|Tethering]]
 
* [[Tethering#Turning_your_FreeRunner_into_a_Network_Address_Translation_.28NAT.29_gateway|Tethering]]
 
* [http://www.screenpatronus.com ScreenPatronus]
 
* [http://www.screenpatronus.com ScreenPatronus]
 +
 +
== gpsd device-hook ==
 +
 +
With the device-hook script below gpsd will use [https://github.com/gabrys/gta02-agps gta02-gps] to retrieve and store agps data.  Do NOT start gpsd with the -n option, because then it will never deactivate the gps device.
 +
 +
An issue that needs to be resolved: gpsd doesn't deactivate the device until 60 seconds after the last client disconnects.
 +
If the device suspends during those 60 seconds the kernel will power down the gps and the agps data will be lost.
 +
* The 60 second timeout should be made configurable (and in our case be set to something low like 2 seconds).
 +
* Another solution would be to have the suspend script check if gps is powered on and ifso don't suspend. Or even better set "om gps keep-on-in-suspend 1" and schedule a (rtc) wakeup in 60 seconds.
 +
 +
/etc/gpsd/device-hook :
 +
 +
DATA=/var/cache/gta02-gps/agpsdata # nobody:dialout a=r,u+w
 +
agps=/usr/local/bin/gta02-gps
 +
 +
case "$2" in
 +
"ACTIVATE")
 +
        mdbus2 -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
 +
                org.freesmartphone.Usage.SetResourcePolicy GPS enabled
 +
        $agps --setup-serial $1 --load-agps $DATA
 +
        ;;
 +
"DEACTIVATE")
 +
        for i in 1 2 3
 +
        do
 +
                $agps --setup-serial $1 --dump-agps $DATA.new || continue
 +
                [ $(stat --printf="%s" $DATE.new) -lt 1024 ]  && continue
 +
                mv $DATA.new $DATA
 +
                break
 +
        done
 +
        mdbus2 -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
 +
                org.freesmartphone.Usage.SetResourcePolicy GPS auto
 +
        ;;
 +
esac
 +
 +
exit 0
 +
If you don't use the fso resouce, just make a call to "om gps power" instead.
 +
 +
== Navigation Board v2 ==
 +
 +
'''# i2cdetect -l'''
 +
i2c-0  i2c            s3c2410-i2c                            I2C adapter
 +
 +
'''# i2cdetect -F s3c2410-i2c'''
 +
Functionalities implemented by /dev/i2c-0:
 +
I2C                              yes
 +
SMBus Quick Command              yes
 +
SMBus Send Byte                  yes
 +
SMBus Receive Byte              yes
 +
SMBus Write Byte                yes
 +
SMBus Read Byte                  yes
 +
SMBus Write Word                yes
 +
SMBus Read Word                  yes
 +
SMBus Process Call              yes
 +
SMBus Block Write                yes
 +
SMBus Block Read                no
 +
SMBus Block Process Call        no
 +
SMBus PEC                        yes
 +
I2C Block Write                  yes
 +
I2C Block Read                  yes
 +
 +
'''# i2cdetect s3c2410-i2c'''
 +
WARNING! This program can confuse your I2C bus, cause data loss and worse!
 +
I will probe file /dev/i2c-0.
 +
I will probe address range 0x03-0x77.
 +
Continue? [Y/n] Y
 +
      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
 +
00:          03 -- -- -- -- -- -- -- -- -- -- -- --
 +
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- 1e --
 +
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 +
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 +
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 +
50: -- -- -- -- -- -- -- -- -- -- 5a -- -- -- -- --
 +
60: 60 -- -- -- -- -- -- -- -- 69 -- -- -- -- -- --
 +
70: 70 -- -- UU -- -- -- 77

Latest revision as of 22:32, 18 September 2012

Contents

[edit] Peter van de Werken (email)

Freerunner A5, with Buzz, Bass, and 1024 reworks,
and "Standard" Freerunner Navigation Board v2 installed.

OS: debian (sid)

[edit] Links

[edit] gpsd device-hook

With the device-hook script below gpsd will use gta02-gps to retrieve and store agps data. Do NOT start gpsd with the -n option, because then it will never deactivate the gps device.

An issue that needs to be resolved: gpsd doesn't deactivate the device until 60 seconds after the last client disconnects. If the device suspends during those 60 seconds the kernel will power down the gps and the agps data will be lost.

  • The 60 second timeout should be made configurable (and in our case be set to something low like 2 seconds).
  • Another solution would be to have the suspend script check if gps is powered on and ifso don't suspend. Or even better set "om gps keep-on-in-suspend 1" and schedule a (rtc) wakeup in 60 seconds.

/etc/gpsd/device-hook :

DATA=/var/cache/gta02-gps/agpsdata # nobody:dialout a=r,u+w 
agps=/usr/local/bin/gta02-gps

case "$2" in
"ACTIVATE")
        mdbus2 -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
                org.freesmartphone.Usage.SetResourcePolicy GPS enabled
        $agps --setup-serial $1 --load-agps $DATA
        ;;
"DEACTIVATE")
        for i in 1 2 3
        do
                $agps --setup-serial $1 --dump-agps $DATA.new || continue
                [ $(stat --printf="%s" $DATE.new) -lt 1024 ]  && continue
                mv $DATA.new $DATA
                break
        done
        mdbus2 -s org.freesmartphone.ousaged /org/freesmartphone/Usage \
                org.freesmartphone.Usage.SetResourcePolicy GPS auto
        ;;
esac

exit 0

If you don't use the fso resouce, just make a call to "om gps power" instead.

[edit] Navigation Board v2

# i2cdetect -l
i2c-0   i2c             s3c2410-i2c                             I2C adapter

# i2cdetect -F s3c2410-i2c
Functionalities implemented by /dev/i2c-0:
I2C                              yes
SMBus Quick Command              yes
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes

# i2cdetect s3c2410-i2c
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- 1e -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- 5a -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- 69 -- -- -- -- -- -- 
70: 70 -- -- UU -- -- -- 77
Personal tools

Peter van de Werken

Freerunner A5, with Buzz, Bass, and 1024 reworks.
At the moment the Freerunner Navigation Board v2 is being installed.

OS: debian (sid)

  • SHR unstable uImage.bin-2.6.32.21-oe3.3+gitr6+a9254be10ac2294ea20165a87c09ea6afcf66d94-r0
  • NAND with Ubifs contains most of the system
  • µSD (class 2, 15.9Gb) layout:
    • p1 (504MB): /boot /usr/{lib,local} /var/{cache,spool}
    • p2 (14+GB): /home /srv
    • p3 (128MB): swap
  • /etc/fstab:
rootfs          /               auto    defaults                    0 1
/dev/mmcblk0p1  /mnt/card1      ext3    defaults,relatime           0 2
/dev/mmcblk0p2  /mnt/card2      ext3    defaults,relatime           0 2
/dev/mmcblk0p3  swap            swap    defaults                    0 0
proc            /proc           proc    defaults                    0 0

tmpfs           /tmp            tmpfs   defaults,relatime,size=32m  0 0
tmpfs           /var/lock       tmpfs   defaults,relatime,size=2m   0 0
tmpfs           /var/run        tmpfs   defaults,relatime,size=2m   0 0
  • system tweaks: