Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.
/ readsb Public archive

Web-UI: Speedup history loading #4

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
54c97ba
Adjust precision of feet -> meters conversion
toofishes Oct 22, 2016
23765c9
Add latest Xcode version in Travis config
toofishes Oct 22, 2016
b749d94
Fix build on OS X 10.12 Sierra
toofishes Oct 22, 2016
45575cf
Merge pull request #155 from toofishes/meters-precision
mutability Oct 22, 2016
9da809c
Merge pull request #156 from toofishes/updates-for-osx
mutability Oct 22, 2016
d6fffea
removed execute bit
Oct 29, 2016
b957166
Merge pull request #161 from marvin-sinister/master
mutability Oct 29, 2016
e3334ed
Fix MessageRate exception when null in javascript
Thom-x Nov 26, 2016
fb63bdc
Merge pull request #166 from Thom-x/master
mutability Nov 26, 2016
ccd8fd5
Fix a couple of flag image typos.
mutability Dec 28, 2016
9d346f9
Added Australian hexid->registration conversion
ausmez Feb 3, 2017
aa134a2
optional bias-t support
labomb Feb 4, 2017
eeb7d1d
note about bias-t support
labomb Feb 4, 2017
e0e335f
Australian registrations can be calculated using the existing stride_…
ausmez Feb 5, 2017
75c1400
Fixed typo in hex code
ausmez Feb 5, 2017
34fb495
Merge pull request #183 from labomb/bias-t-support
mutability Feb 8, 2017
a1a84fb
usage text and defaults not in sync
labomb Feb 8, 2017
803dfe8
--stats isn't exclusive to --ifile input
labomb Feb 8, 2017
502cd22
Merge pull request #184 from labomb/showHelp-defaults-inconsistencies
mutability Feb 9, 2017
174a064
Update Debian init script to require $network and $local_fs - Issue #172
Romeo-Golf Feb 9, 2017
9ecaacd
Merge pull request #180 from ausmez/master
mutability Feb 9, 2017
9fe1a48
Revise init script to follow Debian interpretation of LBS standards -…
Romeo-Golf Feb 9, 2017
bffaa6d
Merge pull request #185 from Romeo-Golf/master
mutability Feb 9, 2017
b1c4085
pkg-config --cflags consistent with --libs
labomb Feb 11, 2017
03b4ada
fallback if missing repo tags
labomb Feb 11, 2017
47d3b8c
Merge pull request #189 from labomb/Makefile-tags
mutability Feb 11, 2017
a2bf08d
Merge pull request #188 from labomb/Makefile-cflags
mutability Feb 11, 2017
0034962
Remove an ancient 2MHz capture.
mutability Feb 15, 2017
b155fdb
Update README.md
mutability Jun 1, 2017
a5cac3c
Parallel loading of history
smartynov Jul 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ matrix:
include:
- os: linux
dist: trusty
- os: osx
osx_image: xcode8
- os: osx
osx_image: xcode7.3
- os: osx
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
PROGNAME=dump1090

ifndef DUMP1090_VERSION
DUMP1090_VERSION=$(shell git describe --tags --match=v*)
DUMP1090_VERSION=$(shell git describe --always --tags --match=v*)
endif

ifdef PREFIX
Expand All @@ -27,9 +27,15 @@ LIBS+=-lrt
CFLAGS+=-std=c11 -D_DEFAULT_SOURCE
endif
ifeq ($(UNAME), Darwin)
# TODO: Putting GCC in C11 mode breaks things.
UNAME_R := $(shell uname -r)
ifeq ($(shell expr "$(UNAME_R)" : '1[012345]\.'),3)
CFLAGS+=-std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP
COMPAT+=compat/clock_gettime/clock_gettime.o compat/clock_nanosleep/clock_nanosleep.o
else
# Darwin 16 (OS X 10.12) supplies clock_gettime() and clockid_t
CFLAGS+=-std=c11 -DMISSING_NANOSLEEP -DCLOCKID_T
COMPAT+=compat/clock_nanosleep/clock_nanosleep.o
endif
endif

