GPS on Android

858 views
Skip to first unread message

Ne0

unread,
Oct 20, 2010, 2:56:03 AM10/20/10
to android-porting
Hi guys,
Im trying to interface a USB based GPS device on Beagleboard running
Android eclair. I have connected the GPS device through a USB hub.

Everytime I connect the GPS device, i get the following msg on the
console:

usb 1-2.4: new full speed USB device using ehci-omap and address 5

My goal is to get the NMEA data on the console or in a file. Any idea
whr i need to start??
I was looking at the documentation given with the distribution which
talks about adding your own device etc.

Thanks in advance :)

Hamilton Vera

unread,
Oct 20, 2010, 10:38:43 AM10/20/10
to neera...@gmail.com, android-porting
When you hook this GPS In a linux machine does it binds to a /dev/ttyACMx?

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

--
Hamilton Vera
int Administrator (char Network[],char ComputationalSystems[])
http://hvera.wordpress.com

Ashwin Bihari

unread,
Oct 20, 2010, 10:39:02 AM10/20/10
to neera...@gmail.com, android-porting
I've interfaced a UART based GPS device within Android and for that I
wrote a driver that opened up the UART, grab the NMEA strings and
parsed. I use the freerunner's GPS file as a starting point,
especially for the NMEA parsing stuff. You can do the same, the only
difference being that instead of opening a UART to get access to the
GPS chip, you'll need to figure out how this USB-based GPS chip wants
to communicate and open up the device in that manner.

If the chip wants to behave like a UART device, you'll want to enable
the USB-Serial driver to create a /dev/ttyACM0 device or something and
read from that device..

Regards
-- Ashwin

Hamilton Vera

unread,
Oct 20, 2010, 10:42:12 AM10/20/10
to abi...@gmail.com, neera...@gmail.com, android-porting
In fact is the USB Modem (CDC ACM) support


│ Symbol: USB_ACM [=y]


│ Prompt: USB Modem (CDC ACM) support


│ Defined at drivers/usb/class/Kconfig:7


│ Depends on: USB_SUPPORT && USB


│ Location:


│ -> Device Drivers


│ -> USB support (USB_SUPPORT [=y])


You can set it using:

setprop ro.kernel.android.gps ttyACM0

[]'s

Hamilton Vera

--

Mikkel Christensen

unread,
Oct 21, 2010, 2:31:27 AM10/21/10
to android-porting
Hello,

When you have finished your initial connectivity problem there is a
good thread on porting a GPS module to Android here:

http://groups.google.com/group/android-porting/browse_thread/thread/c67550378823a0d4/693b60380dfd6538#693b60380dfd6538

Best regards,

Mikkel Christensen
Chief Software Engineer
Ixonos Denmark ApS

Ne0

unread,
Dec 4, 2010, 7:37:22 AM12/4/10
to android-porting
Hey sry for the late reply, ....

The GPS im using is a USB GPS device, it uses the USB-serial adapter
pl2303 driver.
when i connect the gps to the Beagle Board, I get a msg as:

pl2303 1-2.4:1.0: pl2303 converter detected
usb 1-2.4: pl2303 converter now attached to ttyUSB0

but on doing a cat /dev/ttyUSB0
i dont get the gps data.
instead i get the following text which looks like some debug output:

------------[ cut here ]------------
WARNING: at drivers/usb/serial/usb-serial.c:376 serial_write_room
+0x48/0x70()
Modules linked in: omaplfb pvrsrvkm
[<c0039934>] (unwind_backtrace+0x0/0xd8) from [<c005f09c>]
(warn_slowpath_common+0x48/0x60)
[<c005f09c>] (warn_slowpath_common+0x48/0x60) from [<c021cbe8>]
(serial_write_room+0x48/0x70)
[<c021cbe8>] (serial_write_room+0x48/0x70) from [<c01b57cc>]
(tty_write_room+0x1c/0x20)
[<c01b57cc>] (tty_write_room+0x1c/0x20) from [<c01b3204>]
(process_echoes+0x3c/0x280)
[<c01b3204>] (process_echoes+0x3c/0x280) from [<c01b51fc>]
(n_tty_receive_buf+0xbc0/0x106c)
[<c01b51fc>] (n_tty_receive_buf+0xbc0/0x106c) from [<c01b7688>]
(flush_to_ldisc+0xd4/0x168)
[<c01b7688>] (flush_to_ldisc+0xd4/0x168) from [<c006e230>]
(worker_thread+0x150/0x1c4)
[<c006e230>] (worker_thread+0x150/0x1c4) from [<c00711d4>] (kthread
+0x78/0x80)
[<c00711d4>] (kthread+0x78/0x80) from [<c0034e6c>] (kernel_thread_exit
+0x0/0x8)
---[ end trace 5827570c12dafca5 ]---
------------[ cut here ]------------
WARNING: at drivers/usb/serial/usb-serial.c:363 serial_write+0x6c/
0xa0()
Modules linked in: omaplfb pvrsrvkm
[<c0039934>] (unwind_backtrace+0x0/0xd8) from [<c005f09c>]
(warn_slowpath_common+0x48/0x60)
[<c005f09c>] (warn_slowpath_common+0x48/0x60) from [<c021cc7c>]
(serial_write+0x6c/0xa0)
[<c021cc7c>] (serial_write+0x6c/0xa0) from [<c01b012c>] (tty_put_char
+0x34/0x38)
[<c01b012c>] (tty_put_char+0x34/0x38) from [<c01b314c>] (do_output_char
+0x190/0x1c0)
[<c01b314c>] (do_output_char+0x190/0x1c0) from [<c01b3394>]
(process_echoes+0x1cc/0x280)
[<c01b3394>] (process_echoes+0x1cc/0x280) from [<c01b51fc>]
(n_tty_receive_buf+0xbc0/0x106c)
[<c01b51fc>] (n_tty_receive_buf+0xbc0/0x106c) from [<c01b7688>]
(flush_to_ldisc+0xd4/0x168)
[<c01b7688>] (flush_to_ldisc+0xd4/0x168) from [<c006e230>]
(worker_thread+0x150/0x1c4)
[<c006e230>] (worker_thread+0x150/0x1c4) from [<c00711d4>] (kthread
+0x78/0x80)
[<c00711d4>] (kthread+0x78/0x80) from [<c0034e6c>] (kernel_thread_exit
+0x0/0x8)
---[ end trace 5827570c12dafca6 ]---

