Giter Site home page Giter Site logo

betaflight / blackbox-log-viewer Goto Github PK

View Code? Open in Web Editor NEW
437.0 35.0 142.0 164.41 MB

Interactive log viewer for flight logs recorded with blackbox

License: GNU General Public License v3.0

JavaScript 86.56% CSS 2.51% HTML 10.93%
betaflight hacktoberfest

blackbox-log-viewer's Introduction

Betaflight Blackbox Explorer

Latest version Quality Gate Status License: GPL v3

Main explorer interface

This tool allows you to open logs recorded by Betaflight's Blackbox feature in your web browser. You can seek through 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 be played behind the log. You can export the graphs as a WebM video to share with others.

Installation

Current blackbox explorer version is built as PWA. Meaning it can work in both online and offline modes as regular desktop app would.

Latest stable version

For the latest stable released version visit https://blackbox.betaflight.com/

Unstable testing versions

The latest master build is always available at https://master.dev.blackbox.betaflight.com/

Be aware that these versions are intended for testing / feedback only, and may be buggy or broken. Caution is advised when using these versions.

Install the app to be used in offline mode

Follow the procedure to install PWA on your platform. For example on MacOS chrome: Url bar PWA install PWA install dialog

Usage

Click the "Open log file/video" button at the top right and select your log file and your flight video (if you recorded one).

You can scroll through the log by clicking or dragging on the seek bar that appears underneath the main graph. The current time is represented by the vertical red bar in the center of the graph. You can also click and drag left and right on the graph area to scrub backwards and forwards.

Syncing your log to your flight video

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

Customizing the graph display

Click the "Graph Setup" button on the right side of the display in order to choose which fields should be plotted on the graph. You may, for example, want to remove the default gyro plot and add separate gyro plots for each rotation axis. Or you may want to plot vbat against throttle to examine your battery's performance.

Developing

Node setup

We are using nvm to manage the correct node vesion, follow the install instructions there. After which from blackbox directory just run:

nvm use

Yarn

For dependency management we are using yarn, follow the instructions there to install it.

Development mode

We are using vite for development setup. It provides bundling and various optimisations like hot module reloading.

With node and yarn setup, to start developing run:

yarn start

This will start development server and the Blackbox will be available on http://localhost:5173/.

Installing development build locally

If you want to have latest and greatest version installed on your machine from the tip of the repository:

First need to build the application:

yarn build

Then start the application in preview mode

yarn preview

Visit http://localhost:4173/ and follow the steps from Install the app to be used in offline mode

Common problems

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

Some flight video formats aren't supported by Chrome, so the viewer can't open them. You can fix this by re-encoding your video using the free tool Handbrake. Open your original video using Handbrake. In the output settings, choose MP4 as the format, and H.264 as the video codec.

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

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

Handbrake settings

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

License

This project is licensed under GPLv3.

blackbox-log-viewer's People

Contributors

aguindehi avatar asizon avatar atomgomba avatar basdelfos avatar blckmn avatar bonchan avatar borisbstyle avatar chmelevskij avatar cleric-k avatar ctzsnooze avatar demvlad avatar dependabot[bot] avatar fedorcomander avatar fgiudice98 avatar garykeeble avatar haslinghuis avatar hydra avatar illusionfpv avatar jrussellsmyth avatar martinbudden avatar mcgivergim avatar mikeller avatar mrrobot62 avatar nerdcopter avatar pichim avatar stefanfeederle avatar tbolin avatar theisotopes avatar thenickdude avatar wolkesson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blackbox-log-viewer's Issues

Incorrect Scaling of amperageLatest

A multi layer problem. Blackbox-log-viewer displays the value "amperageLatest" which in betaflight is a value in centiamps, it is now a SIGNED int. So a value of 100 corresponds to 1A. Currently 100 is being interpreted as 10A.

Also note that due to changes in betaflight, negative values will be sent in amperageLatest, hopefully those will display correctly.

compatible with bf3.1.0 log file

