Accessing Adafruit Ultimate GPS from Debian BBB

I think I have things setup, but i’m getting weird interactions. Specifically, I can’t seem to get GPSD to work and CGPS, but I can get cat, gpsmon and can access from python over serial.

cgps shows NO FIX and times out after a few seconds.

I can CAT the dev and I see the GPS

root@beaglebone:/# cat /dev/ttyO1

$GPGGA,054109.000,2117.0000,N,15749.0000,W,1,6,1.02,117.9,M,4.7,M,*7C

$GPGSA,A,3,27,16,22,21,31,29,1.37,1.02,0.91*04

$GPRMC,054109.000,A,2117.0000,N,15749.0000,W,1.03,311.83,230614,A*7E

$GPVTG,311.83,T,M,1.03,N,1.91,K,A*3E

GPSMON works

root@beaglebone:/# gpsmon /dev/ttyO1

/dev/ttyO1 9600 8N1 Generic NMEA>

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ

▒Time: 2014-06-23T05:41:51.000Z Lat: 21 17’ 01.841" N Lon: 157 49’ 50.591" W ▒

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Cooked PVT ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ

▒ GPVTG GPGGA GPGSA GPRMC GPGSV ▒

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Sentences ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ

▒Ch PRN Az El S/N ▒▒Time: 054151.000 ▒▒Time: 054151.000 ▒

▒ 0 18 90 65 16 ▒▒Latitude: 2117.0000 N ▒▒Latitude: 2117.0000 ▒

▒ 1 22 181 54 16 ▒▒Longitude: 15749.0000 W ▒▒Longitude: 15749.0000 ▒

▒ 2 21 19 47 13 ▒▒Speed: 1.32 ▒▒Altitude: 122.1 ▒

▒ 3 16 320 39 34 ▒▒Course: 219.11 ▒▒Quality: 1 Sats: 6 ▒

▒ 4 29 83 26 0 ▒▒Status: A FAA: A ▒▒HDOP: 1.28 ▒

▒ 5 31 220 20 15 ▒▒MagVar: ▒▒Geoid: 4.7 ▒

▒ 6 27 312 17 29 ▒▒▒▒▒▒▒▒▒▒▒▒▒ RMC ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ GGA ▒▒▒▒▒▒▒▒▒▒▒▒▒

▒ 7 25 151 14 0 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ

▒ 8 14 170 4 22 ▒▒Mode: A 3 ▒▒UTC: RMS: ▒

▒ 9 15 74 3 18 ▒▒Sats: 27 16 18 22 21 31 ▒▒MAJ: MIN: ▒

▒10 36 0 0 0 ▒▒DOP: H=1.28 V=0.97 P=1.61 ▒▒ORI: LAT: ▒

▒11 ▒▒▒▒▒▒▒▒▒▒▒▒▒ GSA ▒▒▒▒▒▒▒▒▒▒▒▒ٳLON: ALT: ▒

▒▒▒▒▒▒▒ GSV ▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒ GST ▒▒▒▒▒▒▒▒▒▒▒▒▒

(39) $GPVTG,219.11,T,M,1.32,N,2.45,K,A*34\x0d\x0a

root@beaglebone:/#

Background Information

Wiring

Ultimate GPS BBB

RX --------------- P8_24

TX --------------- P8_26

Debian Version

root@beaglebone:/# uname -a

Linux beaglebone 3.8.13-bone50 #1 SMP Tue May 13 13:24:52 UTC 2014 armv7l GNU/Linux

Overlays

root@beaglebone:/# cat /sys/devices/bone_capemgr.9/slots

0: 54:PF—

1: 55:PF—

2: 56:PF—

3: 57:PF—

4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G

5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART1

Any ideas?

Thanks

Did you try the steps at
GPSD redirection page? Thanks for the output
of 'gpsmon', but have you tried launching gpsd with additional
verbosity such as 'gpsd -N -D3 -F /var/run/gpsd.sock'? Can you share
the output?

I was following that…

Is this success?

root@beaglebone:~# gpsd -N -D3 -F /var/run/gpsd.sock

gpsd:INFO: launching (Version 3.6)

gpsd:ERROR: can’t bind to IPv4 port gpsd, Address already in use

gpsd:ERROR: maybe gpsd is already running!

gpsd:INFO: listening on port gpsd

gpsd:INFO: running with effective group ID 20

gpsd:INFO: running with effective user ID 65534

gpsd:INFO: startup at 2014-06-24T05:27:39.000Z (1403587659)

^Cgpsd:WARN: received terminating signal 2.

gpsd:WARN: exiting.

root@beaglebone:~# killall gpsd

gpsd: no process found

root@beaglebone:~# killall gpsd

gpsd: no process found

root@beaglebone:~# gpsd -N -D3 -F /var/run/gpsd.sock

gpsd:INFO: launching (Version 3.6)

gpsd:ERROR: can’t bind to IPv4 port gpsd, Address already in use

