GPS via Serial

Discuss Scroll Tablet PC Hardware Upgrades/Mods/Hacks here.

GPS via Serial

Postby jamescoxon » April 24th, 2011, 6:23 pm

Expanding on accessing the hardware serial port on the scroll tablet I linked up a GPS module today and got it to report its position - wasn't completely straight forward and currently is only providing the raw data however it is a start.

1) Open up the scroll tablet WARNING THIS WILL VOID YOUR WARRENTY, looking at the hardware compared to previously posted images my version is more integrated with a single board.

Main board - http://www.flickr.com/photos/jcoxon77/5649906783

2) Identify the Serial port pads, there are 4 small solder pads close to the SD card slot,

Serial Port - http://www.flickr.com/photos/jcoxon77/5649905993

From bottom to top (away from SD slot)
GND
Rx
Tx
Vcc

These are 3.3v TTL pads.

3) Solder some wires to these pads and attach to your 3.3v Serial port - PC/Laptops don't have 3.3v serial ports so you'll need some form of convertor such as http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=356
To access the Scroll's debug console you'll need some form of terminal - I personally use kermit, you'll need to set the serial baud rate to 115200. Remember that tx->rx and rx->tx when attaching the scroll to the usb serial port.

4) Boot the scroll - you'll see lots of debug, once the scroll has booted you'll be dropped into a root console (this actually means you don't need to root your machine - though it'll help for the next step.)

5) To get GPS data onto your scroll you'll need a GPS that outputs data over serial at 3.3v - in this example I've used a GPSbee http://www.seeedstudio.com/depot/gps-bee-50-channel-ublox-5-p-560.html with a simple breakout board. I've powered it separately from some batteries through a voltage regulator but you 'should' (but untested) be able to run it directly from the VCC pad.
As the scroll's serial port is set at 115200 and by default this GPS is set at 9600 I first power up the GPSbee and connect it via the usb serial port to the computer, you can view the data stream in the terminal you used to see the debug console (but first changing it to 9600). We need to send a command to the GPSbee to set it to run at a baud rate of 115200 so:

Code: Select all
echo "\$PUBX,41,1,0007,0003,115200,0*18" > /dev/tty.usbserial


Now when you view the GPS's data you'll have to set it to 115200 rather than 9600. This setting isn't saved by this GPS module so we need to continue powering it, we now can connect it to the scroll's serial port.

http://www.flickr.com/photos/jcoxon77/5649905427

6) Your scroll needs to be rooted and to view the data in a nice gui you should install http://code.google.com/p/android-serialport-api/downloads/detail?name=SerialPort_0.7.apk&can=2&q= which contains a nice program called Serial Port which allows you to access this device.

7) Open up SerialPort, go to settings and select the right serial port (tccSCA0) and the baud rate is 115200, then go back to the main menu and select console - you should start seeing the GPS's nmea data:

http://www.flickr.com/photos/jcoxon77/5650471942


Yes this is quite complicated for a relatively simple setup but its a first start, I haven't worked out yet how to change the baud rate of the scroll's serial port - i suspect it is set by the kernel at boot or we may need to compile a binary such as stty. My plan is not to actually attach the GPS directly to the serial port but to instead put an arduino mini pro in between, this arduino will allow me to have more then just a GPS attached such as temperature sensors and leds etc. The arduino will communicate with the scroll using its hardware serial and the GPS will be attached using software serial.

Scroll <-hardware serial-> Arduino <-software serial-> GPS

There is a quite a bit of space inside the scroll, especially around the battery pack so it shouldn't be too hard to fit everything inside!

Here comes the cool part. If we can match up the baudrate and stop the console posting to ttySCA0 then we should be able to get android to actually regard our hacked GPS as an internal GPS. In /init.tcc92xx.rc there is a commented out section regarding
Code: Select all
setprop ro.kernel.android.gps tcc-uart0


If its not possible to change the debug serial speed then the arduino in the middle will allow us to get round this - the arduino can easily be made to forward anything it receives on its software serial to its hardware serial and this will convert the baud rates appropriately. Of course I haven't tested this at all - just a theory (though someone has thought of it before http://www.slatedroid.com/topic/13293-pl2303-and-other-usb-to-serial-modules/
jamescoxon
New Scroller
New Scroller
 
Posts: 9
Joined: April 23rd, 2011, 11:15 am

Re: GPS via Serial

Postby RichardP » April 24th, 2011, 7:44 pm

The USB Serial works, I just dont know how to modify the system startup so that it insmods the kernel modules at boot. I used a PL2303 device.

I tried to get a USB hub working... has anyone got one working ? (Eventually I wanted to get a DVB-T device to run)
Scroll v2 (SCR051624) - Another MAPLIN device destined for the scrapheap
Firmware 1.02s
z4Root
LauncherPro
RichardP
Scroll Apprentice
Scroll Apprentice
 
Posts: 46
Joined: April 3rd, 2011, 12:47 pm

Re: GPS via Serial - Lots of pictures

Postby RichardP » April 25th, 2011, 8:03 am