is the log viewer compatible with bf3.1.0 log files? i can't no more see the notch margins.
here is a screenshot (see top left) and the log file:
zwischenablagebild

LOG00002.TXT

with the old bf3.0.1 i have no probs to see the notch margins.

Tooltips and two srollbars

A few Tooltips are obscured from Navigations bar, these are

  • View/hide analyser display
  • Zoom Analyser Window
  • Jump to end of log

and also always appears two scrollbars ... imho could be related with pr #19

tooltip_scrollbar-50
0

Spec Analyser 'zoom' slider stopped working

v 2.5.7

A few weeks ago I could zoom in but it was always temperamental - when you changed zoom slider (not talking about toolbar button) it 'lost' data till you click on the spec analyser button on the legend again.... it still seems to still have this problem except now you can't work around it by re-opening the spec analyser. Tried on 2 machines.... tried restarting app

blackbox_log_2016-12-16_084334.TXT

How to get the analyser to display is not clear enough

Originally raised by CptanPanic; thanks

To display the analyser for a graph field, the user must select the required graph field from the legend on the RHS of the chart;

It is not obvious that the fields can be clicked; maybe add some kind of icon next to the field.

Add field button broken

On graph setup dialog box, the add field button does not work. The only way to add new fields is to select an example graph and then change the fields.

Feature Request: Adjustable frequency rang in analyzer

Sorry, not trying to spam you :)

It would be really useful to be able to adult the min/max frequency range (horizontal axis) to allow more precise analysis of the waveform. Often the stuff beyond 300hz is not useful but the display going all the way to half the sample frequency (I presume) causes the interesting stuff to scale quite small.

Analyser Notch display incorrect when using default settings.

The notch filter settings on the analyser display show a filled rectangle covering the range around the notch center value. This should be hidden if the notch_cutoff value is zero (which is the default) otherwise the screen fills the analyser window either side of the notch_center with a semi-transparent rectangle; this is not how it should work when notch_cutoff is zero as this is when the filter is disabled.

@borisbstyle
This is fixed in v2.5.3 (it's the only change) and I think it may warrant an immediate patch release or it could cause confusion for people just starting to use the analyser with notch settings on default values. (Sorry).

Super Expo not used in deg/s calculation

The Super-Expo factor is not used in the conversion of rcCommand to deg/s yet.

I am having trouble working out when Super-Expo is active so that I can correct the rcCommand rate....
Might need to add this status to the logged fields but I was trying to minimise the log changes to reduce memory requirements for those using the in-built memory of the flight controller

rcCommand and gyro graphs do not match

The numbers in the legend match but the graphs do not although configured the same way.
This way it is impossible to compare the desired rate with the rate of the copter.

graph mismatch settings
graph mismatch

Feature Request : Export to CSV

Previously the .txt files generated by betaflight have been able to be exported to .csv by blackbox-tools. However the new files .bfl have a different format and cannot be interpreted by that tool.

It would be very handy to have a feature where the log can be saved as a CSV for analysis in other software.

Changing Log Setup doesn't refresh the graph fields

At the moment, changing log setup to manually enter the configuration settings for rate etc does not update the graphs in the chart.

Re-loading the log file after changing the settings is a workaround at the moment.

This item is now fixed and will be in the next version

Join Betaflight group

I will add you to betaflight group if you want you can put your blackbox repository in there?

Maxing out CPU

I'm sorry that this report will be fairly vague, but I have no more details than this.

  • When switching between several logs (16 MB usually), leaving the BB viewer open for a while, switching between hotkey displays, etc, eventually scrolling by grabbing the trace view or throttle graph with the mouse and pulling left or right will randomly freeze first the app itself and any other chrome apps for several seconds, with my CPU fan audibly increasing speed (indicating high load).
  • Eventually this results in most programs on the PC freezing for up to 20 seconds (i.e. VLC).
  • During this, although it may be a seperate issue, sometimes switching from one sub-log within the same file results in no traces being shown and the throttle graph not being updated. Only restarting the app helps.
  • Restarting the app fixes the freezes until they occur again a while later
  • Using the original BB viewer, no freezes ever happen

Note that this is an I5 PC with plenty of power, not a laptop or similar that may actually easily be overloaded.

Exporting video always Calculating

I tried on Debian Jessie Mate, Ubuntu Mate 16.04 (now fresh install) & Chrome 53.0.2785.116 (64-bit) at all times and nothing happens, always Calculating... the file size, and no rendering. Why???

update:
Here is the DeveloperTools console:
http://imgur.com/a/eypT0

Incorrect current value in bfl log exported from firmware 3.1.6

I am use blackbox explorer v2.5.10.
FC, brf3
battery, 4s
quad, 4 motors

after flash firmware 3.1.6 and restore settings, I found current_meter_scale is missing, so I add current scale in GUI direct, then I found it was renamed to ibat_scale.

I take a test flight, export log, found a very high measured current
screen shot 2017-03-18 at 20 43 37
with same parameter in version 3.0.0 , it's correct.
screen shot 2017-03-18 at 22 06 46

If I open the old log file generated by Betaflight v3.0.0, it just show correct current value, see second picture I posted.
So, I think Blackbox log viewer is fine, Or there is something wrong in BFL log format, In v3.0.0, exported log was TXT format.

Welcome Screen not full seen

Welcome Screen do not full fill the maximized and reduced windows ... Scrollbar hangs in the air ;-)

