Skip to content

Commit 529280a

Browse files
chmelevskijhaslinghuis
andauthoredApr 11, 2024··
docs: update README.md for pwa flow (#731)
* docs: update README.md for pwa flow * Update README.md * Update README.md --------- Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
1 parent 79334ae commit 529280a

File tree

3 files changed

+82
-108
lines changed

3 files changed

+82
-108
lines changed
 

‎README.md

+82-108
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,131 @@
11
# Betaflight Blackbox Explorer
22

3-
[![Latest version](https://img.shields.io/github/v/release/betaflight/blackbox-log-viewer)](https://github.com/betaflight/blackbox-log-viewer/releases) [![Build](https://img.shields.io/github/actions/workflow/status/betaflight/blackbox-log-viewer/nightly.yml?branch=master)](https://github.com/betaflight/blackbox-log-viewer/actions/workflows/nightly.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=betaflight_blackbox-log-viewer&metric=alert_status)](https://sonarcloud.io/dashboard?id=betaflight_blackbox-log-viewer) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
3+
[![Latest version](https://img.shields.io/github/v/release/betaflight/blackbox-log-viewer)](https://github.com/betaflight/blackbox-log-viewer/releases)
4+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=betaflight_blackbox-log-viewer&metric=alert_status)](https://sonarcloud.io/dashboard?id=betaflight_blackbox-log-viewer)
5+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
46

57
![Main explorer interface](screenshots/main-interface.jpg)
68

7-
This tool allows you to open logs recorded by Betaflight's Blackbox feature in your web browser. You can seek through
8-
the log to examine graphed values at each timestep. If you have a flight video, you can load that in as well and it'll
9-
be played behind the log. You can export the graphs as a WebM video to share with others.
9+
This tool allows you to open logs recorded by Betaflight's Blackbox feature in
10+
your web browser. You can seek through the log to examine graphed values at each
11+
timestep. If you have a flight video, you can load that in as well and it'll be
12+
played behind the log. You can export the graphs as a WebM video to share with
13+
others.
1014

1115
## Installation
1216

13-
### Standalone
14-
15-
Betaflight 4.3 users should use the [latest nightly release](https://github.com/betaflight/blackbox-log-viewer-nightlies).
16-
Users of earlier Betaflight firmware should first try the nightly release, but if some fields don't render properly, try an earlier version from [Releases](https://github.com/betaflight/blackbox-log-viewer/releases).
17-
### Notes
18-
19-
#### Windows users
20-
21-
The minimum required version of Windows is Windows 8.
17+
Current blackbox explorer version is built as
18+
[PWA](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app).
19+
Meaning it can work in both online and offline modes as regular desktop app
20+
would.
2221

23-
#### MacOS X users
22+
### Web
2423

25-
Changes to the security model used in the latest versions of MacOS X 10.14 (Mojave) and 10.15 (Catalina) mean that the operating system will show an error message ('"Betaflight\ Blackbox\ Explorer.app" is damaged and can’t be opened. You should move it to the Trash.') when trying to install the application. To work around this, run the following command in a terminal before installing: `sudo xattr -rd com.apple.quarantine /Applications/Betaflight\ Blackbox\ Explorer.app`.
24+
1. Visit https://blackbox.betaflight.com/
25+
2. Use the app
2626

27-
### Unstable Testing Versions
28-
29-
Unstable testing versions of the latest builds of the Betaflight Blackbox Explorer for most platforms can be downloaded from [here](https://github.com/betaflight/blackbox-log-viewer-nightlies/releases).
27+
### Standalone
3028

31-
**Be aware that these versions are intended for testing / feedback only, and may be buggy or broken.**
29+
1. Visit https://blackbox.betaflight.com/
30+
2. Follow the procedure to install PWA on your platform. On MacOS chrome:
31+
![Url bar PWA install](screenshots/url-bar.webp)
32+
![PWA install dialog](screenshots/pwa-install-dialog.webp)
3233

3334
## Usage
34-
Click the "Open log file/video" button at the top right and select your log file and your flight video (if you recorded one).
3535

36-
You can scroll through the log by clicking or dragging on the seek bar that appears underneath the main graph. The
37-
current time is represented by the vertical red bar in the center of the graph. You can also click and drag left and
38-
right on the graph area to scrub backwards and forwards.
36+
Click the "Open log file/video" button at the top right and select your log file
37+
and your flight video (if you recorded one).
38+
39+
You can scroll through the log by clicking or dragging on the seek bar that
40+
appears underneath the main graph. The current time is represented by the
41+
vertical red bar in the center of the graph. You can also click and drag left
42+
and right on the graph area to scrub backwards and forwards.
3943

4044
### Syncing your log to your flight video
4145

42-
The blackbox plays a short beep on the buzzer when arming, and this corresponds with the start of the logged data.
43-
You can sync your log against your flight video by pressing the "start log here" button when you hear the beep in the
44-
video. You can tune the alignment of the log manually by pressing the nudge left and nudge right buttons in the log
45-
sync section, or by editing the value in the "log sync" box. Positive values move the log toward the end of the video,
46+
The blackbox plays a short beep on the buzzer when arming, and this corresponds
47+
with the start of the logged data. You can sync your log against your flight
48+
video by pressing the "start log here" button when you hear the beep in the
49+
video. You can tune the alignment of the log manually by pressing the nudge left
50+
and nudge right buttons in the log sync section, or by editing the value in the
51+
"log sync" box. Positive values move the log toward the end of the video,
4652
negative values move it towards the beginning.
4753

4854
### Customizing the graph display
4955

50-
Click the "Graph Setup" button on the right side of the display in order to choose which fields should be plotted on
51-
the graph. You may, for example, want to remove the default gyro plot and add separate gyro plots for each rotation axis.
52-
Or you may want to plot vbat against throttle to examine your battery's performance.
53-
54-
## Native app build via NW.js
56+
Click the "Graph Setup" button on the right side of the display in order to
57+
choose which fields should be plotted on the graph. You may, for example, want
58+
to remove the default gyro plot and add separate gyro plots for each rotation
59+
axis. Or you may want to plot vbat against throttle to examine your battery's
60+
performance.
5561

56-
### Development
62+
## Developing
5763

58-
1. Install node.js
59-
2. Install yarn: `npm install yarn -g`.
60-
3. Change to project folder and run `yarn install`.
61-
4. Run `yarn start` to build & run the debug flavor.
64+
### Node setup
6265

63-
### App build and release
66+
We are using [nvm](https://github.com/nvm-sh/nvm) to manage the correct node
67+
vesion, follow the install instruction there. After which from blackbox directory
68+
just run:
6469

65-
The tasks are defined in `gulpfile.js` and can be run through yarn:
70+
```bash
71+
nvm use
6672
```
67-
yarn gulp <taskname> [[platform] [platform] ...]
68-
```
69-
70-
List of possible values of `<task-name>`:
71-
* **dist** copies all the JS and CSS files in the `./dist` folder.
72-
* **apps** builds the apps in the `./apps` folder [1].
73-
* **debug** builds debug version of the apps in the `./debug` folder [1].
74-
* **release** zips up the apps into individual archives in the `./release` folder [1].
7573

76-
[1] Running this task on macOS or Linux requires Wine, since it's needed to set the icon for the Windows app (build for specific platform to avoid errors).
74+
### Yarn
7775

78-
#### Setting up and building on a Mac
76+
For dependency management we are using [yarn](https://yarnpkg.com/), follow the
77+
instruction there to install it.
7978

80-
- Install GitHub desktop application from https://desktop.github.com and open the GitHub Desktop application.
81-
- At https://github.com/betaflight/betaflight-configurator, select Clone or Download > Open in Desktop
79+
### Development mode
8280

83-
(The GitHub Desktop application should come to the front and create a repository (not necessarily where you want it). The blackbox-log-viewer repository (folder) should appear under the list of local repositories. You can find your local repository location on your mac using the 'Locate in Finder' command GitHub Desktop It can be moved somewhere more else, but you'll then need to tell Github where you're moved it to.)
84-
85-
Open Terminal.app and install or update homebrew:
86-
```
87-
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
88-
```
89-
install node 8.x and yarn, if already installed, agree to update them
90-
```
91-
brew install node@8 yarn
92-
```
93-
Change Terminal's working directory wherever you put blackbox-log-viewer folder; easiest way is to type 'cd ' in Terminal then drag the blackbox-log-viewer folder from the Finder to the terminal window. Or use a terminal command like
94-
```
95-
cd ~/mydirectorypath/blackbox-log-viewer
96-
```
81+
We are using [vite](https://vitejs.dev/) for development setup. It provides
82+
bundling and various optimisations like hot module reloading.
9783

98-
install dependencies into that folder (ignoring many confusing messages) with:
99-
```
100-
yarn install
101-
```
84+
With `node` and `yarn` setup, to start developing run:
10285

103-
finally build the DMG itself, which will end up in blackbox-log-viewer/release/, with:
104-
```
105-
yarn gulp release
106-
```
107-
or just:
108-
```
109-
gulp release
110-
```
111-
For a build with debugging capabilities (use F12 to open the debug console):
112-
```
86+
```bash
11387
yarn start
11488
```
11589

90+
This will start development server on http://localhost:5173/.
11691

92+
## Installing Dev Build locally
11793

118-
#### Build or release app for one specific platform
119-
To build or release only for one specific platform you can append the platform after the `task-name`.
120-
If no platform is provided, only for the platform you are building from will be build.
121-
122-
* **MacOS X** use `yarn gulp <task-name> --osx64`
123-
* **Linux** use `yarn gulp <task-name> --linux64`
124-
* **Windows** use `yarn gulp <task-name> --win64`
125-
126-
`<task-name>` would typically be `release`. You can also use multiple platforms e.g. `yarn gulp <taskname> --osx64 --linux64`. Other platforms like `--win32` and `--linux32` can be used too, but they are not officially supported, so use them at your own risk.
127-
128-
#### macOS DMG installation background image
129-
130-
The release distribution for macOS uses a DMG file to install the application.
131-
The PSD source for the DMG background image can be found in the root (`dmg-background.png`). After changing the source, export the image to PNG format in folder `./images/`.
132-
133-
#### Leverage GitHub-Actions to build binaries
134-
135-
You can use the GitHub `Actions` tab in your fork to build binaries as well. Select `Actions`>`Manual Build`>`Run Workflow`. Choose your custom branch and click `Run workflow`. The workflow will dispatch in a few moments and upon completion, the build "Artifacts" will be available for download from within the workflow run.
94+
If you want to have latest and greatest version installed on your machine from
95+
the tip of the repository:
96+
1. First need to build the application:
97+
```bash
98+
yarn build
99+
```
100+
2. Start the application in `preview` mode
101+
```bash
102+
yarn preview
103+
```
104+
3. Visit http://localhost:4173/
105+
4. Follow the steps from [Standalone](#standalone)
136106

137107
## Flight video won't load, or jumpy flight video upon export
138108

139-
Some flight video formats aren't supported by Chrome, so the viewer can't open them. You can fix this by re-encoding
140-
your video using the free tool [Handbrake][]. Open your original video using Handbrake. In the output settings, choose
141-
MP4 as the format, and H.264 as the video codec.
109+
Some flight video formats aren't supported by Chrome, so the viewer can't open
110+
them. You can fix this by re-encoding your video using the free tool
111+
[Handbrake][]. Open your original video using Handbrake. In the output settings,
112+
choose MP4 as the format, and H.264 as the video codec.
142113

143-
Because of [Google Bug #66631][], Chrome is unable to accurately seek within H.264 videos that use B-frames. This is
144-
mostly fine when viewing the flight video inside Blackbox Explorer. However, if you use the "export video" feature, this
145-
bug will cause the flight video in the background of the exported video to occasionally jump backwards in time for a
146-
couple of frames, causing a very glitchy appearance.
114+
Because of [Google Bug #66631][], Chrome is unable to accurately seek within
115+
H.264 videos that use B-frames. This is mostly fine when viewing the flight
116+
video inside Blackbox Explorer. However, if you use the "export video" feature,
117+
this bug will cause the flight video in the background of the exported video to
118+
occasionally jump backwards in time for a couple of frames, causing a very
119+
glitchy appearance.
147120

148-
To fix that issue, you need to tell Handbrake to render every frame as an intraframe, which will avoid any problematic
149-
B-frames. Do that by adding "keyint=1" into the Additional Options box:
121+
To fix that issue, you need to tell Handbrake to render every frame as an
122+
intraframe, which will avoid any problematic B-frames. Do that by adding
123+
"keyint=1" into the Additional Options box:
150124

151125
![Handbrake settings](screenshots/handbrake.png)
152126

153-
Hit start to begin re-encoding your video. Once it finishes, you should be able to load the new video into the Blackbox
154-
Explorer.
127+
Hit start to begin re-encoding your video. Once it finishes, you should be able
128+
to load the new video into the Blackbox Explorer.
155129

156130
[Handbrake]: https://handbrake.fr/
157131
[Google Bug #66631]: http://code.google.com/p/chromium/issues/detail?id=66631

‎screenshots/pwa-install-dialog.webp

11.9 KB
Binary file not shown.

‎screenshots/url-bar.webp

23.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.