gpsd:ERROR: maybe gpsd is already running!

gpsd:INFO: listening on port gpsd

gpsd:INFO: running with effective group ID 20

gpsd:INFO: running with effective user ID 65534

gpsd:INFO: startup at 2014-06-24T05:27:53.000Z (1403587673)

after that… I run CGPS -s and get nothing… NO FIX and exit.

I then tried to run the gpsd service

root@beaglebone:~# gpsd -D3 -F /var/run/gpsd.sock

root@beaglebone:~# ps aux |grep gps

nobody 1538 0.5 0.2 4176 1492 ? S<s 19:32 0:00 gpsd -D3 -F /var/run/gpsd.sock

root 1541 0.0 0.1 3128 724 ttyO0 S+ 19:32 0:00 grep gps

root@beaglebone:~# cgps -s

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ŀ

▒ Time: n/a ▒▒PRN: Elev: Azim: SNR: Used: ▒

▒ Latitude: n/a ▒▒ ▒

▒ Longitude: n/a ▒▒ ▒

▒ Altitude: n/a ▒▒ ▒

▒ Speed: n/a ▒▒ ▒

▒ Heading: n/a ▒▒ ▒

▒ Climb: n/a ▒▒ ▒

▒ Status: NO FIX (0 secs) ▒▒ ▒

▒ Longitude Err: n/a ▒▒ ▒

▒ Latitude Err: n/a ▒▒ ▒

▒ Altitude Err: n/a ▒▒ ▒

▒ Course Err: n/a ▒▒ ▒

▒ Speed Err: n/a ▒▒ ▒

▒ Time offset: n/a ▒▒ ▒

▒ Grid Square: n/a ▒▒ ▒

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

cgps: GPS timeout

Maybe I don’t understand how it works… (very probably) but its weird some things work and others don’t.

Thanks!

It is not a GPS issue, it has something to do with the configuration of systemd. I am having the same issue. gpsd will not start if it uses the default port of 2947, but works on other ports. I am not sure how to fix the configuration issue. systemd is listening to the port for some reasons.

For example starting on port 2948:

`
gpsd -D 3 -n -N /dev/tty01 -S 2948

gpsd:INFO: launching (Version 3.6)
gpsd:INFO: listening on port 2948
gpsd:INFO: NTPD ntpd_link_activate: 1
gpsd:INFO: stashing device /dev/tty01 at slot 0
gpsd:INFO: opening read-only GPS data source type 0 and at ‘/dev/tty01’
gpsd:ERROR: device open failed: No such file or directory - retrying read-only
gpsd:ERROR: read-only device open failed: No such file or directory
gpsd:ERROR: initial GPS device /dev/tty01 open failed
gpsd:INFO: running with effective group ID 20
gpsd:INFO: running with effective user ID 65534
gpsd:INFO: startup at 2014-06-28T21:09:24.000Z (1403989764)

`

Default Port (verified with killall gpsd and rm /var/run/gpsd.sock):
):

`
gpsd -D 3 -n -N /dev/tty01 -S 2947

gpsd:INFO: launching (Version 3.6)
gpsd:ERROR: can’t bind to IPv4 port 2947, Address already in use
gpsd:ERROR: maybe gpsd is already running!
gpsd:INFO: listening on port 2947
gpsd:INFO: NTPD ntpd_link_activate: 1
gpsd:INFO: stashing device /dev/tty01 at slot 0
gpsd:INFO: opening read-only GPS data source type 0 and at ‘/dev/tty01’
gpsd:ERROR: device open failed: No such file or directory - retrying read-only
gpsd:ERROR: read-only device open failed: No such file or directory
gpsd:ERROR: initial GPS device /dev/tty01 open failed
gpsd:INFO: running with effective group ID 20
gpsd:INFO: running with effective user ID 65534
gpsd:INFO: startup at 2014-06-28T21:11:21.000Z (1403989881)

`

lsof -i :2947

`
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1 root 33u IPv4 11356 0t0 TCP localhost:gpsd (LISTEN)

`

lsof -i :2948 returns nothing (with gpsd stopped).

It is not a GPS issue, it has something to do with the configuration of systemd. I am having the same issue. gpsd will not start if it uses the default port of 2947

I was running as root.

I was also running it as root. I ended up re-flashing the eMMC and it started. The issue was the systemd was starting gpsd, but it was not working properly. Prevent it from starting on boot and see if you can manually run gpsd. Running as root, lsof -i :2947, will tell you if it started at boot and once you manually start gpsd, if gpsd is using the port.

I also had a problem with gpsd on BBB running debian/3.8.13-bone50. The issue was that the init script was correct but systemd intercepts the init script before it executes. My fix was to edit /lib/systemd/system/gpsd.service to this:

`
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket

[Service]
EnvironmentFile=/etc/default/gpsd
ExecStart=/usr/sbin/gpsd -N ${GPSD_OPTIONS} ${DEVICES}

[Install]
Also=gpsd.socket
`