maximized window:
fullscreen_welcome-50

reduced window:
minimized_welcome-50

freezing

after opening and closing a bunch of logs, hitting play and pause, the app freezes:

screen shot 2017-04-22 at 10 10 20 pm

Display real values in viewer

I was wondering why is it not possible to see real value on the right bar instead of percentages?

In my particular case where blackbox is also used for developing / testing I really have to watch the real values often and it is annoying to check the table all the time.

On DSHOT, motor values do not display properly?

Please see the attached log. Why do the motor values show up so differently when using Dshot300? I'm using one of the latest 3.1 builds and the latest BB viewer.
LOG00003.BFL.zip

The craft overlay also doesnt register motor activity until throttle goes above a certain value. Essentially, it is logging motor values less than 1000, and I'm not sure why... :)
screen shot 2016-12-03 at 02 20 23

Some YAW values not readed correctly for newest versions of BF/CF

With the latest version of BF/CF some YAW values are not readed. I'am new to all of this, so I don't know what has changed between versions, but examining the code the "names" of the RATE and EXPO for YAW are not good.
In the BlackBox log file:

H rc_rate_yaw:100
H rc_yaw_expo:25

In the code of the log viewer, flightlog_parser.js:

            rcYawExpo:null,                 // Yaw Expo

And I can't see the rc_rate_yaw, but it's used, without underscore in flightlog.js:

            } else {
                rcExpo = sysConfig.rcYawExpo;
                rcRate = sysConfig.rcYawRate / 100.0;
            }

With all this changes of versions, it's difficult to let a clean code. I think is better to change in BetaFlight and Cleanflight the rc_rate_yaw by rc_yaw_rate and in the code ignore all the underscore or similar.

I can solve the problem and make a PR, but I don't know anything about older versions and I will break compatibility, so maybe is better that @GaryKeeble make the changes or at least give some instructions to do it.

Compatibility to INav 1.7 RC1

Hi there,
The viewer shows some problems with the latest INav RC.
The motors are always shown as 100% in the GUI, in the table are still the correct values shown.
The debug values are not pickable or chooseable, necessary for debug mode: gyro/ notch.

Is it possible to get compatibility here again?

BTW
Thanks to all for the great work.

User Header Entries

Thinking of adding customisable "Virtual" header fields to the text file once it has got onto your PC/MAC.

