betaflight / betaflight

Open Source Flight Controller Firmware
GNU General Public License v3.0
8.62k stars 3.04k forks source link

No telemtry altitude with barometer #10380

Closed maxgame91 closed 11 months ago

maxgame91 commented 3 years ago

Describe the bug

Altitude is not display in the telemetry page on open tx when using a barometer only (work with a gps only)

To Reproduce

A flight controller with a barometer, open tx, and a receiver with telemetry

Expected behavior

Altitude is display when only a barometer is use in the “ALT” sensors

Flight controller configuration

Matek F722-SE with a crossfire nano rx and qx7 with opentx

# 

# diff

# version
# Betaflight / STM32F7X2 (S7X2) 4.2.3 Sep 20 2020 / 20:44:12 (2696b7c88) MSP API: 1.43
# config: manufacturer_id: MTKS, board_name: MATEKF722SE, version: f173f9bc, date: 2019-10-02T14:43:13Z

# start the command batch
batch start

board_name MATEKF722SE
manufacturer_id MTKS

# feature
feature GPS

# beeper
beeper -DISARMING
beeper -ARMING
beeper -ARMING_GPS_FIX
beeper -GPS_STATUS
beeper -ACC_CALIBRATION
beeper -ACC_CALIBRATION_FAIL
beeper -ARMED
beeper -ON_USB
beeper -BLACKBOX_ERASE
beeper -CAM_CONNECTION_OPEN
beeper -RC_SMOOTHING_INIT_FAIL

# map
map TAER1234

# serial
serial 2 2 115200 57600 0 115200
serial 3 2048 115200 57600 0 115200

# aux
aux 0 0 2 1300 1700 0 0
aux 1 13 3 1300 1700 0 0
aux 2 35 1 1300 1700 0 0

# vtxtable
vtxtable bands 6
vtxtable channels 8
vtxtable band 1 BOSCAM_A A CUSTOM  5865 5845 5825 5805 5785 5765 5745 5725
vtxtable band 2 BOSCAM_B B CUSTOM  5733 5752 5771 5790 5809 5828 5847 5866
vtxtable band 3 BOSCAM_E E CUSTOM  5705 5685 5665    0 5885 5905    0    0
vtxtable band 4 FATSHARK F CUSTOM  5740 5760 5780 5800 5820 5840 5860 5880
vtxtable band 5 RACEBAND R CUSTOM  5658 5695 5732 5769 5806 5843 5880 5917
vtxtable band 6 IMD6     I CUSTOM  5732 5765 5828 5840 5866 5740    0    0
vtxtable powerlevels 4
vtxtable powervalues 0 1 2 3
vtxtable powerlabels 25 100 400 900

# master
set dyn_notch_width_percent = 0
set dyn_notch_q = 250
set dyn_notch_min_hz = 125
set dyn_notch_max_hz = 325
set acc_calibration = 105,45,239,1
set serialrx_provider = CRSF
set dshot_bidir = ON
set yaw_motors_reversed = ON
set small_angle = 180
set gps_auto_baud = ON
set osd_link_quality_pos = 2503
set osd_tim_2_pos = 2369
set osd_throttle_pos = 2306
set osd_mah_drawn_pos = 2228
set osd_gps_speed_pos = 2434
set osd_gps_sats_pos = 2242
set osd_altitude_pos = 2273
set osd_avg_cell_voltage_pos = 2423
set debug_mode = GYRO_SCALED
set vtx_band = 5
set vtx_channel = 5
set vtx_power = 2
set vtx_freq = 5806
set gyro_1_align_pitch = 1800
set gyro_1_align_yaw = 1800
set gyro_2_align_yaw = 900
set gyro_rpm_notch_harmonics = 2
set gyro_rpm_notch_min = 125

profile 0

# profile 0
set vbat_sag_compensation = 100
set feedforward_transition = 100
set iterm_relax_cutoff = 10
set throttle_boost = 0
set d_pitch = 32
set f_pitch = 48
set d_roll = 30
set f_roll = 45
set f_yaw = 45
set d_min_roll = 0
set d_min_pitch = 0

rateprofile 0

# rateprofile 0
set roll_rc_rate = 142
set pitch_rc_rate = 142
set yaw_rc_rate = 136
set roll_expo = 70
set pitch_expo = 70
set yaw_expo = 70
set roll_srate = 63
set pitch_srate = 63
set yaw_srate = 63

# end the command batch
batch end