ifeq ($(UNAME), OpenBSD)
Expand All @@ -42,7 +48,7 @@ all: dump1090 view1090
%.o: %.c *.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRACFLAGS) -c $< -o $@

dump1090.o: CFLAGS += `pkg-config --cflags librtlsdr`
dump1090.o: CFLAGS += `pkg-config --cflags librtlsdr libusb-1.0`

dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o $(COMPAT)
$(CC) -g -o $@ $^ $(LIBS) $(LIBS_RTL) $(LDFLAGS)
Expand Down
46 changes: 3 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,49 +34,6 @@ This means:
* There are a couple of new layers - Bing and Mapzen - that can be enabled by providing an API key
in config.js. See the comments in config.js for details.

# Simple install via apt-get

There is a repository that contains the current releases. To set up the repository:

````
$ wget https://github.com/mutability/mutability-repo/releases/download/v0.1.1/mutability-repo_0.1.1_armhf.deb
$ sudo dpkg -i mutability-repo_0.1.1_armhf.deb
````

Then you can install and upgrade packages via apt-get as needed:

````
$ sudo apt-get update && sudo apt-get install dump1090-mutability
$ sudo dpkg-reconfigure dump1090-mutability # for detailed configuration
$ sudo apt-get install lighttpd && sudo lighty-enable-mod dump1090 # if you want to use the external webserver integration
````

Installing the mutability-repo package also installs the public key used to sign the packages; the signatures will be verified automatically by apt-get.

# Manual repository setup

Add a suitable entry to sources.list:

````
# echo "deb http:https://repo.mutability.co.uk/raspbian wheezy rpi" >/etc/apt/sources.list.d/mutabiltiy.list
````

Obtain the public key used to sign the repository release by a method of your choice. This is the signing key:

````
pub 2048R/4D731812 2014-12-28 [expires: 2015-12-28]
Key fingerprint = 2098 7C8D D31A 6107 E033 7CC3 80D5 57AA 4D73 1812
uid Oliver Jowett (repo.mutability.co.uk archive signing key) <[email protected]>
````

which is available from:

