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

CRSF Distinct GPS Altitude from Barometric Altiude #5852

Open
1 task done
JimB40 opened this issue Jan 29, 2025 · 5 comments
Open
1 task done

CRSF Distinct GPS Altitude from Barometric Altiude #5852

JimB40 opened this issue Jan 29, 2025 · 5 comments
Labels
enhancement ✨ New feature or request telemetry 📶

Comments

@JimB40
Copy link
Collaborator

JimB40 commented Jan 29, 2025

Is there an existing issue for this feature request?

  • I have searched the existing issues

Is your feature request related to a problem?

Seems that for now EdgeTX uses for both values the same sensor name "Alt"

  1. If FC is equiped with barometer and GPS is connected - "Alt" Sensor wil hold barometric altitude value
  2. Same case if GPS is connected - "Alt" Sensor will hold GPS altitude value (barometric altitude is not available anymore)

Those are different values so would be good to retain both.

Describe the solution you'd like

  1. Barometric altitude uses STR_SENSOR_ALT "Alt"
  2. GPS altitude uses STR_SENSOR_GPSALT "GAlt"

Describe alternatives you've considered

No response

Additional context

No response

@JimB40 JimB40 added the enhancement ✨ New feature or request label Jan 29, 2025
@3djc
Copy link
Collaborator

3djc commented Jan 29, 2025

Name don't have to be unique for telemetry sensors. In your example, are both actually sent by FC ? Because if they are, you should already get both today.

Here you can see that we treat GPS Alt and Baro Alt distinctively:

enum CrossfireSensorIndexes {

@JimB40
Copy link
Collaborator Author

JimB40 commented Jan 29, 2025

AFAIU

GPS 0x02 frame

  1. FC (ie Betaflight) encodes GPS data and sends CRSF frame
    https://github.com/betaflight/betaflight/blob/b277364b2cd79d7d7d7192c8a48603fe38638f67/src/main/telemetry/crsf.c#L259

  2. EdgeTX gets this CRSF frame and decodes values

    processCrossfireTelemetryValue(GPS_ALTITUDE_INDEX, value - 1000);

  3. EdgeTX creates sensor using as name STR_SENSOR_ALT "Alt"

    CS(GPS_ID, 4, STR_SENSOR_ALT, UNIT_METERS, 0),

same happens for Barometric Altitude & Vertical Speed 0x09 frame

  1. BF Encoding
    https://github.com/betaflight/betaflight/blob/b277364b2cd79d7d7d7192c8a48603fe38638f67/src/main/telemetry/crsf.c#L347

  2. EdgeTX Decoding

    case BARO_ALT_ID:

  3. EdgeTX creates sensor using as name STR_SENSOR_ALT "Alt" (the same)

    CS(BARO_ALT_ID, 0, STR_SENSOR_ALT, UNIT_METERS, 2),

What do you mean?
I should have two sensors named "Alt"?

@3djc
Copy link
Collaborator

3djc commented Jan 29, 2025

Exactly, which is why I'm wondering if there is a mechanism in BF that says don't send alt twice or similar

@JimB40
Copy link
Collaborator Author

JimB40 commented Jan 29, 2025

0x09 frame has also Vertical Speed information. VERTICAL_SPEED_INDEX

processCrossfireTelemetryValue(VERTICAL_SPEED_INDEX, value);

But VSpd never shows.
It might be on BF side that 0x09 is not send

Can we log somehow recieved CRSF frames types?

@3djc
Copy link
Collaborator

3djc commented Jan 29, 2025

You can mirror the telemetry stream on a serial port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request telemetry 📶
Projects
None yet
Development

No branches or pull requests

3 participants