Skip to content

Instantly share code, notes, and snippets.

@odinsy
Forked from wlgrd/Betaflight for ubuntu
Created February 27, 2023 17:19
Show Gist options
  • Select an option

  • Save odinsy/c8bb2cdce33cd70ac2f31951fd6c04f7 to your computer and use it in GitHub Desktop.

Select an option

Save odinsy/c8bb2cdce33cd70ac2f31951fd6c04f7 to your computer and use it in GitHub Desktop.

Revisions

  1. @wlgrd wlgrd revised this gist Mar 17, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Betaflight for ubuntu
    Original file line number Diff line number Diff line change
    @@ -38,8 +38,9 @@ Here it is in dialout, obviosuly thinking it is a modem.

    $ sudo systemctl stop ModemManager.service

    8. Add yourself to the group
    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.
  2. @wlgrd wlgrd created this gist Mar 17, 2017.
    45 changes: 45 additions & 0 deletions Betaflight for ubuntu
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    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

    $ sudo usermod -G plugdev -a <username>

    9. I had to reboot for this to work.