Using “diff all” vs. “dump” in Betaflight CLI: The Pros and Cons

by Oscar

A new command, “diff,” was introduced in Betaflight 3.0. It’s much better than using “dump” for troubleshooting and managing parameters in CLI. Still, some people are not aware of it, so I thought I might mention it here.

Some of the links on this page are affiliate links. I receive a commission (at no extra cost to you) if you make a purchase after clicking on one of these affiliate links. This helps support the free content for the community on this website. Please read our Affiliate Link Policy for more information.

The Betaflight ‘diff’ and ‘diff all’ commands greatly simplify configuration management by only displaying CLI values that have changed.

What Does “dump” Do?

“dump” simply prints all the settings in the console, which can be over 1000 lines long.

What Are”diff” and “diff all”?

There are two command variants: “diff” and “diff all.”

  • “diff” prints only the parameters in the current profile and current rate profiles that have changed from the default. By adding the argument “showdefaults” (entering “diff showdefaults” in CLI), the original values are also displayed in a comment line (beginning with a #) for all changed values. Generally around 150 lines.
  • “diff all” displays only the values in all profiles and rate profiles that are different from the default values. By adding the argument “showdefaults,” the original values are also displayed in a comment line (beginning with a #) for all changed values. Generally around 250 lines.

Why Use “diff” Over “dump”?

When using “diff,” you no longer need to go over all the settings, only the ones that are different from defaults. This greatly simplifies parameter and feature management and makes troubleshooting easier.

This also works better for firmware updates. When you need to make a setting backup, you can use “diff all showdefaults.” The list is likely to be much shorter.

This post is not saying we should replace “dump” with “diff all” entirely, the “dump” command will still be useful in some cases. But unless you have a good reason to use “dump”, always use “diff” :)

In fact, the new backup method “Save Preset” basically saves a copy of the “diff all” output in a text file.

Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.

8 comments

AngryPepper 5th November 2021 - 3:09 pm

I’m sorry, but I’m a bit confused, to retain a backup of my current settings to go back to if I make a mistake, what is the correct cli input? Is it, diff, diff all, diff all defaults, or dump.

Reply
Mike H. 5th November 2021 - 3:04 pm

Sorry, I’m just a little confused and I don’t want to copy and paste the wrong file. If I want to update to BF 4.2.x, and want to retain a backup of the current values Incase I need to go back, or I make an error while updating, what’s the correct CLI command, “diff”, “diff all”, “diff all defaults”, or “dump”. Thanks.

Reply
Thomas V 27th November 2020 - 3:34 pm

There is one thing to be careful of when using Diff. It is not consistent when you want to get back to an earlier situation reliably. Lets take “roll_rc_rate” as an example. Your initial state is roll_rc_rate at default. You run a diff, save it somewhere nice. Now you go and change the roll_rc_rate and run a diff. If you want to go back to your initial state, you cannot simply load the earlier diff since the state of roll_rc_rate is not in that diff at all (because defaults are not there).

Reply
Jeremy Knight 15th May 2019 - 9:20 am

Can anyone tell me what settings are backed up in Configuration > Configuration Backup > xxx.json (as separate from any sort of cli dump)

Many thanks

Jeremy

Reply
William A. 15th June 2018 - 1:38 pm

can you use diff from beta flight on butter flight

Reply
Kim 9th December 2017 - 6:02 pm

Do any of you know of some repository for default and/or customized betaflight configurations? Obviously a lot of people put their configurations here or there, but a central shared repo would be extremely useful.

Reply
Hayward 14th November 2017 - 9:59 am

Just to update this – seems like since Betaflight 3.2 – the parameter is “defaults” not “showdefaults”

Reply
OhGeez! 1st December 2017 - 4:52 am

Thank you Hayward. I’m on 3.1 and I could get “showdefaults” to work. “diff all defaults” did the trick.

Reply