# 
# resource show all
Currently active IO resource assignments:
(reboot to update)
--------------------
A00: SERIAL_TX 4
A01: FREE
A02: SERIAL_TX 2
A03: SERIAL_RX 2
A04: FREE
A05: SPI_SCK 1
A06: SPI_MISO 1
A07: SPI_MOSI 1
A08: FREE
A09: FREE
A10: FREE
A11: USB
A12: USB
A13: LED 2
A14: LED 1
A15: FREE
B00: MOTOR 3
B01: MOTOR 4
B02: GYRO_CS 1
B03: FREE
B04: MOTOR 1
B05: MOTOR 2
B06: FREE
B07: FREE
B08: I2C_SCL 1
B09: I2C_SDA 1
B10: SERIAL_TX 3
B11: SERIAL_RX 3
B12: OSD_CS
B13: SPI_SCK 2
B14: SPI_MISO 2
B15: SPI_MOSI 2
C00: FREE
C01: ADC_CURR
C02: ADC_BATT
C03: FREE
C04: GYRO_EXTI
C05: FREE
C06: FREE
C07: FREE
C08: PINIO 1
C09: PINIO 2
C10: SPI_SCK 3
C11: SPI_MISO 3
C12: SPI_MOSI 3
C13: BEEPER
C14: FREE
C15: GYRO_CS 2
D00: FREE
D01: FREE
D02: SDCARD_CS
D03: FREE
D04: FREE
D05: FREE
D06: FREE
D07: FREE
D08: FREE
D09: FREE
D10: FREE
D11: FREE
D12: FREE
D13: FREE
D14: FREE
D15: FREE
E00: FREE
E01: FREE
E02: FREE
E03: FREE
E04: FREE
E05: FREE
E06: FREE
E07: FREE
E08: FREE
E09: FREE
E10: FREE
E11: FREE
E12: FREE
E13: FREE
E14: FREE
E15: FREE
F00: FREE
F01: FREE
F02: FREE
F03: FREE
F04: FREE
F05: FREE
F06: FREE
F07: FREE
F08: FREE
F09: FREE
F10: FREE
F11: FREE
F12: FREE
F13: FREE
F14: FREE
F15: FREE

Currently active Timers:
-----------------------
TIM1: FREE
TIM2: FREE
TIM3: FREE
TIM4: FREE
TIM5: FREE
TIM6: FREE
TIM7: FREE
TIM8:
    CH1: DSHOT_BITBANG 2
TIM9: FREE
TIM10: FREE
TIM11: FREE
TIM12: FREE
TIM13: FREE
TIM14: FREE

Currently active DMA:
--------------------
DMA1 Stream 0: FREE
DMA1 Stream 1: FREE
DMA1 Stream 2: FREE
DMA1 Stream 3: FREE
DMA1 Stream 4: FREE
DMA1 Stream 5: FREE
DMA1 Stream 6: FREE
DMA1 Stream 7: FREE
DMA2 Stream 0: ADC
DMA2 Stream 1: FREE
DMA2 Stream 2: DSHOT_BITBANG 2
DMA2 Stream 3: FREE
DMA2 Stream 4: FREE
DMA2 Stream 5: FREE
DMA2 Stream 6: FREE
DMA2 Stream 7: FREE

Setup / Versions

Why the altitude in the barometer is not shown in the telemetry page. I need to have the altitude from the barometer to fly legally. I use a logical function to have an altitude limit for my drone

maxgame91 commented 3 years ago

@mikeller add betaflight version and hardware.

maxgame91 commented 3 years ago

@etracer65 add some info. If you need more things please tell me why. thanks

etracer65 commented 3 years ago

Read the info when you created the issue.

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Flight controller configuration Create a diff and post it here in a code block. Put `` (three backticks) at the start and end of thediff` block (instructions on how to do a diff: https://oscarliang.com/use-diff-not-dump-betaflight/)

Use resource show all to create a resource allocation list and post it here in a code block. Put ``` (three backticks) at the start and end of the output block.

Setup / Versions

  • Flight controller [what type is it, where was it bought from];
  • Other components [RX, VTX, brand / model for all of them, firmware version where applicable];
  • how are the different components wired up.

Additional context Add any other context about the problem here.

no-response[bot] commented 3 years ago

This issue has been automatically closed because the information we asked to be provided when opening it was not supplied by the original author. With only the information that is currently in the issue, we don't have enough information to take action.

maxgame91 commented 3 years ago

So I update with all the information ask, thanks

wildjokerss commented 3 years ago

If it helps with ruling out anything, I'm having the same issue on Betaflight 4.2.6 in a Matek F405-CTR AIO. Crossfire 4.10 on a TX16S Baro is working fine on OSD and also see the graph moving on the betaflight configurator. Radio has openTX 2.3.10.

If you need my help let me know and I'll get you more data, was troubleshooting this just now and landed in this bug report.

mikeller commented 3 years ago

@maxgame91: Unfortunately in CRSF telemetry, the only place where the altitude is sent is in the GPS frame:

https://github.com/betaflight/betaflight/blob/21eea5db21c88f927d6d955452734539ddfb4ec8/src/main/telemetry/crsf.c#L157-L178

To make matters more complicated, the altitude sent is absolute altitude, which isn't available from a barometer only.

