Hi Gary!
Thanks for your reply. The GNSS receiver I am using is the ALLYSTAR HD8040.
I have collected the gpsd running logs, which can be found in the attached file gpsd.log. At the same time, I have also collected the logs from the GNSS receiver, which can be found in the attached file serial.log.
I have tried the superraw mode, but I could not receive any textual data other than NMEA. My experimental method was to manually send textual data to ttyS3, but `gpspipe -R` did not print out the textual data I sent to ttyS3.
Then, I carefully read the gpsd source code and found that the data transmission process is roughly as follows:
GNSS receiver --> ttyS3 --> GPSD calls read() function --> lexer.inbuffer --> lexer.outbuffer --> upper-layer applications
By printing the data in `lexer.inbuffer`, I found that it stored the raw data I needed, including binary data and NMEA sentences. However, the `lexer.outbuffer` filters out the binary data and discards some critical information. And I discovered that the superraw mode uses the data in `lexer.outbuffer`, which is not the complete data set I want.
Therefore, I would like to know if there is an API that can directly access the data in `lexer.inbuffer`?
Sincerely,
Yantao Zhang
Yo 张延涛!
On Fri, 22 Mar 2024 22:52:33 +0800
张延涛 <zh6tao@gmail.com> wrote:
> I am currently working on gpsd 3.25
Cool. What GNSS receiver?
> and want to get the raw data that
> gpsd reads from the serial port. The raw data includes binary data,
> NMEA data, and other non-NMEA type textual data. I would like to know
> if gpsd has an API that allows me to call and obtain the raw data?
The quick way is "gpspipe -R". The API way it to do a ?WATCH and
ask for superraw mode.
> Before asking this question, I have already tried the following:
>
> - Using `gpspipe -R` I found that I could not get any data types
> other than NMEA sentences;
"gpspipe -R" sends whatever come in the serial port. If all you see
is NMEA, then that is all your receiver is sending.
You can use wireshark to confirm
> - Using the `gps_read()` function, I could not obtain the raw data
> either.
Ditto my last comment.
If you can send ut the first 60 seconds of your gpsd log that will
answer many questions. Do it this way:
gpsd -nND 6 /dev/ttyS0 > gpsd.log 2>&1
Let that run 60 seconds, the send us gpsd.log.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem@rellim.com Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can't measure it, you can't improve it." - Lord Kelvin