Skip to content

Commit

Permalink
Merge pull request #1135 from rpatel3001/inmarsat-L
Browse files Browse the repository at this point in the history
Inmarsat L band
  • Loading branch information
fredclausen authored Mar 30, 2024
2 parents 45e1b1d + 4b3e42d commit 562c8e6
Show file tree
Hide file tree
Showing 32 changed files with 560 additions and 102 deletions.
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Builds and runs on `amd64`, `arm64`, `arm/v7`, `arm/v6` and `386` architectures.
- [ACARS](#acars)
- [VDLM2](#vdlm2)
- [HFDL](#hfdl)
- [Inmarsat L-Band](#inmarsat-l-band)
- [Viewing the messages](#viewing-the-messages)
- [Which frequencies should you monitor](#which-frequencies-should-you-monitor)
- [A note about data sources used for the web site](#a-note-about-data-sources-used-for-the-web-site)
Expand Down Expand Up @@ -76,14 +77,15 @@ I am missing a boat load of people who have provided feed back as this project h

## Getting valid ACARS/VDLM2 data

External to ACARS Hub you need to be running an ACARS and/or VDLM2 decoder for ACARS Hub, and have that decoder connect to ACARS Hub to send over the messages for processing.
External to ACARS Hub you need to be running an ACARS, VDLM2, HFDL, and/or Inmarsat L-Band decoder for ACARS Hub, and have that decoder connect to ACARS Hub to send over the messages for processing.

The following decoders are supported:

- [acarsdec](https://github.com/TLeconte/acarsdec) or one of the forks of acarsdec. I suggest [the airframes fork](https://github.com/airframesio/acarsdec). Run the decoder with the option `-j youracarshubip:5550`, ensuring that port `5550` is mapped to the container if the source is external to your docker network.
- [dumpvdl2](https://github.com/szpajder/dumpvdl2). Run the decoder with the option `--output decoded:json:udp:address=<youracarshubip>,port=5555`, ensuring that port `5555` is mapped to the container if your source is external to the docker network.
- [vdlm2dec](https://github.com/TLeconte/vdlm2dec). Run the decoder with the option `-j youracarshubip:5555`, ensuring that port `5555` is mapped to the container if the source is external to the docker network.
- [dumphfdl](https://github.com/szpajder/dumphfdl). Run the decoder with the option `--output decoded:json:udp:address=<youracarshubip>,port=5556`, ensuring that port `5556` is mapped to the container if the source is external to the docker network..
- [dumphfdl](https://github.com/szpajder/dumphfdl). Run the decoder with the option `--output decoded:json:udp:address=<youracarshubip>,port=5556`, ensuring that port `5556` is mapped to the container if the source is external to the docker network.
- [satdump](https://github.com/SatDump/SatDump). Run the decoder with the Inmarsat.json options for `udp_sinks` set to `"address": "127.0.0.1"` and `"port": "5557"` , ensuring that port `5557` is mapped to the container..

For VDLM decoding `dumpvdl2` is preferred as the decoder provides richer data and is more modern than `vdlm2dec`.

Expand All @@ -93,6 +95,7 @@ For ease of use I have provided docker images set up to work with ACARS Hub. Thi
- [docker-dumpvdl2](https://github.com/sdr-enthusiasts/docker-dumpvdl2) for VDLM decoding. This is the preferred decoder.
- [docker-vdlm2dec](https://github.com/sdr-enthusiasts/docker-vdlm2dec) as an alternative for VDLM decoding. This decoder is far less feature-rich compared to `dumpvdl2` and is provided only as an alternative if you have a strong preference for using this over `dumpvdl2`.
- [docker-dumphfdl](https://github.com/sdr-enthusiasts/docker-dumphfdl) for HFDL decoding.
- [docker-satdump](https://github.com/rpatel3001/docker-satdump) for Inmarsat L-Band decoding.
- [acars_router](https://github.com/sdr-enthusiasts/acars_router) for routing ACARS messages from one source to another. This is useful if you have a decoder that can only send messages to one destination, but you want to send messages to multiple destinations. This is the preferred way to get data in to ACARS Hub.

## Up-and-Running
Expand All @@ -101,15 +104,17 @@ The document below covers a lot of configuration options, however, most of them

## Ports

| Port | Description |
| ---------- | ---------------------------------------- |
| `80` | Port used for the web interface |
| `5550/udp` | Port used for pushing ACARS JSON data to |
| `5555/udp` | Port used for pushing VDLM2 JSON data to |
| `5556/udp` | Port used for pushing HFDL JSON data to |
| `15550` | Port used for exposing JSON ACARS data |
| `15555` | Port used for exposing JSON VDLM2 data |
| `15556` | Port used for exposing JSON HFDL data |
| Port | Description |
| ---------- | -------------------------------------------------- |
| `80` | Port used for the web interface |
| `5550/udp` | Port used for pushing ACARS JSON data to |
| `5555/udp` | Port used for pushing VDLM2 JSON data to |
| `5556/udp` | Port used for pushing HFDL JSON data to |
| `5557/udp` | Port used for pushing Inmarsat L-Band JSON data to |
| `15550` | Port used for exposing JSON ACARS data |
| `15555` | Port used for exposing JSON VDLM2 data |
| `15556` | Port used for exposing JSON HFDL data |
| `15557` | Port used for exposing JSON Inmarsat L-Band data |

## Volumes / Database

Expand Down Expand Up @@ -197,6 +202,12 @@ In the configuration options for tar1090. Setting this will include additional a
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| `ENABLE_HFDL` | Toggle HFDL decoding on. If set to `external` this will enable HFDL processing in the container. Push valid `HFDL` data to UDP port 5556 (needs port mapping 5556:5556/udp). | No | `false` |

### Inmarsat L-Band

| Variable | Description | Required | Default |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| `ENABLE_IMSL` | Toggle Inmarsat L-Band decoding on. If set to `external` this will enable IMSL processing in the container. Push valid `IMSL` data to UDP port 5557 (needs port mapping 5557:5557/udp). | No | `false` |

## Viewing the messages

The container implements a basic web interface, listening on port `80`, which will show messages as they are received.
Expand Down Expand Up @@ -253,6 +264,8 @@ If there are airlines you notice that are wrong because the data used is wrong (
If you wish to access the JSON data that the decoders `acarsdec` and `dumpvdl2` generate with an external program expose the following ports in your docker-compose configuration:

- Port 80 for the web site
- Port 15557 for UDP Inmarsat L-Band JSON
- Port 15556 for UDP HFDL JSON
- Port 15555 for UDP VDLM2 JSON
- Port 15550 for UDP ACARS JSON

Expand All @@ -263,8 +276,12 @@ ports:
- 80:80
- 5550:5550/udp
- 5555:5555/udp
- 5556:5556/udp
- 5557:5557/udp
- 15550:15550
- 15555:15555
- 15556:15556
- 15557:15557
```

And then you will be able to connect to `yourpisipaddress:15555` or `yourpisipaddress:15550` respectively, in whatever program can decode ACARS/VDLM JSON.
Expand Down
2 changes: 1 addition & 1 deletion acarshub-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "acarshub-typescript",
"version": "3.4.0",
"version": "3.5.0",
"description": "Web front end for the docker-acarshub project",
"main": "index.js",
"repository": "https://github.com/sdr-enthusiasts/docker-acarshub",
Expand Down
30 changes: 18 additions & 12 deletions acarshub-typescript/src/helpers/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ export let menu = {
generate_stat_submenu: function (
acars: boolean = false,
vdlm: boolean = false,
hfdl: boolean = false
hfdl: boolean = false,
imsl: boolean = false
): void {
let text: string = "";
const acars_prefix = acars && vdlm ? "'acars'" : "''";
const vdlm_prefix = vdlm && acars ? "'vdlm'" : "''";
const hfdl_prefix = hfdl ? "'hfdl'" : "''";

let show_combined = false;
let ennum = [acars, vdlm, hfdl, imsl].filter(x => x).length;
// if any two of acars, vdlm, hfdl, imsl are true, set show_combined to true
let show_combined = ennum > 1;

// if any two of acars, vdlm, hfdl are true, set show_combined to true
if (acars && vdlm) show_combined = true;
if (acars && hfdl) show_combined = true;
if (vdlm && hfdl) show_combined = true;
const acars_prefix = show_combined ? "'acars'" : "''";
const vdlm_prefix = show_combined ? "'vdlm'" : "''";
const hfdl_prefix = show_combined ? "'hfdl'" : "''";
const imsl_prefix = show_combined ? "'imsl'" : "''";

if (show_combined) {
text =
Expand All @@ -82,22 +82,28 @@ export let menu = {

if (acars) {
text += `${
acars && vdlm ? " | " : ""
show_combined ? " | " : ""
}<a href="javascript:update_prefix(${acars_prefix})" id="acars_graphs" class="spread_text">ACARS Graphs</a>`;
}

if (vdlm) {
text += `${
acars && vdlm ? " | " : ""
show_combined ? " | " : ""
}<a href="javascript:update_prefix(${vdlm_prefix})" id="vdlm_graphs" class="spread_text">VDLM Graphs</a>`;
}

if (hfdl) {
text += `${
acars && vdlm ? " | " : ""
show_combined ? " | " : ""
}<a href="javascript:update_prefix(${hfdl_prefix})" id="hfdl_graphs" class="spread_text">HFDL Graphs</a>`;
}

if (imsl) {
text += `${
show_combined ? " | " : ""
}<a href="javascript:update_prefix(${imsl_prefix})" id="imsl_graphs" class="spread_text">IMSL Graphs</a>`;
}

text +=
' | <a href="javascript:update_prefix(\'error\')" id="error_graphs" class="spread_text">Message Error Graphs</a>';
$("#stat_menu").html(text);
Expand Down
5 changes: 3 additions & 2 deletions acarshub-typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,10 @@ export function sound_alert(): void {
export function generate_stat_submenu(
acars: boolean = false,
vdlm: boolean = false,
hfdl: boolean = false
hfdl: boolean = false,
imsl: boolean = false
): void {
menu.generate_stat_submenu(acars, vdlm, hfdl);
menu.generate_stat_submenu(acars, vdlm, hfdl, imsl);
}

export function find_matches(): plane_data {
Expand Down
1 change: 1 addition & 0 deletions acarshub-typescript/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface decoders {
acars: boolean;
vdlm: boolean;
hfdl: boolean;
imsl: boolean;
arch: string;
allow_remote_updates: boolean;
adsb: {
Expand Down
71 changes: 55 additions & 16 deletions acarshub-typescript/src/pages/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export let stats_page = {
chart_frequency_data_acars: (<unknown>null) as Chart,
chart_frequency_data_vdlm: (<unknown>null) as Chart,
chart_frequency_data_hfdl: (<unknown>null) as Chart,
chart_frequency_data_imsl: (<unknown>null) as Chart,
chart_message_counts_data: (<unknown>null) as Chart,
chart_message_counts_empty: (<unknown>null) as Chart,

Expand All @@ -55,6 +56,7 @@ export let stats_page = {
acars_on: false as boolean,
vdlm_on: false as boolean,
hfdl_on: false as boolean,
imsl_on: false as boolean,
width: 1000 as number,

tol: new palette("tol", 12, 0, "").map(function (hex: any) {
Expand Down Expand Up @@ -204,34 +206,42 @@ export let stats_page = {
let freq_data_acars: number[] = [];
let freq_data_vdlm: number[] = [];
let freq_data_hfdl: number[] = [];
let freq_data_imsl: number[] = [];

let freq_labels_acars: string[] = [];
let freq_labels_vdlm: string[] = [];
let freq_labels_hfdl: string[] = [];
let freq_labels_imsl: string[] = [];

let freq_labels_acars_positions: string[] = [];
let freq_labels_vdlm_positions: string[] = [];
let freq_labels_hfdl_positions: string[] = [];
let freq_labels_imsl_positions: string[] = [];

let freq_labels_acars_offset: number[] = [];
let freq_labels_vdlm_offset: number[] = [];
let freq_labels_hfdl_offset: number[] = [];
let freq_labels_imsl_offset: number[] = [];

let total_count_acars: number = 0;
let total_count_vdlm: number = 0;
let total_count_hfdl: number = 0;
let total_count_imsl: number = 0;

let acars_offset: number = 5;
let vdlm_offset: number = 5;
let hfdl_offset: number = 5;
let imsl_offset: number = 5;

Object.entries(this.freqs_data.freqs).forEach(([key, value]) => {
if (value.freq_type === "ACARS") {
total_count_acars += value.count;
} else if (value.freq_type === "HFDL") {
total_count_hfdl += value.count;
} else if (value.freq_type === "VDL-M2") {
total_count_vdlm += value.count;
} else if (value.freq_type === "HFDL") {
total_count_hfdl += value.count;
} else if (value.freq_type === "IMS-L") {
total_count_imsl += value.count;
} else {
console.error("Unknown freq type: " + value.freq_type);
}
Expand Down Expand Up @@ -274,6 +284,18 @@ export let stats_page = {
freq_labels_hfdl_offset.push(hfdl_offset);
hfdl_offset += 60;
}
} else if (value.freq_type === "IMS-L") {
freq_data_imsl.push(value.count);
freq_labels_imsl.push(value.freq);

if (value.count / total_count_imsl > 0.2) {
freq_labels_imsl_positions.push("center");
freq_labels_imsl_offset.push(0);
} else {
freq_labels_imsl_positions.push("end");
freq_labels_imsl_offset.push(imsl_offset);
imsl_offset += 60;
}
} else {
console.error("Unknown freq type: " + value.freq_type);
}
Expand All @@ -291,6 +313,10 @@ export let stats_page = {
this.chart_frequency_data_hfdl.destroy();
}

if (this.chart_frequency_data_imsl !== null) {
this.chart_frequency_data_imsl.destroy();
}

if (freq_data_acars.length > 0) {
this.render_freq_graph(
"ACARS",
Expand Down Expand Up @@ -323,6 +349,17 @@ export let stats_page = {
"#hfdl_freq_graph"
);
}

if (freq_data_imsl.length > 0) {
this.render_freq_graph(
"IMSL",
freq_labels_imsl,
freq_data_imsl,
total_count_imsl,
"frequencies_imsl",
"#imsl_freq_graph"
);
}
}
},

Expand Down Expand Up @@ -420,6 +457,8 @@ export let stats_page = {
this.chart_frequency_data_vdlm = temp_chart;
} else if (label === "HFDL") {
this.chart_frequency_data_hfdl = temp_chart;
} else if (label === "IMSL") {
this.chart_frequency_data_imsl = temp_chart;
}
// clamp the height of the parent container to the height of the chart based on the number of elements
// this is a hack to get the chart to display properly
Expand All @@ -433,21 +472,15 @@ export let stats_page = {
typeof this.count_data !== "undefined" &&
typeof this.count_data.count !== "undefined"
) {
const total: number =
this.count_data.count.non_empty_total +
this.count_data.count.empty_total +
this.count_data.count.non_empty_errors;
const total_non_empty: number =
this.count_data.count.non_empty_total +
this.count_data.count.non_empty_errors;
const error: number = this.count_data.count.non_empty_errors;
const good_msg: number = this.count_data.count.non_empty_total - error;
const data_error: number = this.count_data.count.non_empty_errors;
const data_good: number = this.count_data.count.non_empty_total;
const data_total: number = data_error + data_good;

const empty_error: number = this.count_data.count.empty_errors;
const empty_good: number = this.count_data.count.empty_total;
const empty_total: number = empty_error + empty_good;

const counts_data: number[] = [good_msg, error];
const counts_data: number[] = [data_good, data_error];

const counts_empty: number[] = [empty_good, empty_error];
const count_labels: string[] = [
Expand Down Expand Up @@ -500,7 +533,7 @@ export let stats_page = {
},
title: {
display: true,
text: `Non-Empty Messages (${total_non_empty.toLocaleString()})`,
text: `Non-Empty Messages (${data_total.toLocaleString()})`,
},
datalabels: {
backgroundColor: function (context: any) {
Expand All @@ -518,7 +551,7 @@ export let stats_page = {
" (" +
// count_labels[context.dataIndex] +
// "\n" +
((value / total_non_empty) * 100)
((value / data_total) * 100)
.toFixed(2)
.toLocaleString() +
"%) "
Expand Down Expand Up @@ -607,9 +640,10 @@ export let stats_page = {
this.acars_on = msg.acars;
this.vdlm_on = msg.vdlm;
this.hfdl_on = msg.hfdl;
this.imsl_on = msg.imsl;

if (this.stats_page_active)
generate_stat_submenu(this.acars_on, this.vdlm_on, this.hfdl_on);
generate_stat_submenu(this.acars_on, this.vdlm_on, this.hfdl_on, this.imsl_on);
},

signals: function (msg: signal): void {
Expand Down Expand Up @@ -733,6 +767,11 @@ export let stats_page = {
? '<div id="hfdl_freq_graph" class="chart-container"><div>&nbsp;</div><canvas id="frequencies_hfdl"></canvas></div>'
: ""
}
${
this.imsl_on
? '<div id="imsl_freq_graph" class="chart-container"><div>&nbsp;</div><canvas id="frequencies_imsl"></canvas></div>'
: ""
}
<div id="chart_msg_good" class="chart-container"><div>&nbsp;</div><canvas id="msg_count_data"></div>
<div id="chart_msg_empty" class="chart-container"><div>&nbsp;</div><canvas id="msg_count_empty"></div>
Expand Down Expand Up @@ -782,7 +821,7 @@ export let stats_page = {
Chart.register(...registerables);
// page is active
this.set_html();
generate_stat_submenu(this.acars_on, this.vdlm_on, this.hfdl_on);
generate_stat_submenu(this.acars_on, this.vdlm_on, this.hfdl_on, this.imsl_on);
this.show_signal_chart();
this.show_alert_chart();
this.show_count();
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/imsl_server/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /etc/s6-overlay/scripts/imsl_server
1 change: 1 addition & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/imsl_server/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/imsl_stats/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /etc/s6-overlay/scripts/imsl_stats
1 change: 1 addition & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/imsl_stats/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun
Empty file.
Empty file.
Loading

0 comments on commit 562c8e6

Please sign in to comment.