Skip to content

Commit

Permalink
Merge branch 'master' into dzikuvx-groundstation-activation
Browse files Browse the repository at this point in the history
  • Loading branch information
DzikuVx committed Apr 25, 2024
2 parents 5d39267 + 8103003 commit aa8aee3
Show file tree
Hide file tree
Showing 174 changed files with 19,051 additions and 14,003 deletions.
185 changes: 185 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: Build Configurator
# Don't enable CI on push, just on PR. If you
# are working on the main repo and want to trigger
# a CI build submit a draft PR.
on: pull_request

jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAME=inav-configurator_linux_x64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
cache: 'npm'
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y install dpkg fakeroot rpm build-essential libudev-dev
- name: Install deps
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Build Linux
run: npm run make
- name: Upload Linux deb
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_NAME }}_DEB
path: ./out/make/deb/x64/*.deb
- name: Upload Linux rpm
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_NAME }}_RPM
path: ./out/make/rpm/x64/*.rpm
- name: Upload Linux zip
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_NAME }}_ZIP
path: ./out/make/zip/linux/x64/*.zip
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEx64=inav-configurator_darwin_x64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEarm64=inav-configurator_darwin_arm64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
cache: 'npm'
# Workaround due to a bug in node-gyp: https://github.com/electron/rebuild/issues/1116
- name: Install Setuptools
run: pip install setuptools
- name: Install deps
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Build MacOS x64
run: npm run make -- --arch="x64"
- name: Build MacOS arm64
run: npm run make -- --arch="arm64"
- name: Upload MacOS x64 zip
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEx64}}_ZIP
path: ./out/make/zip/darwin/x64/*.zip
- name: Upload MacOS x64 dmg
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEx64}}_DMG
path: ./out/make/*x64*.dmg
- name: Upload MacOS arm64 zip
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEarm64}}_ZIP
path: ./out/make/zip/darwin/arm64/*.zip
- name: Upload MacOS arm64 dmg
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEarm64}}_DMG
path: ./out/make/*arm64*.dmg
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install linux utils
run: choco install --force -y awk grep sed
- name: Setup environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# This is the hash of the commit for the PR
# when the action is triggered by PR, empty otherwise
COMMIT_ID=${{ github.event.pull_request.head.sha }}
# This is the hash of the commit when triggered by push
# but the hash of refs/pull/<n>/merge, which is different
# from the hash of the latest commit in the PR, that's
# why we try github.event.pull_request.head.sha first
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
VERSION=$(grep version package.json | sed 's/.*"\([0-9][0-9]*.[0-9]*.[0-9]*\)".*/\1/g')
echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEx64=inav-configurator_win32_x64_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
echo "BUILD_NAMEia32=inav-configurator_win32_ia32_${VERSION}_${BUILD_SUFFIX}" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- uses: engineerd/[email protected]
with:
name: "Wix Toolset 3.1.4"
url: "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip"
pathInArchive: "/"
- name: Install deps
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
command: npm install
timeout_minutes: 10
- name: Build Win32 x64
run: npm run make -- --arch="x64"
- name: Build win32 ia32
run: npm run make -- --arch="ia32"
- name: Upload Windows x64 zip
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEx64}}_ZIP
path: ./out/make/zip/win32/x64/*.zip
- name: Upload Windows x64 msi
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEx64}}_MSI
path: ./out/make/wix/x64/*.msi
- name: Upload Windows ia32 zip
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEia32}}_ZIP
path: ./out/make/zip/win32/ia32/*.zip
- name: Upload Windows ia32 msi
uses: actions/upload-artifact@v4
with:
name: ${{env.BUILD_NAMEia32}}_MSI
path: ./out/make/wix/ia32/*.msi

14 changes: 3 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ npm-debug.log
.idea/
npm-debug.log
inav-configurator.iml
# Generated scripts and styles
/build
# Used by nw-builder to download runtimes
/cache
# Where we put the final app directory structure
/dist
# Path where the NW.js apps get built
/apps
/.vscode/
.eslintrc.json
/.project
/out
.eslintrc.json
/.project
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Configurator",
"runtimeExecutable": "${workspaceFolder}/node_modules/@electron-forge/cli/script/vscode.sh",
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/@electron-forge/cli/script/vscode.cmd",

},
"args": ["--inspect"],
"env": {
"NODE_ENV": "development",
"NODE_PATH": "${workspaceFolder}/js/"
},
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
]
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"problemMatcher": [],
"label": "npm: start",
"detail": "node node_modules/gulp/bin/gulp.js build && node node_modules/nw/bin/nw .",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
82 changes: 34 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,32 @@ everything, the hardware is not working, or you have any other _support_ problem
* [RC Groups Support](https://www.rcgroups.com/forums/showthread.php?2495732-Cleanflight-iNav-(navigation-rewrite)-project)
* [INAV Official on Telegram](https://t.me/INAVFlight)

## INAV Configurator starts minimized, what should I do?

You have to remove the `C:\Users%Your_UserName%\AppData\Local\inav-configurator` folder and all its content.

[https://www.youtube.com/watch?v=XMoULyiFDp4](https://www.youtube.com/watch?v=XMoULyiFDp4)

Alternatively, on Windows with PowerShell, you can use the `post_install_cleanup.ps1` script that will do the cleaning. (thank you, James Cherrill)

## Installation

Depending on the target operating system, _INAV Configurator_ is distributed as a _standalone_ application or Chrome App.

### Windows

1. Visit [release page](https://github.com/iNavFlight/inav-configurator/releases)
1. Download Configurator for Windows platform (win32 or win64 is present)
1. Extract ZIP archive
1. Run the INAV Configurator app from the unpacked folder
1. Configurator is not signed, so you have to allow Windows to run untrusted applications. There might be a monit for it during the first run
2. Download Configurator for Windows platform (win32 or win64 is present)
3. Install
* Extract ZIP archive and run the INAV Configurator app from the unpacked folder
* OR just use the setup program `INAV Configurator.msi`

4. Configurator is not signed, so you have to allow Windows to run untrusted applications. There might be a monit for it during the first run

### Linux

1. Visit [release page](https://github.com/iNavFlight/inav-configurator/releases)
2. Download Configurator for Linux platform (linux32 and linux64 are present)
* **.rpm** is the Fedora installation file. Just download and install using `sudo dnf localinstall /path/to/INAV-Configurator_linux64-x.y.z-x86_64.rpm` or open it with a package manager (e.g. via Files)
* **.deb** is the Debian/Ubuntu installation file. Just download and install using `sudo apt install /path/to/INAV-Configurator_linux64_x.y.z.deb` or open it with a package manager (e.g. via the File Manager)
* **.tar.gz** is a universal archive. Download and continue with these instructions to install
3. Change to the directory containing the downloaded **tar.gz** file
* **.zip** is a universal archive. Download and continue with these instructions to install
3. Change to the directory containing the downloaded **zip** file
4. download [this](https://raw.githubusercontent.com/iNavFlight/inav-configurator/master/assets/linux/inav-configurator.desktop) file to the same directory. Its filename should be `inav-configurator.desktop`.
5. Extract **tar.gz** archive
5. Extract **zip** archive
```
tar -C /tmp/ -xf INAV-Configurator_linuxNN_x.y.z.tar.gz
unzip INAV-Configurator_linuxNN_x.y.z.tar.gz -d /tmp/
```
**NN** is the bits of your OS. **x.y.z** is the INAV Configurator version number.

Expand All @@ -73,57 +67,49 @@ sudo mv inav-configurator.desktop /usr/share/applications/
```
10. Make the following files executable:
* inav-configurator `chmod +x /opt/inav/inav-configurator/inav-configurator`
* (5.0.0+) chrome_crashpad_handler `chmod +x /opt/inav/inav-configurator/chrome_crashpad_handler`
11. Run the INAV Configurator app from the unpacked folder `/opt/inav/inav-configurator/inav-configurator`

#### Notes

On some Linux distros, you may be missing `libatomic` and/or `NW.JS` (especially `libnode.so`) dependencies. If so, please install `libatomic` using your distro's package manager, e.g:

* Arch Linux: `sudo pacman -S --needed libatomic_ops`
* Debian / Ubuntu: `sudo apt install libatomic1`
* Fedora: `sudo dnf install libatomic`

1. Don't forget to add your user to the dialout group "sudo usermod -aG dialout YOUR_USERNAME" for serial access
2. If you have 3D model animation problems, enable "Override software rendering list" in Chrome flags chrome://flags/#ignore-gpu-blacklist

### Mac

1. Visit [release page](https://github.com/iNavFlight/inav-configurator/releases)
1. Download Configurator for the Mac platform
1. Extract ZIP archive
1. Run INAV Configurator
2. Download Configurator for the Mac platform
3. Install
* Extract ZIP archive and run INAV Configurator
* OR use the DMG package for installation

## Building and running INAV Configurator locally (for development)

For local development, the **node.js** build system is used.

1. Install node.js
1. From the project folder run `npm install`
1. To build the JS and CSS files and start the configurator:
- With NW.js: Run `npm start`.
- With Chrome: Run `npm run gulp`. Then open `chrome://extensions`, enable
the `Developer mode`, click on the `Load unpacked extension...` button, and select the `inav-configurator` directory.
1. To build the and start the configurator:
- Run `npm start`.

To build the App run `npm run make` to build for your platform.

Other tasks are also defined in `gulpfile.js`. To run a task, use `node ./node_modules/gulp/bin/gulp.js task-name`. Available ones are:
Options:
* Architecture: --arch - Allowed values are: "ia32", "x64", "armv7l", "arm64", "universal", or "mips64el".

- **build**: Generate JS and CSS output files used by the configurator from their sources. It must be run whenever changes are made to any `.js` or `.css` files in order to have those changes appear
in the configurator. If new files are added, they must be included in `gulpfile.js`. See the comments at the top of `gulpfile.js` to learn how to do so. See also the `watch` task.
- **watch**: Watch JS and CSS sources for changes and run the `build` task whenever they're edited.
- **dist**: Create a distribution of the app (valid for packaging both as a Chrome app or NW.js app)
in the `./dist/` directory.
- **release**: Create NW.js apps for each supported platform (win32, osx64 and linux64) in the `./apps`
directory. Running this task on macOS or Linux requires Wine since it's needed to set the icon
for the Windows app. If you don't have Wine installed, you can create a release by running the **release-only-Linux** task.
<br>`--installer` argument can be added to build installers for a particular OS. NOTE: MacOS Installer can be built with MacOS only.
See [Electron Forge CLI Documentation](https://www.electronforge.io/cli#options-2) for details

To build a specific release, use the command `release --platform="win64"` for example.
To build the setup program for windows, you have to install [WiX Toolset V3](https://github.com/wixtoolset/wix3/releases) and add the `bin` folder to you `PATH`, e.g.
```C:\Program Files (x86)\WiX Toolset v3.14\bin```

To build deb and rpm packages for Linux, you have to install the following packages:
- Ubuntu/Debian: `dpkg, fakeroot, rpmbuild, build-essential, libudev-dev`
- OpenSuse/Fedora: `dpkg, fakeroot, rpmbuild, systemd-devel, devel-basis (zypper install -t pattern devel_basis), zip`

Example (note the double -- ):
``` npm run make -- --arch="x64" ```

### Running with debug | Inspector

To be able to open Inspector, you will need SDK flavours of NW.js
To be able to open Inspector, set envorinment variable `NODE_ENV` to `develpoment` or set the flag directly when run `npm start`:

```NODE_ENV=development npm start```

`npm install [email protected] --nwjs_build_type=sdk`
Or use vscode and start a debug session `Debug Configurator` (Just hit F5!)

## Different map providers

Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion assets/linux/inav-configurator.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Name=INAV Configurator
Comment=Crossplatform configuration tool for the INAV flight control system
Exec=/opt/inav/inav-configurator/inav-configurator
Icon=/opt/inav/inav-configurator/icon/inav_icon_128.png
Icon=/opt/inav/inav-configurator/resources/app/assets/linux/icon/inav_icon_128.png
Terminal=false
Type=Application
Categories=Utility
Binary file added assets/windows/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/windows/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/windows/inav_installer.bmp
Binary file not shown.
Binary file removed assets/windows/inav_installer_small.bmp
Binary file not shown.
Loading

0 comments on commit aa8aee3

Please sign in to comment.