Idea is that a header line could be added to the log from within the viewer tool; these custom headers could allow you to:-

  1. If you have a video loaded, store the name of the video and it's offset in a header line. So that next time you open the log file, it could automatically load the video and set the offset as well;
  2. Add user log notes that may be useful to you later when you have forgotten what you were doing during the flight; for example, you could note
    • the craft configuration (I was flying with my gopro)
    • race details (I came first),
    • location (got chased off by the farmer),
    • weather conditions (it was raining again),
    • flight date, I don't know, pretty much anything you like.

You could even make notes to Joshua about what you would like to ask him to look at :-)

This could extend into 'bookmarks'; events on the timeline that you were particularly interested in that you want to review later (or you want someone else to review) - with perhaps fast scrolling back/forwards through the log (thinking SHIFT-ALT 0-9 to store bookmark, ALT 0 - 9 to jump directly to a bookmark time), and ALT PgUp/PgDn to go back through forwards and backwards to each bookmark.

All of the above would require me to write to the log file from the log viewer; so feel new project coming on.

Feature request: ability to adjust smoothing, zoom, expo on the fly

It'd be nice to be able to adjust smoothing, zoom, expo, on the fly. Especially zoom though, Lots of times I wish I could just shift-scroll-wheel or something and zoom a graph larger. This will require a bit of design, as I'm sure sometimes I would want to zoom all graphs and other times maybe just one graph or even one line. I leave the details of the implementation to the wonderful coders :-)

Thanks for your amazing work on this project BTW.

Spectrum analyzer display size on changing log entries

Running the latest version directly from github (commit 518a636).

If the spectrum analyzer window is maximized, selecting a different log resets the display to the small window but the button stays in the maximized state. So clicking the button doesn't do anything because the window is already small. Just looks like the window shouldn't revert in size when selecting a new log.

Problem setting up the graphics with debug_mode=11 (dfilter)

I have logged a few flights with debug_mode=dfilter and I can't config any graph in blackbox. I press the Graph setup button, then graph config window appears, but nothing happen when I select any kind of graphic. If I flight debug_mode=notch (or other modes), I can config graphics with no problem.

I have noticed that log file has debug_mode=11 when debug_mode is dfilter. If I change this value with a text editor to other value like 0 or 5, then I can configure the graphics in blackbox without problem.

Thanks!

Logviewer crashes when I smooth, every time

v2.5.11
chrome 57.0.2987.133
windows 10

Steps:

  • Open log
  • Can click around the timeline thing
  • press 's' on keyboard
  • app becomes mostly unresponsive- can't click timeline.... some stuff still kinda works but no data is shown on graph
  • have to restart to fix

better place for analyser zoom slider

can you make the zoom sliders in relativ position to the analyser screen and not to the log graph
it looks much better ;-)

so i imagine this (only quick&dirty design):
analyserzoom-50

overlapped log graph

i'm used the viewer as an chrome app in maximised window ... on first open a new logfile the log graph display is overlapped from the control panel ... but this does not always

fullsreen-50

Problems reading debug_mode = NOTCH results in Blackbox Explorer

I'm not sure where the problem lies, but the values I see in the Betaflight version of Blackbox Explorer for gyro_raw and gyro_notch don't appear correct. They appear to be the normal gyro values mapped as follows:
gyro_rawroll = gyro[roll]
gyro_notchroll = gyro[pitch]
gyro_rawpitch = gyro[yaw]
gyro_notchpitch = 0

These were all logged using default filters, and debug_mode = NOTCH
I did notice that the Field values in the log file itself are 'debug' whereas Blackbox Explorer uses the names 'gyro_raw' etc. Where does it get these names from and how does it know which 'debug' value they should be? I suspect the problem is in Blackbox Explorer.
If I set debug_mode = NONE then the 'debug' values appear in Blackbox Explorer Field values.

There may be further issues with this as when I changed several filter parameters, and made further logs, all the above traces were zero.

I've attached a short log displaying the problem.
ONE.TXT

Betaflight firmware version 3.0
Blackbox Explorer version 2.5.6 (would be useful if this was shown in the app!)
Betaflight configurator 1.8.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.