Not sure there is a good way to improve this unless a different frame type with a field for relative altitude is added to the protocol.

wildjokerss commented 3 years ago

Question from someone that does not really understand much of programming. Isn't there a way to implement into Betaflight a CLI command to change between altitude sensors? As in, report barometer altitude like if it was GPS data? this would probably be a suitable solution. Is there another alternative? Like log a bug on TBS CRSF?

etracer65 commented 3 years ago

Question from someone that does not really understand much of programming. Isn't there a way to implement into Betaflight a CLI command to change between altitude sensors? As in, report barometer altitude like if it was GPS data? this would probably be a suitable solution. Is there another alternative? Like log a bug on TBS CRSF?

This is not the problem. The problem is that CRSF telemetry only has as altitude field in the frame that contains GPS data. So the only way to send altitude is by sending all the GPS data. With no GPS we don't have anything to send.

mikeller commented 3 years ago

@wildjokerss: The only way to implement a 'fix' for this in Betaflight will be to, in the case of a barometer but no GPS being found, GPS frames with bogus GPS location / speed / ... and a relative altitude in the field designated for the absolute altitude are sent. This would be a truly poor 'fix'.

wildjokerss commented 3 years ago

Ok understood. So if I wanted to have Barometer telemetry on the radio, what would have to be done? Meaning, is it on betaflight side, crossfire side... Guess a feature request would have to be made to one of the two? For example, would it work with a telemetry enabled FrSky receiver?

Also, on the page 45 from the PDF below it states that the data source for Alt is TBS GPS or FC, I am guessing that it's either TBS GPS connected directly to the receiver or data coming from the FC but as GPS packets? Can't we trick somehow betaflight in putting out barometer values through the GPS altitude?

https://www.team-blacksheep.com/tbs-crossfire-manual.pdf

Apologies if my wording is not the best, I'm not a native English speaker nor a developer :D

mikeller commented 3 years ago

@wildjokerss: There simply is no field in the CRSF telemetry to return relative altitude, and there is no way to get an absolute altitude from a barometer only. Opening a feature request with TBS to have an 'altitude' telemetry frame type added might get this addressed. Or else you can buy a GPS (does not have to be TBS) and install it, or switch radio protocols.

wildjokerss commented 3 years ago

that's pretty much what I was expecting yes, I'll see if I can log a feature request with TBS, not really sure where or how, if you have a link at hand feel free to share :D I'll look for it anyway :) Thanks for the explanation @mikeller !

wildjokerss commented 3 years ago

okay feedback for anyone looking for this as well, I've raised a ticket with TBS, looking to see their reply

Romdrone commented 3 years ago

Hi, I'd love a barometer alt in tracer.!!!! Thanks for keeping me in the loop for any info!

wildjokerss commented 3 years ago

I the meantime I haven't had any further update from TBS, apart from their email below:

weve added this to t he feature request list and will work on getting it added This was on the 2nd of March, not sure if applicable to Tracer as well.

Romdrone commented 3 years ago

Well I guess we'll see. 👍

Le sam. 20 mars 2021 à 18:20, wildjokerss @.***> a écrit :

I the meantime I haven't had any further update from TBS, apart from their email below:

weve added this to t he feature request list and will work on getting it added This was on the 2nd of March, not sure if applicable to Tracer as well.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/betaflight/betaflight/issues/10380#issuecomment-803429315, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATKIVFLWIEFSITMKCMW25OLTETKPDANCNFSM4ULAE2DQ .

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week.

github-actions[bot] commented 3 years ago

Issue closed automatically as inactive.

franz4949 commented 2 years ago

@wildjokerss and others Isn't there any progress on TBS side for adding a barometric alt field to its CRSF protocol? Same problem I now have with an ELRS Matek Vario receiver, which has a barometric VSpd but no barometric Alt. And Matek is pointing to the limitation of the CRSF protocol with missing Barometric altitude sensor field/ID.

VancouverUmbrella commented 2 years ago

I'm in the same boat as @franz4949 above: The inability to get barometric altitude data from Matek vario receivers greatly reduces their usefulness for me. The same restriction applies to Matek CRSF-PWM converters.

Support at Matek informed me that, "I have seen CRSF V3 support Baro ALT, but ELRS and EDGETX don't support CRSF V3".

Can anyone at TBS comment on whether there's a resolution in sight?

Might any resolution depend on changes in ELRS, EdgeTx, and OpenTx?

haslinghuis commented 2 years ago

Also see: https://github.com/betaflight/betaflight/pull/11070

haslinghuis commented 2 years ago

Closing as inactive

VancouverUmbrella commented 2 years ago

FYI TBS has agreed to add a baro_alt field to CRSF:

https://github.com/EdgeTX/edgetx/pull/1819 https://github.com/ExpressLRS/ExpressLRS/pull/1528\

OpenTx has also agreed to the necessary mods.