Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure Quectel LC29HBS #425

Open
jupiter9595 opened this issue Aug 26, 2024 · 7 comments
Open

How to configure Quectel LC29HBS #425

jupiter9595 opened this issue Aug 26, 2024 · 7 comments

Comments

@jupiter9595
Copy link

Waveshare has refered RTKBase in their LC29HBS board description https://www.waveshare.com/wiki/LC29H(XX)_GPS/RTK_HAT

Looks like their configuration was successful but they did not show Main Service configuration details.

Has anyone successfully configure this GNSS unit?

RTKBase does not detect this unit.
How to correctly configure this unit?
Are Base coordinates fill in automatically when unit is detected?
I put the following coordinates: 49.208601 19.072489 1050 and RTKBase says format is not correct.

Please help to configure RTKBase unit

@jupiter9595
Copy link
Author

Coordinates format I've figured out myself by looking at input fields defined pattern. Altitude should have at least 2 decimal places 1050.00 in this case

@deece
Copy link

deece commented Sep 7, 2024

LC29H(BS) Initial Configuration:
Connect to the unit using QGNSS. In the console, data input, Advanced, select: Text format: ASCII, Checksum Type: NMEA, Suffix: CRLF

In Data Input, enter the following (as per Quectel_LC29HBS_GNSS_Protocol_Specification_V1.1-1.pdf):

Check firmware version:
$PQTMVERNO*

Enable MSM7 messages
$PAIR432,1*

Enable Station Reference Message 1005
$PAIR434,1*

Enable Ephemeris messages
$PAIR436,1*

Crank the baud rate up (Could also go 3000000)
$PAIR864,0,0,921600*

Enable NMEA GGA Time, position, and fix related data
$PAIR062,0,1*

Enable NMEA GLL Position data: position fix, time of position fix, and status
$PAIR062,1,1*

Enable NMEA GSA GPS DOP and active satellites
$PAIR062,2,1*

Enable NMEA GSV Satellite information
$PAIR062,3,1*

Enable NMEA RMC Position, velocity, and time
$PAIR062,4,1*

Enable NMEA VTG Track made good and speed over ground
$PAIR062,5,1*

Enable NMEA ZDA UTC day, month, and year, and local time zone offset
$PAIR062,6,1*

Enable NMEA GRS GRS range residuals
$PAIR062,7,1*

Enable NMEA GST Position error statistics
$PAIR062,8,1*

Save parameters
$PQTMSAVEPAR*

Power cycle the unit, reconnect at the new baud rate

Start Survey-in (1 day duration)
$PQTMCFGSVIN,W,1,86400,15,0,0,0*

You will see PQTMSVINSTATUS repeating, when the third field=2, the survey-in is complete. Fields 8, 9 & 10 are the mean ECEF coordinates. Convert these to lat/long/elevation above ellipsoid to enter into RTKBase. You may have to prune some places after the decimal point for height before the parser will accept it:

import numpy as np

# Constants
a = 6378137.0  # WGS-84 Earth semimajor axis (m)
f = 1 / 298.257223563  # WGS-84 flattening
e2 = f * (2 - f)  # Square of eccentricity

# Input ECEF coordinates (X, Y, Z)
X, Y, Z = -123456789.0000, 1263456789.000, -123456789.1234

# Calculate longitude
longitude = np.arctan2(Y, X)

# Iterative calculation of latitude and height
p = np.sqrt(X**2 + Y**2)
lat = np.arctan2(Z, p * (1 - e2))  # Initial guess for latitude
lat_prev = 0
h = 0

# Iterate until convergence
while abs(lat - lat_prev) > 1e-12:
    lat_prev = lat
    N = a / np.sqrt(1 - e2 * np.sin(lat)**2)  # Prime vertical radius of curvature
    h = p / np.cos(lat) - N
    lat = np.arctan2(Z, p * (1 - e2 * N / (N + h)))

# Convert latitude and longitude to degrees
latitude = np.degrees(lat)
longitude = np.degrees(longitude)

latitude, longitude, h

When complete, save parameters
$PQTMSAVEPAR*

@deece
Copy link

deece commented Sep 7, 2024

For detection:
$PQTMVERNO*

returns:
$PQTMVERNO,LC29HBSNR11A01S,2023/02/13,10:14:06*

The pertinent information to detect this is:
LC29HBS

@jupiter9595
Copy link
Author

@deece - thanks a lot for this comprehensive guide! Have you ever got RTK fix status with this board? I read in internet, people get RTK float only.

@deece
Copy link

deece commented Sep 7, 2024

I only got my base station functional tonight, I probably won't be at a point where I have rover for months.

@deece
Copy link

deece commented Sep 19, 2024

@jupiter9595 Care to give this PR a try? #432

You can find the full tree here: https://github.com/deece/rtkbase/tree/lc29hbs

@benpeterson40
Copy link

What would be command to install the lc29hbs branch.

I did get the lc29hbs and LG290P working with rtkbase but was interested in checking out your more automated install process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants