Sponsored Content
Full Discussion: GPS-Tracker script [Android]
Top Forums Shell Programming and Scripting GPS-Tracker script [Android] Post 302539087 by al0x on Friday 15th of July 2011 07:46:08 AM
Old 07-15-2011
GPS-Tracker script [Android]

Hi UNIX-Forum!

I don't know if this is the right Forum for my question, but since Android technically is a UNIX-based system...

I have a rooted Android and a Terminal emulator and bash installed.
I wanted to write a little script for my android that activates GPS, gets the location and sends it via SMS to another phone.
My first problem is that I can't find anywhere how to activate GPS from the shell. Is it even possible? There should be something, no?

Many thanks if someone could help me on this kind of special Topic!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

event scheduler/tracker script

Dear All, I am writing an event tracker shell script as part of a personal project. I am trying 2 write a sort of date math function using the GNU date command. This function would allow 2 search 4 future events, like looking 4 events 1 or 2 days ahead 4 instance. I've used the date command b4... (1 Reply)
Discussion started by: theangrybeaver
1 Replies

2. Shell Programming and Scripting

Getting MAC from GPS unit

Never mind i got the answer thanks., (0 Replies)
Discussion started by: deaconf19
0 Replies

3. UNIX for Dummies Questions & Answers

install linux on GPS device?

hi all, this might be a silly question, but... a few years ago, i bought a Nortech Navigation E-GPS010. this is a car/hand-held GPS unit that, for a while, worked pretty well. in fact, it still works well. the map version on my GPS is dated 2006, so i thought i'd upgrade; however, the crappy... (10 Replies)
Discussion started by: jmd9qs
10 Replies

4. Shell Programming and Scripting

shell script to insert data from gps.txt to mysql database

Hi, I have gps receiver, by using gpsd data i can read gps log data to my database(my sql). Steps: 1. telenet localhost 2947 > gps.txt (press enter) 2. r (press enter) //then i will get the data like below in gps.txt file Trying 127.0.0.1... Connected to localhost.... (1 Reply)
Discussion started by: gudivada213
1 Replies

5. Shell Programming and Scripting

shell script to read a line in gps receiver log file and append that line to new file

Hi, I have gps receiver log..its giving readings .like below Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GPSD,R=1 $GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies

6. Android

Android Scripting Environment: Shell Scripting and Android

I just upgraded to Android 2.2 from 2.1. The GPS issue that was troublesome in 2.1 seems to have been fixed. Some of web browsing seems faster, but it could just be my connection is better today ;) Flash works in some browsers but not very good and it is too slow for Flash apps designed for... (0 Replies)
Discussion started by: Neo
0 Replies

7. Android

Problem with torrents and bash script on Android

Please disregard this post (0 Replies)
Discussion started by: johnnybopper
0 Replies

8. AIX

GPS Clock Not Synchronised

Hi guys, I got some error on my application server mentioning that gps clock not sync to my db server. what is the command to check is my server is sync with the gps clock? appreciate if you guys can let me know how to troubleshoot this problem. Thanks (1 Reply)
Discussion started by: leecopper
1 Replies

9. Shell Programming and Scripting

UTC to GPS

Gents, Kindly can u help with this. I would like to get GPS time from UTC Input 17/11/27 03:13:50:480000 17/11/27 03:12:54:380000 17/11/27 03:14:39:980000 output desired. 17/11/27 03:13:50:480000 1195787648480000 17/11/27 03:12:54:380000 1195787592380000 17/11/27... (6 Replies)
Discussion started by: jiam912
6 Replies

10. UNIX for Beginners Questions & Answers

Android Device ID Changer shell script

this is worked "ANDROID NOUGAT" how can i use it for "ANDROID OREO" -plz help me... ------------------------------------------- echo " Ã-~-DEVICE ID CHANGINGÃ-~-" sleep 2 echo " " COUNT=1 while do ; echo "settings put secure android_id " | tr -d '\n' > X1... (4 Replies)
Discussion started by: f4is4l
4 Replies
GPSCTL(1)							GPSD Documentation							 GPSCTL(1)

