unable to read GR-401 gps data with gpsdev or gpsReceiver

5 次查看(过去 30 天)
I have Navisys GR-401 gps receiver which works just fine with SiRF-Live. I know it uses COM3, but I am unable to read data with matlab.
with:
s = serialport('COM3',9600);
gps = gpsdev(s,'OutputFormat',"timetable");
and
read(gps)
gives error:
Obtaining the required NMEA sentences (RMC, GGA and GSA) is taking longer than expected. Verify the physical connection of the GPS device to the specified serial port and the configuration of the GPS device.
also
gps = gpsReceiver('COM3');
and
read(gps)
gives error
Warning: Unsuccessful read: The input buffer was filled before the Terminator was reached.
'serial' unable to read all requested data. For more information on possible reasons, see Serial Read Warnings.
any ideas what is the culprit here?

回答(2 个)

Umar
Umar 2024-9-5

Hi @Sven Larsen ,

To address the issues you are facing with your Navisys GR-401 GPS receiver in MATLAB as posted in your comments listed below, I will suggest the following steps to resolve these issues mentioned below.

Timeout Error: The error message indicates that obtaining the required NMEA sentences (RMC, GGA, and GSA) is taking longer than expected. This could be due to the GPS receiver not receiving a valid GPS fix, or Incorrect settings or configurations in the GPS receiver, or Physical connection issues between the GPS receiver and your computer.

Buffer Read Warning: The warning about unsuccessful reads suggests that the input buffer filled before the terminator was reached. This can occur if the GPS device is not sending data in the expected format or the read command is being issued too quickly for the device to respond.

Possible steps to resolve the above mentioned issues

First, review the mathworks documentation listed below.

Physical Connection: Verify that the GPS receiver is physically connected to the correct COM port and ensure that the wiring is done correctly. Check that the RX and TX lines are properly connected (i.e., RX on the GPS should connect to TX on the serial adapter and vice versa).

Baud Rate Configuration: Confirm that the GPS device is configured to operate at the correct baud rate (9600 bps). If the device is set to a different baud rate, MATLAB will not be able to interpret the data correctly.

NMEA Sentence Availability: The most common reason for the error messages is that the GPS receiver does not have a satellite lock, which is necessary to produce the required NMEA sentences. In order to resolve this issue, make sure that the GPS antenna is placed in an open area with a clear view of the sky to obtain a satellite fix. The LED indicator on the GPS module can provide information about the satellite fix status.

Additional suggestions

Use a serial terminal program to connect to the COM port and manually check if the GPS is outputting NMEA sentences. This can help isolate whether the issue is with MATLAB or the GPS device itself.

Mathworks documentation: It is beneficial to review the MathWorks documentation for the gpsdev and serialport functions to make sure that all parameters are set correctly. Specific attention should be paid to the expected output formats and any additional configuration that might be necessary for your GPS receiver. Please see attached links below.

https://www.mathworks.com/help/nav/ref/gpsdev.read.html

https://www.mathworks.com/help/nav/ref/gpsdev-system-object.html

Testing with Other Software: If possible, test the GPS receiver with another software (like a GPS application on a mobile device) to make sure that it functions correctly outside of MATLAB.

If problems persist, it may be worthwhile to consult the manufacturer's documentation or seek support from MATLAB forums.


Star Strider
Star Strider 2024-9-5
I did an Interweb search, however I was not able to finid anything specific about your Navisys GR-401 and MATLAB, so apparently there is no specific way to interface with it (such as a Hardware Support Package). The only suggestiion I can offer is to consider using extractNMEASentence or nmeeaParser if you have access to them. The InterNav Products page does not appear to have anything that could be useful to you.

类别

Help CenterFile Exchange 中查找有关 Financial Toolbox 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by