Table of Content
How to configure and use GPS
device names
- /dev/ttyO1: before there was serdev in kernel
- /dev/ttyGPS0: serdev based driver
- /dev/gnss0: driver based on gnss framework
Enable power
Power is controlled automatically by the kernel if you open the device. The GPS module is powered down if you close the device.
To control Antenna power you can use:
rfkill unblock gps # enable VSIM
resp
rfkill block gps # disable VSIM
Read device file (use 9600 baud!)
If the gps device is a tty, you need to set the baudrate, not needed in case of /dev/gnss0 stty 9600 </dev/ttyO1 (or ttyGPS0, depending on kernel )
cat gpsdevice
Internal/external antenna detection
if the external antenna is active can be determined through
cat /sys/class/switch/gps_antenna/state # "external" or "internal"