TS-7180 GPS: Difference between revisions

From embeddedTS Manuals
No edit summary
(Clean up GPS text and mention how to start gpsd at boot)
 
Line 1: Line 1:
[[File:TS-7180-GPS-Antenna.png|300px]]
[[File:TS-7180-GPS-Antenna.png|300px]]


The TS-7180 has an optional on-board [http://www.telit.com/gnss/sl869/ Telit SL869] GPS receiver. An SMA female connector is provided for the connection of an antenna. This is accessible at /dev/ttymxc7 where the GPS provides NMEA strings.
The TS-7180 has an optional on-board [http://www.telit.com/gnss/sl869/ Telit SL869] GPS receiver, accessible at <code>/dev/ttymxc7</code>, through which the GPS provides NMEA strings. An SMA female connector is provided for attaching an antenna.  


The GPS power is controllable through a GPIO.  For example:
The GPS power is controllable through a GPIO.  For example:
Line 8: Line 8:
gpioset 5 19=0 # turn off GPS
gpioset 5 19=0 # turn off GPS
</source>
</source>
By default the GPS module is powered on.
By default, the GPS module is powered on when the board starts up.


A typical way of interfacing with the GPS is using gpsd.  For example, under Debian:
A typical way of interfacing with the GPS is using <code>gpsd</code>.  For example, under Debian, load these packages:
<source lang=bash>
<source lang=bash>
apt install gpsd gpsd-clients -y
apt install gpsd gpsd-clients -y
</source>
</source>
Then edit /etc/default/gpsd and change these two options:
Then edit <code>/etc/default/gpsd</code> and enable and/or change these two variables:
<pre>
<syntaxhighlight lang="bash">
# Devices gpsd should collect to at boot time.
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
# They need to be read/writeable, either by user gpsd or the group dialout.
Line 22: Line 22:
# Other options you want to pass to gpsd
# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"
GPSD_OPTIONS="-n"
</pre>
</syntaxhighlight>


Then restart gpsd:
Then restart gpsd:
Line 29: Line 29:
</source>
</source>


This allows clients from command line, or from most programming languages to interface with the GPS through gpsd:
For testing, run <code>gpsmon</code> to see lock, coordinates, and time information.
 
You will likely want <code>gpsd</code> to start automatically at boot. To make this always happen, type:
<source lang=bash>
systemctl enable gpsd
</source>
 
Finally, the following article describes writing clients that interface with <code>gpsd</code>, which can do so from most programming languages:
* [https://gpsd.gitlab.io/gpsd/client-howto.html gpsd writing clients]
* [https://gpsd.gitlab.io/gpsd/client-howto.html gpsd writing clients]
For testing run "gpsmon" to see lock, coordinates, and time information.

Latest revision as of 16:01, 31 August 2021

TS-7180-GPS-Antenna.png

The TS-7180 has an optional on-board Telit SL869 GPS receiver, accessible at /dev/ttymxc7, through which the GPS provides NMEA strings. An SMA female connector is provided for attaching an antenna.

The GPS power is controllable through a GPIO. For example:

gpioset 5 19=1 # turn on GPS
gpioset 5 19=0 # turn off GPS

By default, the GPS module is powered on when the board starts up.

A typical way of interfacing with the GPS is using gpsd. For example, under Debian, load these packages:

apt install gpsd gpsd-clients -y

Then edit /etc/default/gpsd and enable and/or change these two variables:

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttymxc7"

# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"

Then restart gpsd:

service gpsd restart

For testing, run gpsmon to see lock, coordinates, and time information.

You will likely want gpsd to start automatically at boot. To make this always happen, type:

systemctl enable gpsd

Finally, the following article describes writing clients that interface with gpsd, which can do so from most programming languages: