Ticket #116 (closed defect: fixed)

Opened 3 years ago

Last modified 7 months ago

GPS not working

Reported by: Brian J. Murrell <brian@…> Owned by: illifant
Priority: major Milestone: Android 2.3 Bull
Component: Android 2.2 Version: Android 2.2 - alpha2
Keywords: Cc:

Description

I'm completely surprised not to see a ticket for this yet, but GPS functionality not working.  Not surprising that it doesn't (yet).  Probably just needs some time.

Should have a ticket tracking it though.

Attachments

gps.patch Download (38.2 KB) - added by illifant <gm.illifant@…> 2 years ago.
libgps, makefile and changes for init.rc and smth. apply to vendor/archos

Change History

  Changed 3 years ago by dm8tbr

sort of related to #66
The main problem being that we'd need to use the binary from the archos firmware as there is no documentation and no source for the GPS chip.

  Changed 3 years ago by Capn_Fish

A note on drivers:

I tried to get them from TI, who said, IIRC, something to the effect of "we don't support that; ask one of our distributors" So I went and asked 3 of them; one never got back to me, one said they wouldn't help unless I was a major customer, and the third tried to help (the guy I reached even went to their engineering department to ask), but couldn't.

Archos "doesn't support SDE"; I tried. Apparently "give source" == "support." I'm somewhat tempted to try again and ask to communicate with somebody not in customer service.

The one positive note is that nobody said anything about NDAs around the source...

  Changed 3 years ago by Brian J. Murrell <brian@…>

To take this in a different direction, it seems that GPS is done entirely in userspace with "/usr/bin/nl5350-gpsd -u /dev/ttyS1". So a couple of solutions are available. The first and easiest(?) is to simply use the 1.6 firmware's nl5350-gpsd binary on froyo. I tried doing this and got:

# /sbin/nl5350-gpsd
/sbin/nl5350-gpsd: not found

after copying the binary from the 1.6 firmware to /sbin on my froyo image, of course.

The ENOENT is likely due to libc incompatibility. There was mention on #openaos that froyo uses a different libc than does the 1.6 firmware. So to go this route I think we'd need to build a 1.6 compatible libc.

Another approach to solving this problem, which depends on resolving the first approach (so that we have a functioning binary) is to reverse engineer that binary's communication with the GPS hardware on ttyS1. That could be done either by intercepting the comms to and from the serial port or with strace I'd think.

Of course, all of this is easier said than done.  :-/

Thots?

  Changed 3 years ago by Capn_Fish