Scroll v2 (SCR051624) - Another MAPLIN device destined for the scrapheap
Firmware 1.02s
z4Root
LauncherPro
RichardP
Scroll Apprentice
Scroll Apprentice
 
Posts: 46
Joined: April 3rd, 2011, 12:47 pm

Re: GPS via Serial

Postby jamescoxon » April 25th, 2011, 8:33 am

Great work on the pictures - Certainly interesting about the non-populated areas - the CPU has 6 serial ports in theory so perhaps one more of those appears from those pads - will have a look with a multimeter.

Aim to try and get android to recognise my gps as its own internal GPS today. Will be on irc if anyone wants to help out.
jamescoxon
New Scroller
New Scroller
 
Posts: 9
Joined: April 23rd, 2011, 11:15 am

Re: GPS via Serial

Postby RichardP » April 25th, 2011, 8:42 am

Keep in mind that many serial ports double as I2C or SPI ports and are changeable using a registers. I see there are two I2C ports are registered in the kernel bootup. (perhaps shared ports) I am yet to identify the accelerometer and the orientation sensors.. they dont jump out and bite me :D

Will be in IRC soon 8-)
Scroll v2 (SCR051624) - Another MAPLIN device destined for the scrapheap
Firmware 1.02s
z4Root
LauncherPro
RichardP
Scroll Apprentice
Scroll Apprentice
 
Posts: 46
Joined: April 3rd, 2011, 12:47 pm

Re: GPS via Serial

Postby bloggs » May 1st, 2011, 9:10 pm

I've managed to get the Android framework to take data from a PL2303 based USB GPS by replacing the Scroll's libgps.so with a slightly modified version from the Android on Freerunner project. I now have a 7'' SatNav running Copilot Live 8 :D . I haven't tried any other mapping s/w yet, but so long as it has offline maps I don't see why it wouldn't work.

To use the USB I had to replace the boot image so that I could insmod the PL2303 driver at boot time, but if you're using the internal serial/console port, I think you'll only need to set the ro.kernel.android.gps to point to the correct serial port, and replace the libgps.so in /system/lib . I've added support for another property which I've named ro.kernel.android.gpsbaud which can be used to set the tty baud rate if needed for a particular device. If you don't define this property it defaults to B4800 as this is a common serial GPS baud rate (and suits my device!).

I'm not sure about the forum's attachment policy, but the libgps.so file is only about 18kbytes, so if anyone wants to try it out I can post it here.

Eddie
Scroll Options 51624 Firmware: 1.02s Kernel: 2.6.29 Android Version: Sometimes 2.3.4 CM7 Sometimes 2.1 !
bloggs
Scroll Sergeant
Scroll Sergeant
 
Posts: 55
Joined: April 25th, 2011, 10:51 am

Re: GPS via Serial

Postby Fonefixer » May 2nd, 2011, 7:34 am

Eddie: So long as the file is freely available on the net, and is not subject to any copyright problems you can post a link to it.

Id suggest uploading it to the likes of "megaupload" and posting a link to it on here if required.
Dave

Employees are like mules. Some you stand in front of and coax them along with a carrot. Some you stand behind and kick them in the arse. The key to management is knowing which mules are which!
User avatar
Fonefixer
Honoured Contributor
Honoured Contributor
 
Posts: 1372
Joined: January 2nd, 2011, 8:31 am
Location: Vertical & Breathing
Real Name: Dave
Scroll Version: Scroll Excel

Re: GPS via Serial

Postby jamescoxon » May 2nd, 2011, 8:04 am

Please do post the link - I'd be happy to try it out - on my system using the internal serial port.

Annoyingly the internal serial port does not work below 19200 baud - you can set it to go at 4800 or 9600 but the data is always garbled whatever the source is. Guess the work around is to use a GPS that defaults to a higher baud rate or perhaps put a microprocessor in the way which can forward the data onwards. I'm planning on eventually doing option 2 as I think it would be cool to add a few more sensors etc to the scroll tablet.

james
jamescoxon
New Scroller
New Scroller
 
Posts: 9
Joined: April 23rd, 2011, 11:15 am

Re: GPS via Serial

Postby bloggs » May 4th, 2011, 10:28 am

Please do post the link - I'd be happy to try it out - on my system using the internal serial port.


You can find two versions at the link below. One is a debug version which might be of use to you as it sends (to logcat) lots of debug info about the characters received, and the messages assembled. The other is simply a "release" version with all the debug removed to save cpu/clutter in logcat.

By default it will use /dev/ttyUSB0 at 4800 baud, but you can change port and baud rate by setting :-

ro.kernel.android.gps=your device
ro.kernel.android.gpsttybaud=your baudrate

I expect the easiest place to set these is in the /system/build.prop file.


http://www.megaupload.com/?d=24CKLCQ8


Good luck!

Eddie
Scroll Options 51624 Firmware: 1.02s Kernel: 2.6.29 Android Version: Sometimes 2.3.4 CM7 Sometimes 2.1 !
bloggs
Scroll Sergeant
Scroll Sergeant
 
Posts: 55
Joined: April 25th, 2011, 10:51 am


Return to HARDWARE

Who is online

Users browsing this forum: No registered users and 0 guests

cron