Git Product home page Git Product logo

gps-glonass-android-driver's Introduction

gps-glonass-android-driver

GPS/GLONASS generic android driver for serial devices. (gps.default.so)

It uses ro.kernel.android.gps, ro.kernel.android.gps.speed and ro.kernel.android.gps.max_rate kernel parameters.

Installation

Just copy the library to /system/lib/hw/ folder add properties to build.prop and reboot device.

Kernel properties

build.prop example:

  ro.kernel.android.gps=ttyUSB0
  ro.kernel.android.gps.speed=9600
  ro.kernel.android.gps.max_rate=1

Properties description

  • ro.kernel.android.gps - [REQUIRED] Device name
  • ro.kernel.android.gps.speed - [NON REQUIRED] Baud rate. Supports: 4800, 9600, 19200, 38400, 57600, 115200. Default value: 9600
  • ro.kernel.android.gps.max_rate - [NON REQUIRED] Maximum refresh rate. Between 1-10Hz. Default value: 1

IMPORTANT Higher max refresh rate causes higher CPU load. Recommended value is 1Hz (car navigation, etc)

init.d script

On some devices the library cannot set baudrate itself, in that case you can use the folowing script. Call it 00_gps.sh, save it in init.d folder, add 755 permisions and root as an owner.

#!/system/bin/sh
# GPS Switcher
# init.d 00_gps.sh
# [email protected]

GPSTTY=/dev/`getprop ro.kernel.android.gps`
SPEED=`getprop ro.kernel.android.gps.speed`

if [[ ! -z $GPSTTY ]] ; then

	# Default speed
	if [[ -z $SPEED ]] ; then
		SPEED="9600"
	fi;
	
	# Serial device params
	if [ -c $GPSTTY ] ; then
		echo "Setting USB GPS $GPSTTY speed to $SPEED"
		# Speed
		busybox stty -F $GPSTTY ispeed $SPEED
		# No echo
		busybox stty -F $GPSTTY -echo
		# Owner
		chown root:system $GPSTTY
		# Permissions
		chmod 666 $GPSTTY
	fi;
	
fi;

*** busybox required

gps-glonass-android-driver's People

Contributors

dipcore avatar kostya740 avatar xaxexa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gps-glonass-android-driver's Issues

E/gps_glonass_serial( 1051): could not open gps serial device /dev/ttyGS0: Permission denied

Hi! First of all thank you for your precious effort on this project.

After successfully using your driver on an Android-x86 virtual device, I'm trying to install it on my ARM Samsung Galaxy Note III (running stock Android 5.0 Lollipop).

Though I'm facing this permission error:

E/gps_glonass_serial( 1051): could not open gps serial device /dev/ttyGS0: Permission denied

Which is logged in dmesg. I already checked the device permissions and they seem correct (-rw-rw---).
What can be the cause?

A problem with gps

Hallo!
Thank you for your work.
I try to connect gps to my OrangePi with Android 4.4. I see properly NMEA data on /dev/ttyS2 (use cat /dev/ttyS2), but gps soft (like GPS test) don't see receiver. I use you script, and I set correct right on ttyS2. Whan have I do to get it works?
Can you help me with my problem?
Thank you.

u-blox

Добрый день!
Покажите, пожалуйста, у меня usb gps u-blox, ваша библиотека поддерживает эти устройства?
Запуск устройства в командной строке происходит (координаты получаю), драйвера pl2303.ko видит, но навигационные программы местоположение не определяют.

problem, the library does not see the GPS

GPS USB pl2303 chip, the kernel finds a device that creates /dev/ttyUSB0, and the library says that there is no such file, NMEA data goes processor amlogic s912

logcat
`01-01 05:00:25.974 4133 4145 D gps_glonass_serial: serial_gps_init

01-01 05:00:25.974 4133 4145 D gps_glonass_serial: gps_state_init

01-01 05:00:25.974 4133 4145 E gps_glonass_serial: could not open gps serial device /dev/ttyUSB0: No such file or director`

dmesg
`[ 6.202214@1] usbcore: registered new interface driver pl2303

[ 6.202563@1] usbserial: USB Serial support registered for pl2303
[ 29.648246@4] pl2303 1-1.1:1.0: pl2303 converter detected

[ 29.649899@4] usb 1-1.1: pl2303 converter now attached to ttyUSB0`

Unreadable NMEA

I've implemented everything correctly, but the results from the NMEA can't be read.
cat /dev/ttyS0: �����������������������
can you help me to solve this problem?

strange messages sent to GPS receiver

Hello!

First of all, thanks for Your efforts! :)

Why do You use these strange messages to disable output of GPS receiver?
$PUBX,40,GGA,100,100,100,05b
$PUBX,40,GLL,100,100,100,0
5d
$PUBX,40,VTG,100,100,100,05f
$PUBX,40,GSA,100,100,100,0
4f
$PUBX,40,GSV,100,100,100,058
$PUBX,40,RMC,100,100,100,0
46

I understand that PUBX,40 is a proprietary ublox message to control output of the receiver, but value 100 is unknown! Only 1 and 0 are valid - based on official documentation - and in some case, value 100 causes hanging of my receiver! Why do You try to use 100 instead of official 0 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.