Good day everyone! Welcome back to TMac FPV - Your home for your "Journey to
Better" FPV Fun, Flights, and Racing Stuff! Today we're gonna delve into the mystery
of the command line interface. We'll take a look at what it is, why it's there, and
should we be afraid of it because it's taunting us with that empty space? Not at
all! We'll take a look at a few useful commands to put into that empty space to
make our lives a little bit easier and discover why the CLI is actually our
friend! Stay tuned. This is your Betaflight configurator and, as the banner
states, it's a utility designed to simplify updating, configuring, and tuning
of your flight controller. The configurator is your graphical user
interface which allows you to program your flight controller with the most
frequently used commands. For this session we'll be using our HGLRC Arrow 3
Hybrid connected to our Betaflight configurator. The configurator version
that we'll be using is 10.5.1 which is required for Betaflight
4.0 and above. The firmware that we have loaded on our HGLRC Arrow 3
Hybrid is 4.0.5. As I mentioned, the configurator (or the graphical user
interface) contains the most frequently used commands to program your quadcopter's
flight controller. However, the CLI tab, or the command line interface, is
where you can directly interface with the flight controller for all of the
commands not just the most frequently used ones.
Here's that blank space I was talking about and we're gonna go over a few
commands which are not necessarily in the graphical user interface or the GUI
but will be useful for you at some point in time. In this video we'll be going
over about 10 or 11 useful commands which you can put in this space. The
first one we'll take a look at is "help," the command "help." We type in "help" in the
command line and what this does is list the available commands in alphabetical
order. The next three commands that we'll take a look at - or one of these is what
you want to accomplish any time you get a brand-new
BNF quadcopter (Bind-and-Fly) quadcopter and hook it up to your
computer through Betaflight for the first time. Or, if you've got a new flight
controller the first time you hook it up to your computer you want to save the
original settings on your quadcopter or your flight controller before you go and
make any changes just in case you happen to make a mistake you can always revert
back to the original settings. So the three commands that we'll take a look at
are "dump," "diff," and "diff all." "Dump" you just type the word dump and it lists
everything on your flight controller. Starting with the word "dump" - is the
command we input so all of this information from "Version" on down - see
here we've got version 4.0.5 dated 1 August 2019 on our HGLRC Arrow 3 Hybrid. All
this information from "version" on down you can go ahead and highlight then. This
is everything on the flight controller. Hit copy then go to a word document or
your text editor, click paste. Since the text is in white I need to highlight it
and put it back in black so I can read it. Black. And now I've got all of the
original commands that are on the flight controller and I'll just save it
to a folder somewhere on my computer where I know where it's at so that if I
need to access it and revert back to the original commands, the only way-the best
way to do it is to go to that file which you saved of your original commands,
highlight it, copy it, go back to the CLI, paste, hit return.
And it's inputting all of those commands into the flight controller. Then
anytime you make any changes to your flight controller in your quadcopter
using the CLI (once this is done) you'll want to use the command "save" which is
our next command that we want to take a look at. "Save" saves all of your changes
and reboots the flight controller and goes back to your GUI. We want to go back
to the CLI. So that's one way to use the command "dump,"
getting all of the settings all on your flight controller in your quadcopter
prior to making any changes to it. There are, there are two other commands which
will do the similar thing except the list isn't that long. So the next command
we're going to take a look at is "diff." Type that in and it's a much shorter
list. You can see that it took much less time. So here's our, here's our "diff" list
which you can tell is much shorter than the "dump" command. What "diff" does is it
lists only those settings which are different than the default Betaflight
settings. Here you can see it lists the name that I have for my Arrow 3 Hybrid
is TMac FPV Arrow 3. Obviously, that's not a default Betaflight setting. One
key thing to keep in mind about "diff" is it only lists the current profile. But
you can also do the same thing with this- highlight it, copy it, and paste it to a
word document or your text editor. Save it to a folder and then you've got saved
these settings which are different than the default Betaflight settings. So, take
a look at these profiles here for "diff." Profile 0 and rate profile
1. The next command we're going to take a look at is "diff all."
Type "diff all" and here we have all of the settings which are different than
the Betaflight default settings but in "diff all's" case, instead of only profile 0
and rate profile 1 we have all of the rate profiles. And you can see that I've
got different-I've got 3 different rate profiles established for my Arrow 3
Hybrid. The next command that we'll go over is "status." Type "status" into the
command line, hit enter, and this gives you the current status of your system.
The next two commands that we want to take a look at are "get" G-E-T and "set." And
we'll take a look at an example of how these two work in conjunction with one
another. For this example we've switched over to our FlexRC Colugo
3-inch micro quad which has a GPS installed on it. So we're going to type
in the command "get" - and you want to get a specific variable that you provide. So, in
this case, the example we're going to use is for the GPS and I want to get all
associated commands to GPS. So, I'm gonna say "get GPS." And these are all the
commands associated with GPS. So you can take a look at how your (in this case)
GPS is set up based on these commands. One of the things I wanted to point out
with the "get" command is it not only returns to you the current value of the
GPS - for example GPS rescue angle of 35 - but it also provides you with the
allowed range and what the default value is. So this is valuable information
which you can obtain through the CLI just by using the "get" command and adding
whatever variable you want after the word "get." Now one of the reasons you
might want to use this is, let's say I want to change
the minimum number of satellites I need to use a GPS rescue. Here it is. Here's
the command GPS_rescue_min_sats. I've currently got it set to 5. The allowed
range is 5 to 50 and the default value is 8. So you can see that I've already
changed it from the default value to a minimum of-or to my minimum value of-5.
Let's say I wanted to change it for some reason to 7. So the way to do that is to
use the "set" command and I just copy this. Copy, type in the word "set," - and remember
I'm going to change it to 7 now. I'm going to paste what I just copied and
just change this number from 5 to 7. I hit enter, and then once again we want to
type in the word "save" or the "save" command to make that change. Hit enter.
It saves and reboots. We go back to the CLI. I'm gonna type in "get GPS"
again to see if it made the change. Let's go to our min satellites. GPS_rescue_
min_satellites is now set to 7. I'm gonna change it back because I don't
want it set to 7. I'm gonna set it to 5. So I'm gonna copy this again, type in "set,"
paste, change it back to 5, hit enter, type in the command "save." It reboots. Go back to
the CLI. Type in the command "get GPS." GPS_rescue_min_sats is now at 5. So that's
how you can use the commands "get" and "set" in conjunction with each other. You
always want to make sure anytime you make changes to your flight controller
using the CLI commands to type in the command "save" and hit return because
otherwise it won't make those-it won't save those changes. The next command we
want to go over is the command "resource." And we can use this command - type in the
word "resource" into the CLI, hit enter - to
determine what pins the various functions of your flight controller are
mapped to, as you can see here or in this diagram of the Airbot Omnibus F4 Nano
V6. For our example, what we're going to be using is the resource mapping for our
motors. So if you're checking your quadcopter's motors spin direction and
mapping in Betaflight after a build and you find out that when you raise
this motor #1 tab you find out motor #4 is spinning or you raise motor #2
tab and you find out motor #3 is spinning, that means that you need to
remap your motors. I've got a video showing this process of how I had to
remap motors on my 2.5 inch drone build that'll appear up in the upper right
hand corner of this screen. At time hack 28 30 is when I start talking about the
remapping of the motors and checking them out. So you can go to time hack 28 30
on that video which appeared in the upper right hand corner of this screen
(or through the link in the video description below) that'll show you how
to remap your motors. Let's go back to the CLI. Type "resource." So let's say I
needed to remap motor #1 to B01. What I would do is, I would copy this-
let's remember motor #1 is currently A03- but we want it to be B01-paste. So I
want to say resource motor 1 to B01.
Hit enter. And now motor #3 is disabled and motor #1 is now mapped to B01.
We can verify that by typing in "resource."
Now we've got motor #1 at B01 and motor #3 is no longer mapped to anything,
which is obviously an an issue! We want to go back to where it was which
is A03. Now motor #1 is set to A03 but we still don't have motor #3. So
we need to go motor 3 to B01. So we just copy this. Paste. motor 3 we want to
be B01. Hit enter. Now what do we do after we make any changes in the CLI? We
type "save." Hit enter. It reboots. Hopefully it saves it. We're gonna verify that
it did by typing in "resource" again. Now we're back to what it was with motor
#1 at A03 and motor #3 at B01. So that's how you can use the command
"resource" for mapping various functions of your flight controller to different
pins if you need to go that route. Remember to type in the command "save" and
hit enter. The next command we want to take a look at is a command to type "exit"
which will exit you from the CLI without saving anything and reboot.
The last command we want to go over is called "defaults" which resets the flight
controller to its default settings, saves them, and reboots the system. So we type
in the word "defaults." At this point you would go ahead and hit return which
will reset the flight controller to all of its default settings. I've never done
this before. Should I go ahead and do this now? Sure,
let's do it! Ohhh!
Let's take a look at what I did. Type in "dump." Everything has been reset to the
flight controller default settings. Everything that I had in there is now
gone! Why on earth would I have done that?!? Because as we mentioned earlier the CLI
is our friend! I've already saved all of my settings which is what you want to do
at the very beginning before you start anything. So, we'll go ahead and reset my
settings to what I had originally by copying and pasting. So that's the
command-line interface. We hope it's no longer a mystery to you and that you're
a little bit more comfortable using it. Make sure and check out our TMacFPV.com
website. Give the video a thumbs up! Hit that subscribe button, share the
video with your friends. Thank you for your time and we'll see you next time.
Clear skies friend!