* [GitHub](https://github.com/mutability/mutability-repo/raw/master/mutability.gpg)
* [repo.mutability.co.uk](http:https://repo.mutability.co.uk/mutability.gpg) (caution - not HTTPS!)
* keys.gnupg.net (`gpg --keyserver keys.gnupg.net --recv-keys 4D731812`)

Install the key with `apt-key add` or by placing the keyring in `/etc/apt/trusted.gpg.d/`

# Manual installation

To install from packages directly:
Expand Down Expand Up @@ -167,3 +124,6 @@ EXTRAPACKAGES="eatmydata debhelper fakeroot"
ALLOWUNTRUSTED="no"
APTKEYRINGS=("/home/oliver/ppa/mutability.gpg")
````

>**Note about Bias-t support:**
Bias-t support is available for RTL-SDR.com V3 dongles. If you wish to enable bias-t support, you must insure that you are building this package with a version of librtlsdr that supports this capability. You can find suitable source packages [here](https://github.com/rtlsdrblog/rtl_biast) and [here](https://github.com/librtlsdr/librtlsdr/tree/master/src). To enable the necessary support code when building, be sure to include preprocessor define macro HAVE_RTL_BIAST.
4 changes: 2 additions & 2 deletions debian/dump1090-mutability.init
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: dump1090-mutability
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: dump1090 daemon (mutability variant)
Expand Down
19 changes: 17 additions & 2 deletions dump1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,14 @@ int modesInitRTLSDR(void) {
fprintf(stderr, "Gain reported by device: %.2f dB\n",
rtlsdr_get_tuner_gain(Modes.dev)/10.0);

#ifdef HAVE_RTL_BIAST
if (Modes.enable_rtlsdr_biast) {
rtlsdr_set_bias_tee(Modes.dev, 1);
} else {
rtlsdr_set_bias_tee(Modes.dev, 0);
}
#endif

return 0;
}
//
Expand Down Expand Up @@ -674,7 +682,7 @@ void showHelp(void) {
"--iformat <format> Sample format for --ifile: UC8 (default), SC16, or SC16Q11\n"
"--throttle When reading from a file, play back in realtime, not at max speed\n"
"--interactive Interactive mode refreshing data on screen. Implies --throttle\n"
"--interactive-rows <num> Max number of rows in interactive mode (default: 15)\n"
"--interactive-rows <num> Max number of rows in interactive mode (default: 22)\n"
"--interactive-ttl <sec> Remove from list if idle for <sec> (default: 60)\n"
"--interactive-rtl1090 Display flight table in RTL1090 format\n"
"--raw Show only messages hex values\n"
Expand Down Expand Up @@ -706,7 +714,7 @@ void showHelp(void) {
"--aggressive More CPU for more messages (two bits fixes, ...)\n"
#endif
"--mlat display raw messages in Beast ascii mode\n"
"--stats With --ifile print stats at exit. No other output\n"
"--stats Print stats at exit\n"
"--stats-range Collect/show range histogram\n"
"--stats-every <seconds> Show and reset stats every <seconds> seconds\n"
"--onlyaddr Show only ICAO addresses (testing purposes)\n"
Expand All @@ -717,6 +725,9 @@ void showHelp(void) {
"--quiet Disable output to stdout. Use for daemon applications\n"
"--show-only <addr> Show only messages from the given ICAO on stdout\n"
"--ppm <error> Set receiver error in parts per million (default 0)\n"
#ifdef HAVE_RTL_BIAST
"--enable-rtlsdr-biast Set bias tee supply on (default off)\n"
#endif
"--html-dir <dir> Use <dir> as base directory for the internal HTTP server. Defaults to " HTMLPATH "\n"
"--write-json <dir> Periodically write json output to <dir> (for serving by a separate webserver)\n"
"--write-json-every <t> Write json output every t seconds (default 1)\n"
Expand Down Expand Up @@ -1073,6 +1084,10 @@ int main(int argc, char **argv) {
exit(0);
} else if (!strcmp(argv[j],"--ppm") && more) {
Modes.ppm_error = atoi(argv[++j]);
#ifdef HAVE_RTL_BIAST
} else if (!strcmp(argv[j], "--enable-rtlsdr-biast")) {
Modes.enable_rtlsdr_biast = 1;
#endif
} else if (!strcmp(argv[j],"--quiet")) {
Modes.quiet = 1;
} else if (!strcmp(argv[j],"--show-only") && more) {
Expand Down
5 changes: 4 additions & 1 deletion dump1090.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ typedef struct rtlsdr_dev rtlsdr_dev_t;

// ============================= #defines ===============================

#define MODES_DEFAULT_PPM 52
#define MODES_DEFAULT_PPM 0
#define MODES_DEFAULT_FREQ 1090000000
#define MODES_DEFAULT_WIDTH 1000
#define MODES_DEFAULT_HEIGHT 700
Expand Down Expand Up @@ -295,6 +295,9 @@ struct { // Internal state
rtlsdr_dev_t *dev;
int freq;
int ppm_error;
#ifdef HAVE_RTL_BIAST
int enable_rtlsdr_biast;
#endif

// Networking
char aneterr[ANET_ERR_LEN];
Expand Down
2 changes: 1 addition & 1 deletion interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
static int convert_altitude(int ft)
{
if (Modes.metric)
return (ft / 3.2828);
return (ft * 0.3048);
else
return ft;
}
Expand Down
2 changes: 1 addition & 1 deletion public_html/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ var ICAO_Ranges = [
{ start: 0x768000, end: 0x76FFFF, country: "Singapore", flag_image: "Singapore.png" },
{ start: 0x505C00, end: 0x505FFF, country: "Slovakia", flag_image: "Slovakia.png" },
{ start: 0x506C00, end: 0x506FFF, country: "Slovenia", flag_image: "Slovenia.png" },
{ start: 0x897000, end: 0x8973FF, country: "Solomon Islands", flag_image: "Soloman_Islands.png" }, // flag typo?
{ start: 0x897000, end: 0x8973FF, country: "Solomon Islands", flag_image: "Solomon_Islands.png" },
{ start: 0x078000, end: 0x078FFF, country: "Somalia", flag_image: "Somalia.png" },
{ start: 0x008000, end: 0x00FFFF, country: "South Africa", flag_image: "South_Africa.png" },
{ start: 0x340000, end: 0x37FFFF, country: "Spain", flag_image: "Spain.png" },
Expand Down
4 changes: 2 additions & 2 deletions public_html/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function format_altitude_brief(alt, vr) {
}

if (Metric) {
alt_text = Math.round(alt / 3.2828) + NBSP; // Altitude to meters
alt_text = Math.round(alt * 0.3048) + NBSP; // Altitude to meters
} else {
alt_text = Math.round(alt) + NBSP;
}
Expand All @@ -59,7 +59,7 @@ function format_altitude_brief(alt, vr) {
// alt in ft
function _alt_to_unit(alt, m) {
if (m)
return Math.round(alt / 3.2828) + NBSP + "m";
return Math.round(alt * 0.3048) + NBSP + "m";
else
return Math.round(alt) + NBSP + "ft";
}
Expand Down
Empty file modified public_html/markers.js
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions public_html/registrations.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ registration_from_hexid = (function () {
{ start: 0x760421, s1: 1024, s2: 32, prefix: "AP-" },
{ start: 0x768421, s1: 1024, s2: 32, prefix: "9V-" },
{ start: 0x778421, s1: 1024, s2: 32, prefix: "YK-" },
{ start: 0x7C0000, s1: 1296, s2: 36, prefix: "VH-" },
{ start: 0xC00001, s1: 26*26, s2: 26, prefix: "C-F" },
{ start: 0xC044A9, s1: 26*26, s2: 26, prefix: "C-G" },
{ start: 0xE01041, s1: 4096, s2: 64, prefix: "LV-" }
Expand Down
52 changes: 29 additions & 23 deletions public_html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,35 +230,39 @@ function start_load_history() {
if (PositionHistorySize > 0) {
$("#loader_progress").attr('max',PositionHistorySize);
console.log("Starting to load history (" + PositionHistorySize + " items)");
load_history_item(0);
load_history_items();
} else {
end_load_history();
}
}

function load_history_item(i) {
if (i >= PositionHistorySize) {
end_load_history();
return;
function load_history_items() {
var loaded = 0;
// run all requests in parallel and let the browser handle concurrency
// (usually it is 2-4 concurrent requests)
for (var i = 0; i < PositionHistorySize; i++) {
$.ajax({ url: 'data/history_' + i + '.json',
timeout: 5000,
cache: false,
dataType: 'json' })
.done(function(data) {
if (loaded < 0) return;
PositionHistoryBuffer.push(data); // don't care for order, will sort later
loaded++;
console.log("Loaded " + loaded + " history chunks");
$("#loader_progress").attr('value', loaded);
if (loaded >= PositionHistorySize) {
loaded = -1;
end_load_history();
}
})
.fail(function(jqxhr, status, error) {
if (loaded < 0) return;
console.log("Failed to load history chunk");
loaded = -1;
end_load_history();
});
}

console.log("Loading history #" + i);
$("#loader_progress").attr('value',i);

$.ajax({ url: 'data/history_' + i + '.json',
timeout: 5000,
cache: false,
dataType: 'json' })

.done(function(data) {
PositionHistoryBuffer.push(data);
load_history_item(i+1);
})

.fail(function(jqxhr, status, error) {
// No more history
end_load_history();
});
}

function end_load_history() {
Expand Down Expand Up @@ -630,8 +634,10 @@ function refreshPageTitle() {
}

if (MessageRateInTitle) {
if(MessageRate != null) {
if (subtitle) subtitle += ' | ';
subtitle += MessageRate.toFixed(1) + '/s';
}
}

document.title = PageName + ' - ' + subtitle;
Expand Down
13 changes: 0 additions & 13 deletions testfiles/modes1.bin

This file was deleted.