There is a long loop of these messages.
can any1 help??




On Oct 20, 10:31 pm, Mikkel Christensen
<mikkel.christen...@ixonos.com> wrote:
> Hello,
>
> When you have finished your initial connectivity problem there is a
> good thread on porting aGPSmodule toAndroidhere:
>
> http://groups.google.com/group/android-porting/browse_thread/thread/c...
>
> Best regards,
>
> Mikkel Christensen
> Chief Software Engineer
> Ixonos Denmark ApS
>
> On Oct 20, 4:42 pm, Hamilton Vera <hamilton.lis...@gmail.com> wrote:
>
> > In fact is the  USB Modem (CDC ACM) support
>
> >   │ Symbol: USB_ACM [=y]
>
> >              │
> >   │ Prompt: USB Modem (CDC ACM) support
>
> >              │
> >   │   Defined at drivers/usb/class/Kconfig:7
>
> >              │
> >   │   Depends on: USB_SUPPORT && USB
>
> >              │
> >   │   Location:
>
> >              │
> >   │     -> Device Drivers
>
> >              │
> >   │       -> USB support (USB_SUPPORT [=y])
>
> >              │
> >   │
>
> > You can set it using:
>
> > setprop ro.kernel.android.gpsttyACM0
>
> > []'s
>
> > Hamilton Vera
>
> > On Wed, Oct 20, 2010 at 12:39 PM, Ashwin Bihari <abih...@gmail.com> wrote:
> > > I've interfaced a UART basedGPSdevice withinAndroidand for that I
> > > wrote a driver that opened up the UART, grab the NMEA strings and
> > > parsed. I use the freerunner'sGPSfile as a starting point,
> > > especially for the NMEA parsing stuff. You can do the same, the only
> > > difference being that instead of opening a UART to get access to the
> > >GPSchip, you'll need to figure out how this USB-basedGPSchip wants
> > > to communicate and open up the device in that manner.
>
> > > If the chip wants to behave like a UART device, you'll want to enable
> > > the USB-Serial driver to create a /dev/ttyACM0 device or something and
> > > read from that device..
>
> > > Regards
> > > -- Ashwin
>
> > > On Wed, Oct 20, 2010 at 2:56 AM, Ne0 <neeraj1...@gmail.com> wrote:
> > >> Hi guys,
> > >> Im trying to interface a USB basedGPSdevice on Beagleboard running
> > >>Androideclair. I have connected theGPSdevice through a USB hub.
>
> > >> Everytime I connect theGPSdevice, i get the following msg on the

Raju Sana

unread,
May 6, 2011, 4:42:31 AM5/6/11
to hamilto...@gmail.com, neera...@gmail.com, android-porting
Hi All,

I am writing this mail since i gone through the mail thread that you have initiated about Android GPS device,

My setup is also similar to your setup , I am using USB-serial adaptor(pl2303) to connect it to the Android device..

My kernel is initialised the ttyUSB0 and  pl2303 is attached to ttyUSB0 .

I am able to open the device node ttyUSB0 and also able to write the  Vendor specific GPS commands to the device node.

But I am not able receive any data from the GPS device through USB-UART interface see the below error.

"IO possible"

We have also tried by connecting the GPS device Ubuntu PC and run the same commands able to receive the  response from the GPS device through the same USB-UART interface.

Any help on this is really appreciated.

Thanks,
Venkat Raju.
Reply all
Reply to author
Forward
0 new messages