Posts: 1,411
Threads: 122
Likes Received: 1,426 in 740 posts
Likes Given: 1,125
Joined: Jun 2019
Reputation:
42 I have the Flywoo compass/baro unit, it’s an add on item that uses the sda/scl pads. I’ve noticed when I fly without gps lock that altitude is accurate and all good. Once gps kicks in with enough satellites for a fix then altitude goes to crap with (what I believe) is gps data providing altitude.
Is there a way in the cli to ensure baro always takes preference over gps for altitude?
Thanks guys,
Ph2t.
• Posts: 4,550
Threads: 38
Likes Received: 1,245 in 1,064 posts
Likes Given: 430
Joined: Aug 2020
Reputation:
118 30-May-2021, 10:58 AM (This post was last modified: 30-May-2021, 11:47 PM by kafie1980.) What version of Betaflight are you using? This was a known issue in older version of Betaflight where if you got a GPS lock after take off the Altitude data would be trash.
Most people do not notice this issue as they either wait for a GPS lock or at time they do not have any Barometer onboard to notice the values suddenly appear garbage in the OSD.
Basically, in Betaflight altitude is derived from the barometer (if available), GPS (if available), or a combination of both (default).
Try and run the CLI command:
get position_alt_source
It should return back:
position_alt_source = DEFAULT
Allowed values: DEFAULT, BARO_ONLY, GPS_ONLY
Then set it to BARO_ONLY:
set position_alt_source BARO_ONLY
Do not forget to save.
This works for all my quads that are on BetaFlight 4.2 and I cant remember which version of 4.1 had the fix applied.
Posts: 1,411
Threads: 122
Likes Received: 1,426 in 740 posts
Likes Given: 1,125
Joined: Jun 2019
Reputation:
42 Thanks Kafie, I tried this but got errors when attempting to set it to BARO_ONLY. It says something along the lines of can't set name. I'll check again and post. Also when I issue the STATUS command I see that I2C Errors is 1. I wonder it that's linked?
The BARO does work I believe, configurator shows it as active in the graphic legend at the top of the program when connected to the FC. When I fly without any GPS lock altitude appears to be accurate, if I get a GPS lock then altitude goes screwy as I know the FC is now taking the altitude data from the GPS.
• Posts: 4,550
Threads: 38
Likes Received: 1,245 in 1,064 posts
Likes Given: 430
Joined: Aug 2020
Reputation:
118 01-Jun-2021, 07:43 AM (This post was last modified: 01-Jun-2021, 07:46 AM by kafie1980.) I tried this to double check before I posted on both my SourceOne (Lumenier LUX F7 Ultimate) and Explorer (HGLRC 722 mini) builds but in both cases I have FC's with onboard barometers.
Perhaps the behaviour is different if the barometer is connected via I2C. I do not have anything setup with an external barometer via I2C to test.
Can you show a screen grab of the errors when you run the commands via CLI? How about you disable GPS first and try?
•