Tim, Chris,
Over a month ago I experimented with getting GPSD and the Tunderbolt working
together.
I quickly added support for the missing TSIP packet types, and was able to get
xgps to display lat, long, time and constellation status. I did manage to
get NTP to work, have not invested the time into getting the 1PPS signal
working under FreeBSD yet.
I have attached my patches against the gpsd source repository. Note that I
did not invest much time understanding the internals of gpsd beforehand so
some aspects may not be fully implemented.
--
Wayne ZL2BKC
On Fri, Jun 13, 2008 at 8:58 AM, Christian Vogel <vogelchr at vogel.cx> wrote:
> gpsd: GPS Time 485697.250000 1483 14.000000
that's encouraging
> gpsd: Sat info: mode 1, satellites used 5: 18 9 28 15 26
As is this.
> gpsd: Unhandled TSIP superpacket type 0xab
"thar's yer problem"... kinda.
yes, we don't handle 0xAB, but that's just timing information. I see
no indication that the receiver is outputting position reports. I
should have this sorted a few hours after my Thunderbolt arrives.
Guess I need to prod the receiver into telling me where it thinks it
is.
> Unfortunately, it does not show any information about time or position on
> a connected cgps/xgps client.
>
> Chris
>
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to
https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>
Index: autogen.sh
===================================================================
--- autogen.sh (revision 4691)
+++ autogen.sh (working copy)
@@ -94,11 +94,11 @@
fi
echo Configuring build environment for gpsd
-aclocal \
+aclocal-1.7 \
&& libtoolize --force --copy \
- && autoheader --force \
- && automake --add-missing --foreign --copy --include-deps \
- && autoconf --force \
+ && autoheader-2.59 --force \
+ && automake-1.7 --add-missing --foreign --copy --include-deps \
+ && autoconf-2.59 --force \
&& echo Now running configure to configure gpsd \
&& echo "./configure $@" \
&& ./configure $@
Index: tsip.c
===================================================================
--- tsip.c (revision 4691)
+++ tsip.c (working copy)
@@ -63,7 +63,7 @@
/* XXX this is not always a good idea; not all receivers are 8O1... */
session->driver.tsip.parity = session->gpsdata.parity;
session->driver.tsip.stopbits = session->gpsdata.stopbits;
- gpsd_set_speed(session, session->gpsdata.baudrate, 'O', 1);
+ gpsd_set_speed(session, session->gpsdata.baudrate, 'N', 1);
break;
case 1:
@@ -653,6 +653,90 @@
session->gpsdata.fix.track += 360.0;
mask |= TIME_SET | LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET | STATUS_SET | MODE_SET | CYCLE_START_SET;
break;
+
+
+ case 0xab: /* Thunderbolt Timing Superpacket */
+ if (len != 17) {
+ gpsd_report(4, "pkt 0xab len=%d\n", len);
+ break;
+ }
+ session->driver.tsip.last_41 = now; /* keep timestamp for request */
+ f1 = getul(buf,1); /* gpstime */
+ s1 = getuw(buf,5); /* week */
+ u1 = getsw(buf,7); /* leap seconds */
+
+ session->driver.tsip.gps_week = s1;
+ if ((int)u1 > 10) {
+ session->context->leap_seconds = (int)u1;
+ session->context->valid |= LEAP_SECOND_VALID;
+
+ session->gpsdata.fix.time = session->gpsdata.sentence_time =
+ gpstime_to_unix((int)s1, f1) - (double)u1;
+ mask |= TIME_SET;
+ }
+
+ gpsd_report(4, "GPS Time %f %d %d\n", f1, s1, u1);
+ break;
+
+
+ case 0xac: /* Thunderbolt Position Superpacket */
+ if (len != 68) {
+ gpsd_report(4, "pkt 0xac len=%d\n", len);
+
+ break;
+ }
+ session->gpsdata.fix.latitude = getd(buf,36) * RAD_2_DEG;
+ session->gpsdata.fix.longitude = getd(buf,44) * RAD_2_DEG;
+ session->gpsdata.fix.altitude = getd(buf,52);
+ f1 = getf(buf,16); /* clock bias */
+
+ u1 = getub(buf, 12); /* GPS Decoding Status */
+ u2 = getub(buf, 1); /* Reciever Mode */
+ if (u1 != (u_int8_t)0) {
+ session->gpsdata.status = STATUS_NO_FIX;
+ mask |= STATUS_SET;
+ }
+ else {
+ if (session->gpsdata.status < STATUS_FIX) {
+ session->gpsdata.status = STATUS_FIX;
+ mask |= STATUS_SET;
+ }
+ }
+
+ /* Decode Fix modes */
+ switch (u2 & 7) {
+ case 6: /* Clock Hold 2D */
+ case 3: /* 2D Position Fix */
+ //session->gpsdata.status = STATUS_FIX;
+ session->gpsdata.fix.mode = MODE_2D;
+ break;
+ case 7: /* Thunderbolt overdetermined clock */
+ case 4: /* 3D position Fix */
+ //session->gpsdata.status = STATUS_FIX;
+ session->gpsdata.fix.mode = MODE_3D;
+ break;
+ default:
+ //session->gpsdata.status = STATUS_NO_FIX;
+ session->gpsdata.fix.mode = MODE_NO_FIX;
+ break;
+ }
+
+ gpsd_report(4, "GPS status=%u mode=%u\n", u1, u2);
+ gpsd_report(4, "GPS DP LLA %f %f %f\n",session->gpsdata.fix.latitude,
+ session->gpsdata.fix.longitude,
+ session->gpsdata.fix.altitude);
+
+ /* AC superpacket does not contain taime. Used value saved from AB packet */
+ if (session->gpsdata.sentence_time) {
+ session->gpsdata.fix.time = session->gpsdata.sentence_time;
+ mask |= TIME_SET;
+ gpsd_report(4, "GPS fixtime %u\n", (unsigned int)session->gpsdata.fix.time);
+ }
+
+ mask |= LATLON_SET | ALTITUDE_SET | CYCLE_START_SET | STATUS_SET | MODE_SET;
+ break;
+
+
default:
gpsd_report(LOG_WARN,"Unhandled TSIP superpacket type 0x%02x\n",u1);
}
_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.