[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to forward RTCM data to gpsd?

From: Kristoff
Subject: Re: how to forward RTCM data to gpsd?
Date: Thu, 10 Dec 2020 00:39:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


On 9/12/2020 2:19 a.m., Gary E. Miller wrote:
I am new to the mailing-list, with just a quick question.
Can somebody provide a quick overview of what gpsd expects RTCM
messages should look like?
gpsd does not care.  gpsd just forwaards to the GNSS receiver.  The
receivers are very picky.

Apparently, gpsd will only forward it if the format it receives matches what it think it should receive.

As part of an exercise to learn Software Defined Radio and GNU Radio,
I "build" a receiver in GNU Radio for the marine DGPS radio-stations
in the mediumwave band, including some python-code to decode the RTCM
messages. (not yep posted online .. first code-clean-up :-) )
gpsd can also decode them.  Check out drivers/driver_rtcm[23].c

did that. However, driver_rtcm is the higher-layer code. The lower layer is done by isgps.c.

If you look at the the data structures as found on rtcm2, they do not match how the bits are transmitted on the air. The structures are based on words (32 bit) with the 2 "pad" bits being the 2 last bits of the previous word (which have to be repeated).

So, this  means that something is reordering the datastream -as transmitted on air- to this structure: either the DGPS receiver, or isgps.c.

I did look at isgps.c, but -to be honest- it looks more like a CTF challenge in a cybersecurity conference.

So the question remains, what is the format that gpsd expect from a tcp-feed?

So, as I now have that, I guess it would be fun to actually use this
RTCM data for something useful, e.g. feed it into gpsd so it gets
forward to my ublox GNSS-receiver.
Much variation in how u-blox chips handle RTCM.  Most can not handle it
at all.  Those that do are picky about the sentence mix.

We'll see that when we get there.

My plan is to write a small TCP-server in python and let dgps connect
to it.
You will find little improvement in the accuracy of a recent receiver
unless the RTCM bas is very close (<0.5 km)

I live about 2 km from the dgps station, so that should not be so bad.

Now, the question is, what is the format for RTCM messages should
look like?
They should look exactly like RTCM messages.  The trick is what your
receiver wants.
At this point, the trick is to know that gpsd want. If that does not match, it it will even think of relaying the message.

2/ The marine DGPS radio-service uses bit-inversion (i.e. all
databits of the RTCM word are inverted if the bit proceeding that
word is 1).
Whatever the spec says, so that.

gpsd has several samples:

I had already looked at it. It's clearly not the bitformat as transmitted on air.

Same thing for sample.rtcm2

If you run gpsdecode on the rtcm2 file, it are all type-9 messages. As the message type-number comes just after the sync-pattern, you should see 01100110 before or after 100100 (or with bits inverted or reversed).
Try looking for that!

Also, if you look at the output of gpsdecode for that file, you have 44 type-9 messages with length 4 (6 words in total), and 87 message with length 5 (7 words in total). so, in total that is 873 words, or -if if you take a word being 32 bits instead of just 30-, that is equivalent to 3492 bytes. The sample.rtcm2 file -if you strip of the comments in the beginning- is 4690 octets.
This means there is all kind of other stuff in that file too.
Same thing for rtcm2.log

I do not know if this so for all RTCM messages. or if this is
something specific for the marine DGPS service.
Dunno.  All gpsd does it take RTCM in and pass it on.

Is there still somebody on the list who actually wrote or maintains that code?

Just stuff the bits as I receive them from the radio to gpsd?
Well, you wrote the radio part.  So write your radio so that is
the case.  Like everyone else did.

The radio just creates bits one by one, and -if you look at the specs that are out there- that just matches how it is received.

Kristoff (on1arf)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]