July 04, 2018

Prepare or Fix Linux for ButterFlight, BetaFlight, CleanFlight

ButterFlight | BetaFlight | CleanFlight
Failed to open serial port: FILE_ERROR_ACCESS_DENIED

See also: https://steronius.blogspot.com/2020/08/linux-emuflight-betaflight.html

Problem/Symptoms:
Failed to open serial port: FILE_ERROR_ACCESS_DENIED
betaflight linux failed to open serial port
butterflight linux failed to open serial port
cleanflight linux failed to open serial port
butterflight can’t flash firmware
betaflight can’t flash firmware
cleanflight can’t flash firmware

Cause:
Linux user accounts require permissions for Serial and USB subsystems.

Solutions:
1) For Failed to open serial port: FILE_ERROR_ACCESS_DENIED :
ref: https://websistent.com/fix-serial-port-permission-denied-errors-linux/

sudo usermod -a -G dialout $(whoami)
newgrp dialout   #(temp workaround to bypass logout & re-login requirement)

2) For unable to flash firmware to flight controller (FC) :
ref: https://github.com/ButterFlight/butterflight/blob/master/docs/USB%20Flashing.md

echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules
sudo usermod -a -G plugdev $(whoami)
newgrp plugdev   #(temp workaround to bypass logout & re-login requirement)

Follow along:

As always, good luck!
~~~


Please consider crypto tipping:
  

3 comments:

  1. for HelioRC & Pegasus UI, maybe something more like this:

    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5742", GROUP="plugdev", MODE="0664"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5742", GROUP="plugdev", MODE="0664"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", GROUP="plugdev", MODE="0664"

    ReplyDelete
  2. my current rules 2020 (maybe they are overkill):
    i put them in /etc/udev/rules.d/50-myusb.rules


    # FlightControllers
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5742", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5742", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5741", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5741", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5743", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5743", MODE="0664", GROUP="plugdev"

    # DFU (Internal bootloader for STM32 MCUs)
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"

    #gorpro session5
    SUBSYSTEM=="usb", ATTRS{idVendor}=="2672", ATTRS{idProduct}=="0029", MODE="0664", GROUP="plugdev"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="2672", ATTRS{idProduct}=="0029", MODE="0664", GROUP="plugdev"

    ReplyDelete
  3. best and near final version: https://github.com/emuflight/EmuConfigurator/wiki/Linux-Serial-&-USB

    ReplyDelete

Comments, Suggestions or "Thank you's" Invited! If you have used this info in any way, please comment below and link/link-back to your project (if applicable). Please Share.
I accept Bitcoin tips of ANY amount to: 1GS3XWJCTWU7fnM4vfzerrVAxmnMFnhysL
I accept Litecoin tips of ANY amount to: LTBvVxRdv2Lz9T41UzqNrAVVNw4wz3kKYk