NAME
gpsctl - control the modes of a GPS SYNOPSIS
gpsctl [-h] [-b | -n] [-x control] [-e] [-f] [-l] [-s speed] [-t devicetype] [-D debuglevel] [-V] [serial-port] DESCRIPTION
gpsctl can switch a dual-mode GPS between NMEA and vendor-binary modes. It can also be used to set the device baudrate. Note: Not all devices have these capabilities. If you have only one GPS attached to your machine, and gpsd is running, it is not necessary to specify the device; gpsctl does its work through gpsd, which will locate it for you. When gpsd is not running, the device specification is required, and you will almost certainly need to be running as root in order to have write access to the device. The program accepts the following options: -b Put the GPS into binary mode. After the GPS resets itself, autobaud to the new speed. -c Change the GPS's cycle time. Units are seconds. Note, most GPSes have a fixed cycle time of 1 second. -e Generate the packet from any other arguments specified and ship it to standard output instead of the device. This switch can be used with the -t option without specifying a device. Note: the packet data for a binary prototype will be raw, not ASCII-ized in any way. -f Force low-level access (not through the daemon). -l List a table showing which option switches can be applied to which device types, and exit. -n Put GPS into NMEA mode. After the GPS resets itself autobaud to its new speed. -s Set the baud rate at which the GPS emits packets. Use this option with caution. On USB and Bluetooth GPSes it is also possible for serial mode setting to fail either because the serial adaptor chip does not support non-8N1 modes or because the device firmware does not properly synchronize the serial adaptor chip with the UART on the GPS chipset when the speed changes. These failures can hang your device, possibly requiring a GPS power cycle or (in extreme cases) physically disconnecting the NVRAM backup battery. -t Force the device type. -x Send a specified control string to the GPS; gpsctl will provide packet headers and trailers and checksum as appropriate for binary packet types, and whatever checksum and trailer is required for text packet types. (You must include the leading $ for NMEA packets.) When sending to a UBX device, the first two bytes of the string supplied will become the message class and type, and the remainder the payload. When sending to a Navcom NCT or Trimble TSIP device, the first byte is interpreted as the command ID and the rest as payload. When sending to a Zodiac device, the first two bytes are used as a message ID of type little-endian short, and the remainder as payload in byte pairs interpreted as little-endian short. For all other supported binary GPSes (notably including SiRF) the string is taken as the entire message payload and wrapped with appropriate header, trailer and checksum bytes. C-style backslash escapes in the string, notably xNN for hex, will be interpreted; additionally, e will be replaced with ESC. This switch implies -f. -T Change the sampling timeout. Defaults to 4 seconds, which should always be sufficient to get a packet from a device emitting at the normal rate of 1 per second. -h Display program usage and exit. -D Set level of debug messages. -V Display program version and exit. The argument of the forcing option. -t, should be a string which should be contained in exactly one of the known driver names; for a list, do gpsctl -l. Forcing the device type behaves somewhat differently depending on whether this tool is going through the daemon or not. In high-level mode, if the device that daemon selects for you doesn't match the driver you specified, gpsctl exits with a warning. (This may be useful in scripts.) In low-level mode, if the device identifies as a Generic NMEA, use the selected driver instead. This will be useful if you have a GPS device of known type that is in NMEA mode and not responding to probes. (This option was originally implemented for talking to SiRFStar I chips, which don't respond to the normal SiRF ID probe.) If no options are given, the program will display a message identifying the GPS type of the selected device and exit. Reset (-r) operations must stand alone; others can be combined. Multiple options will be executed in tis order: mode changes (-b and -n) first, speed changes (-s) second, and control-string sends (-c) last. EXAMPLES
gpsctl /dev/ttyUSB0 Attempt to identify the device on USB serial device 0. Time out after the default number of seconds. Adding the -f will force low-level access and suppress the normal complaint when this tool can't find a GPSD to work through. gpsctl -f -n -s 9600 /dev/ttyUSB0 Use low-level operations (not going through a gpsd instance) to switch a GPS to NMEA mode at 9600bps. The tool will identify the GPS type itself. BUGS
SiRF GPSes can only be identified by the success of an attempt to flip them into SiRF binary mode. Thus, the process of probing one of these running in NMEA will change its behavior. SEE ALSO
gpsd(8), gpsdctl(8), gps(1), libgps(3), libgpsd(3), gpsprof(1), gpsfake(1). AUTHOR
Eric S. Raymond esr@thyrsus.com. The GPSD Project 29 Oct 2006 GPSCTL(1)
All times are GMT -4. The time now is 01:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy