0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Betaflight-ConfiguratorをRaspberryPi4にインストールする

Last updated at Posted at 2020-07-18

##構成
RasberryPi4(Desktop)
Betaflight-Configurator 10.7.0

RaspberryPi4 + Desktopを準備する

https://www.raspberrypi.org/downloads/
SDカードに焼くとかは、記事は沢山あるのでそちらを参照してください
起動後、ネットワークに接続してupgradeまで済ませます

$ sudo apt update
$ sudo apt upgrade

##Betaflight Configuratorのコンパイル

ソースファイルののダウンロード

https://github.com/betaflight/betaflight-configurator/releases
Betaflight Configurator 10.7.0
Source code(zip)をダウンロードします。

$ wget https://github.com/betaflight/betaflight-configurator/archive/10.7.0.zip

###nodejsをv10にする
Betaflight Configuratorのインストール方法は本家に書いてあります。
nodejsはバージョン10にする必要があります。ここではnを使っていますがnvmでもいいです。

$ sudo n v10
  installing : node-v10.21.0
       mkdir : /usr/local/n/versions/node/10.21.0
       fetch : https://nodejs.org/dist/v10.21.0/node-v10.21.0-linux-armv7l.tar.xz

   installed : v10.21.0 (with npm 6.14.4)

$ node -v
v10.21.0

yarnでコンパイル

$ unzip 10.7.0.zip
$ cd betaflight-configurator-10.7.0
$ sudo npm install yarn -g
$ yarn install
$ yarn start

yarn startするとlinux64版のnw.jsをダウンロードしてきます。v0.44.2がダウンロードされているのがわかりますが、後述のv0.28.4を使います。

Downloading: https://dl.nwjs.io/v0.44.2/nwjs-sdk-v0.44.2-linux-x64.tar.gz
  downloading [====================] 100% 0.0s

##NW.jsを準備する

NWJSのARMv7バイナリのダウンロード

https://github.com/LeonardLaszlo/nw.js-armv7-binaries
ここのv0.28.4をダウンロードします。
(他の新しいバージョンはコンパイル前のソースファイルです)

提供者曰く・・・
Building NW.js requires a bunch of resources. The build was done with a new installation of Docker. Use as many CPU cores as possible and at least 10 GB of RAM, 4GB swap and 110 GB of disk.
だそうなので、我こそはと思う猛者はぜひ頑張っていただきたい。

$ wget https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/v0.28.4/nwjs-v0.28.4-linux-arm.tar.gz

$ tar xvf nwjs-v0.28.4-linux-arm.tar.gz
$ cd nwjs-v0.28.4-linux-arm.tar.gz
$ cp -r * ../betaflight-configurator-10.7.0/dist/

###ライブラリのインストール
以前はいらなかったのですが、Google Chromeのパッケージの変更に伴って依存関係としてlibgconf-2-4 をプルしなくなったらしい。

$ sudo apt-get install libgconf-2-4

###nwの起動
起動までできれば、あとはショートカットをデスクトップに作るだけです。

$ cd ../betaflight-configurator-10.7.0/dist/
$ ./nw --use-gl=egl --ignore-gpu-blacklist --disable-accelerated-2d-canvas --num-raster-threads=2

実際に動かすまでにやること

###Distファイルを移動

$ cd
$ mv Downloads/betaflight-configurator-10.7.0/dist/ ./bf10.7.0

###デスクトップにショートカットを作成する

$ cd Desktop
$ vi betaflight.desktop

中身を下記のようにする

[Desktop Entry]
Name=Betaflight-Configurator
Comment=Betaflight
Icon=/home/pi/bf10.7.0/images/bf_icon_128.png
Exec=/home/pi/bf10.7.0/nw --use-gl=egl --ignore-gpu-blacklist --disable-accelerated-2d-canvas --num-raster-threads=2
Type=Application
Encoding=UTF-8
Terminal=false
Categories=None;

デスクトップにアイコンが表示されて、起動できれば成功

###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

###/dev/ttyACM0 に書き込めるように dialout グループにユーザを追加

sudo usermod -a -G dialout pi

##参考URL
How to set up betaflight fc with Ubuntu
libgconf-2.so.4 Google Chromeの依存関係

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?