Last active
April 8, 2025 15:19
-
-
Save wlgrd/17b3f8626fe3bff29a4bcad2622f2177 to your computer and use it in GitHub Desktop.
How to set up betaflight fc with Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create a rule for the DFU | |
$ (echo '# DFU (Internal bootloader for STM32 MCUs)' echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules > /dev/null | |
2. Monitor connection and find your model (unplug/plug the fc while this cmd is active) | |
$ udevadm monitor --environment --udev | grep ID_MODEL_ID | |
3. Update the /etc/udev/rules.d/45-stdfu-permissions.rules file with your model. E.g, my MODEL_ID is 5740, and the .rules file | |
ends up like this: | |
# DFU (Internal bootloader for STM32 MCUs) | |
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev" | |
# ix5 | |
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev" | |
4. Now reload rules | |
$ sudo udevadm control --reload-rules && udevadm trigger | |
5. You can then test the rule using when your FC is plugged in: | |
$ udevadm test $(udevadm info -q path -n /dev/ttyACM0) | |
Ensure line "MODE 0664 /etc/udev/rules.d/45-stdfu-permissions.rules" is present | |
6. Now check the group at which the device belongs to | |
You can then test the rule using when your FC is plugged in: | |
$ ls -lah /dev/ttyACM0 | |
crw-rw---- 1 root dialout 166, 0 mars 17 21:57 /dev/ttyACM0 | |
Here it is in dialout, obviosuly thinking it is a modem. | |
7. Stop the modem service | |
$ sudo systemctl stop ModemManager.service | |
8. Add yourself to the group plugdev and dialout (don't know which one is the "correct one") | |
$ sudo usermod -G plugdev -a <username> | |
$ sudo usermod -G dialout -a <username> | |
9. I had to reboot for this to work. |
Dear NightCrack thank you very much!
Bro you are the goat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ubuntu 22.04.2 LTS
Firstly, for Betaflight Configurator to actually work with flight controllers, current user was added to "dialout" group:
sudo usermod -aG dialout $USER
($USER - system variable that contains the current user login);Then, created low-priority rule for STM32 devices:
(echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ACTION=="add", MODE="0664", GROUP="dialout"') | sudo tee /etc/udev/rules.d/80-local.rules
Then - reloaded udev rules:
sudo udevadm control --reload
That solved the problem for me.
Much appreciated the authors effort; used
https://betaflight.com/docs/wiki/archive/DFU-Hijacking#note and
https://opensource.com/article/18/11/udev resources to get things worked.