It would be nice to reverse engineer; then we could have it working under Angstrom as well (that's my goal). I don't suppose we'd be so fortunate as to have nl5350-gpsd be actually based on regular gpsd...

Anyway, I'll poke around at this hopefully this weekend. Is there an strace binary available somewhere?

  Changed 3 years ago by Brian J. Murrell <brian@…>

There is a working strace on froyo.  But in order to reverse engineer on froyo, we need a compatible libc first.  I dunno about strace on the 1.6 firmware.

  Changed 2 years ago by anonymous

strace for 1.6 can be easily built with Buildroot and put into rooted fw

  Changed 2 years ago by anonymous

A5IT seem's have the same GPS chip as in n-series Nokia phones. Maybe that helps:  http://wiki.maemo.org/N900_GPS_Reverse_Engineering

  Changed 2 years ago by dm8tbr

Random sidenote from #meego on freenode

17:33:50< jayabharath> dm8tbr: yes NL53xx firmware and drivers are proprietary... and will not have a FOSS drivers from TI.

follow-up: ↓ 10   Changed 2 years ago by illifant

To make gpsd running on froyo


1. Mount openaos image

cp -a <EXTRACTED_ARCHOS_FW_ROOTFS>/lib/l* <OPENAOS_IMAGE_DIR>/lib/
mkdir <OPENAOS_IMAGE_DIR>/gps
cp <EXTRACTED_ARCHOS_FW_ROOTFS>/gps/* <OPENAOS_IMAGE_DIR>/gps/
cp <EXTRACTED_ARCHOS_FW_ROOTFS>/usr/bin/nl5350-gpsd <OPENAOS_IMAGE_DIR>/

2. Unmount image, boot from it.
3. Open adb shell

# ./nl5350-gpsd -u /dev/ttyS1
nl5350 in server mode, test 0, logging disabled

in reply to: ↑ 9   Changed 2 years ago by Brian J. Murrell <brian@…>

Replying to illifant:

cp -a <EXTRACTED_ARCHOS_FW_ROOTFS>/lib/l* <OPENAOS_IMAGE_DIR>/lib/

Surely, since ldd on 2.0.38 tells us that /usr/bin/nl5350-gpsd only needs:

libm.so.0
libc.so.0
ld-uClibc.so.0

Those are all that are needed to copy, yes? I will try it.

Can somebody remind me how to open/unpack/extract the archos firmware?

  Changed 2 years ago by Brian J. Murrell <brian@…>

OK. So yes, simply copying:

lib/ld-uClibc-0.9.30.1.so
lib/ld-uClibc.so.0
lib/libm-0.9.30.1.so
lib/libm.so.0
lib/libc.so.0
lib/libuClibc-0.9.30.1.so
gps/
gps/GPSCConfigFile.cfg
gps/patch-x.0.ce
gps/patch_3_9_archos.ce
gps/patch_general.ce
usr/bin/nl5350-gpsd

Is enough to run the nl5350-gpsd binary and have it fix to satellites.

What still seems to be missing is plugging froyo's GPS infrastructure into l5350-gpsd.

I get failures like this trying to run any app that wants access to the GPS:

I/ActivityManager(  963): Start proc com.chartcross.gpstest for activity com.chartcross.gpstest/.GPSTest: pid=1563 uid=10043 gids={}
I/WindowManager(  963): Setting rotation to 3, animFlags=1
I/ActivityManager(  963): Config changed: { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=1 layout=268435490 uiMode=17 seq=5}
D/dalvikvm( 1563): GC_EXTERNAL_ALLOC freed 1215 objects / 102736 bytes in 66ms
D/AndroidRuntime( 1563): Shutting down VM
W/dalvikvm( 1563): threadid=1: thread exiting with uncaught exception (group=0x4001d898)
E/AndroidRuntime( 1563): FATAL EXCEPTION: main
E/AndroidRuntime( 1563): java.lang.RuntimeException: Unable to resume activity {com.chartcross.gpstest/com.chartcross.gpstest.GPSTest}: java.lang.IllegalArgumentException: provider=gps
E/AndroidRuntime( 1563): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3128)
E/AndroidRuntime( 1563): 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3143)
E/AndroidRuntime( 1563): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2684)
E/AndroidRuntime( 1563): 	at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime( 1563): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 1563): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1563): 	at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1563): 	at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 1563): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1563): 	at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 1563): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
E/AndroidRuntime( 1563): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/AndroidRuntime( 1563): 	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1563): Caused by: java.lang.IllegalArgumentException: provider=gps
E/AndroidRuntime( 1563): 	at android.os.Parcel.readException(Parcel.java:1264)
E/AndroidRuntime( 1563): 	at android.os.Parcel.readException(Parcel.java:1248)
E/AndroidRuntime( 1563): 	at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:516)
E/AndroidRuntime( 1563): 	at android.location.LocationManager._requestLocationUpdates(LocationManager.java:711)
E/AndroidRuntime( 1563): 	at android.location.LocationManager.requestLocationUpdates(LocationManager.java:630)
E/AndroidRuntime( 1563): 	at com.chartcross.gpstest.GPSTest.onResume(GPSTest.java:438)
E/AndroidRuntime( 1563): 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
E/AndroidRuntime( 1563): 	at android.app.Activity.performResume(Activity.java:3823)
E/AndroidRuntime( 1563): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)
E/AndroidRuntime( 1563): 	... 12 more
W/ActivityManager(  963):   Force finishing activity com.chartcross.gpstest/.GPSTest
I/SurfaceFlinger(  963): 

Probably some looking at the source that's building the froyo alphas is needed to see how the Android GPS services are supposed to interface are needed.

  Changed 2 years ago by Brian J. Murrell <brian@…>

OK. I did some digging. I think what needs to happen in order to have this working in the Android code itself is to add a:

BOARD_GPS_LIBRARIES := "libgps"

to the vendor/archos/gen7/BoardConfig.mk file.

  Changed 2 years ago by illifant <gm.illifant@…>

If you start the second gpsd instance it opens /tmp/gpsd-nmea socket and reads something from there and outputs to stdout. NMEA is some standart protocol for gps data

 http://gpsd.berlios.de/NMEA.txt

  Changed 2 years ago by illifant <gm.illifant@…>

Getting GPS data from gpsd is simple as reading from socket. I think we can port libgps from freerunner (for example). It has NMEA parser from gps_qemu.c with enhancements to support more types of nmea sentences. I got GLL, RMC, GGA, VTG, GSA and GSV.

 http://gitorious.org/android-on-freerunner/freerunner_platform_hardware_hw/blobs/master/gps/gps_freerunner.c

Changed 2 years ago by illifant <gm.illifant@…>

libgps, makefile and changes for init.rc and smth. apply to vendor/archos

follow-up: ↓ 19   Changed 2 years ago by illifant <gm.illifant@…>

1. nl5350-gpsd must be copied to /bin/nl5350-gpsd . or change the path in init.rc
2. gpsd is always running. it's sleeping when it's not used
3. may be problems with sleeping. I mean, the entire system may stay awake
4. I didn't rename functions so it's still 'freerunner' everywhere. if you don't like it, change it
5. getting first fix is sloooooooooooooooow

  Changed 2 years ago by illifant <gm.illifant@…>

One thing I forgot

diff --git a/gen7/BoardConfig.mk b/gen7/BoardConfig.mk
index 6c77469..2877c5d 100644
--- a/gen7/BoardConfig.mk
+++ b/gen7/BoardConfig.mk
@@ -61,6 +61,8 @@ BOARD_OPENCORE_FLAGS := -DHARDWARE_OMX=1
 
 # GPS support
 BOARD_GPS_LIBRARIES := libgps
+PRODUCT_COPY_FILES += \
+       device/common/gps/gps.conf_EU:system/etc/gps.conf
 
 # JIT
 WITH_JIT := true

in reply to: ↑ 17   Changed 2 years ago by Brian J. Murrell <brian@…>

Replying to illifant <gm.illifant@…>:

1. nl5350-gpsd must be copied to /bin/nl5350-gpsd . or change the path in init.rc
2. gpsd is always running. it's sleeping when it's not used
3. may be problems with sleeping. I mean, the entire system may stay awake
4. I didn't rename functions so it's still 'freerunner' everywhere. if you don't like it, change it
5. getting first fix is sloooooooooooooooow

Is this to say that you got GPS working in froyo? If so, I don't suppose you have a firmware that you want to share do you?

  Changed 2 years ago by Brian J. Murrell <brian@…>

Or OpenAOS folks, if you can reproduce illifant's success, I'd say this most certainly justifies a new Alpha, yes?

  Changed 21 months ago by dm8tbr

  • milestone changed from Android 2.x alpha6 - DO NOT USE to Android 2.3 m2

Moved to next milestone.

  Changed 21 months ago by illifant

  • owner changed from bubu to illifant
  • status changed from new to assigned

  Changed 20 months ago by illifant

  • status changed from assigned to closed
  • resolution set to fixed

  Changed 16 months ago by VinceBlog17 <vincent.meriau@…>

  • status changed from closed to reopened
  • resolution fixed deleted

Hi Guys !

I've got Bull RC2 on my Archos5 it and I can't download nor Ndrive, nor Google Maps, nor Mappy Gps saying that my device is not compatible !?!?

This bug is closed but why can't I get any GPS Apk ?

  Changed 16 months ago by dm8tbr

  • status changed from reopened to closed
  • resolution set to fixed

Please do not reopen tickets just because they are vaguely similar! This was verified fixed.

Installation has nothing to do with GPS functionality itself! Please open a separate ticket.

follow-up: ↓ 29   Changed 13 months ago by dant98@…

Is this supposed to be in the latest Gingerbread release from 4/12/12? GPS doesn't seem to be providing any data on my Gen 7 (5IT).

  Changed 13 months ago by Brian J. Murrell <brian@…>

When I use, say, copilot (gps nav software) I frequently find I have to go into the the config screen where you enable GPS and disable and then enable it before GPS will actually start working. I identify why I have to do this by the lack of pulsing GPS icon on the status bar even though I have started the nav software.

I use the previous Gingerbread though, not the 4/12/12 one.

  Changed 13 months ago by dant98@…

It wasn't working on my Bull RC2 install I had either. Are you also using a 5IT?

in reply to: ↑ 26   Changed 7 months ago by anonymous

Replying to dant98@…:

Is this supposed to be in the latest Gingerbread release from 4/12/12? GPS doesn't seem to be providing any data on my Gen 7 (5IT).

Same for me. I think the answer is in this commit that happened shortly after the latest kernel release dated '20120512...':  http://gitorious.org/archos-buildroots/gen7/commit/db560d1e2b1596c499d2fa1b32ae191ac95ec93e

The problem is only with the initrd, so I unpacked it, inserted the missing lines from the commit into openaos_lib.sh, and repacked using these instructions on the wiki: http://dev.openaos.org/wiki/InitramfsRepacking. Then substituted this 'new' initramfs.cpio.gz when following the multiroot instructions, after which the GPS started working.

HTH,

Add/Change #116 (GPS not working)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.