SDB:Betaflight Troubleshooting

Jump to: navigation, search

This Page was created for troubleshooting with Betaflight's problems on openSUSE Linux but some of this problem can be solved the same way on other Linux Distributions.

Can't connect to Drone via USB plug

Betaflight can't connect with Flight Controller

The drone is visible (or sometimes not) in list of devices to pair but when you try to connect, nothing happens. There is two solution to resolve this problem.

Grant access to serial interfaces by custom group

You have to grant access for user to serial interfaces with specified Vendor ID by adding them to the new created group. For example, the group could be named betaflight-tty.

sudo groupadd betaflight-tty && sudo usermod -a -G betaflight-tty <your-user>

Next you have to create new udev rules (99-betaflight-tty-change-group.rules) with your text editor or IDE (for example vim).

sudo vim /etc/udev/rules.d/99-betaflight-tty-change-group.rules

Then write into rules file this:

# Assing STM32, AT32 and APM32 MCU interfaces to specify group 

ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="****", MODE="0664", GROUP="betaflight-tty"
ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="****", MODE="0664", GROUP="betaflight-tty"
ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="314b", ATTRS{idProduct}=="****", MODE="0664", GROUP="betaflight-tty"

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="****", MODE="0664", GROUP="betaflight-tty"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="****", MODE="0664", GROUP="betaflight-tty"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="314b", ATTRS{idProduct}=="****", MODE="0664", GROUP="betaflight-tty"

Save file and reload the udev rules daemon:

sudo udevadm control --reload

Now you have to Log Out and Log In back to your Desktop Environment.

Log Out and Log In should be sufficient but some users reporting problem and they repair that restarting their computer so do the same if you have that possibility at this moment.

After that open terminal and type this:

watch -n 0.5 find /dev -group betaflight-tty -exec ls -l {} +
watch program will every 0.5 second repeat find command and clear output. To close just type q

Now connect your drone to PC and in your terminal you should get output like this:

crw-rw-r--. 1 root betaflight-tty 189, 540 Apr 29 17:48 /dev/bus/usb/005/029
crw-rw-r--. 1 root betaflight-tty 166,   0 Apr 29 17:48 /dev/ttyACM0

Now you can connect to the USB port and configure your RC gear! If you nothing see in the terminal, go to the next subsection.

Manually checking the Vendor and Product IDs

If you have connected the drone to the PC via the USB port, disconnect it and open a terminal. then type:

lsusb > usb1.txt
lsusb command is from usbutils package.

Connect your the drone to USB port and again use lsusb command.

lsusb > usb2.txt

Now you have to use diff command to check which serial port was added.

diff usb1.txt usb2.txt
16a17
> Bus 005 Device 005: ID 1234:5678 STMicroelectronics Virtual COM Port
Icon-warning.png
Warning: If diff command display nothing then you should stop at this point and check out your Flight Controler (LEDs or USB port on it) and try different. Maybe your USB cable are broken. The cheapest one don't transfer data, only can charge devices ! Find something else and do above steps again!

You see that two numbers after ID in your terminal ? Remember they! In this example it's 1234:5678. The first is the Vendor ID, second is the Product ID.

Open the udev rule from previous section (/etc/udev/rules.d/99-betaflight-tty-change-group.rules) with your text editor and add one more rule.

You have to write the Vendor and Product IDs which you get from diff command from previos step in ATTRS{idVendor} and ATTRS{idProduct}.
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1234", ATTRS{idProduct}=="5678", MODE="0664", GROUP="betaflight-tty"

Reload the udev rules daemon:

sudo udevadm control --reload

Reconnect your drone and again use watch program to checkout if something is displayed:

watch -n 0.5 find /dev -group betaflight-tty -exec ls -l {} +

Adding user to dialout group

still in progress

Keywords: betaflight,udev,duf,configuration,problem,usb,connect