Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ This fork includes an option to use the [CeraUI](https://github.com/CERALIVE/Cer

## Moblink support

> [!WARNING]
> I will likely remove the integration of moblink in one of the next releases, since [datagutt/moblink-rust](https://github.com/datagutt/moblink-rust) implemented a service that makes the integration mostly obsolete. I would recommend disabling the moblink relay in this fork (setup.json) and installing the service instead: [Install moblink serivce](https://github.com/datagutt/moblink-rust#use-on-belabox).

This fork integrates [datagutt/moblink-rust](https://github.com/datagutt/moblink-rust) in the relay mode, meaning it allows Moblin apps in the network of the encoder (BELABOX) to use the network interfaces of the BELABOX including modems as Moblink relays for SRTLA from Moblin. It does not yet support using Moblinks or Moblin apps to be used as SRTLA relays for the BELABOX!

The implementation defaults to the password `1234` and uses auto-discovery to connect to "Moblin Streamers" in the network. You can change the password in the `setup.json` via SSH. As of now (2025-03-30) there is no UI for Moblink in this belaUI fork, nor CeraUI.
This fork previously integrated [datagutt/moblink-rust](https://github.com/datagutt/moblink-rust). This integration has been removed in favor of installing the new moblink service directly: [Install moblink on your BELABOX](https://github.com/datagutt/moblink-rust#use-on-belabox).

## Install the fork on your BELABOX

Expand Down Expand Up @@ -94,11 +89,6 @@ pair: https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on
`echo "ssh-..." >> /root/.ssh/authorized_keys`).
- Install rsync (`sudo apt install rsync`)
- Install an editor (e.g. `sudo apt install nano`)
- Edit the `/opt/belaUI/setup.json` and add the following line to your existing setup to enable the moblink relay:
```json
"moblink_relay_enabled": true
```
Make sure to add commas to the end of the lines before and after the new line, if necessary.

### Set up on host (currently tested on macOS)

Expand Down
16 changes: 0 additions & 16 deletions deploy-to-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,6 @@ rsync -rltvz --delete --chown=root:root \
--exclude setup.json \
"${DIST_PATH}/" "$RSYNC_TARGET"

# Install jq if its not installed
ssh "$SSH_TARGET" "jq --version 2>/dev/null || apt-get update && apt-get install -y jq"

# Add moblink_relay_enabled: true to setup.json
echo "Enabling Moblink Relay. You can disable it in $BELAUI_PATH/setup.json"
ssh "$SSH_TARGET" "cp $BELAUI_PATH/setup.json $BELAUI_PATH/setup.json.tmp"

# Enable moblink relay and set path to moblink-rust-relay
ssh "$SSH_TARGET" "cd $BELAUI_PATH; jq '.moblink_relay_enabled = true | .moblink_relay_bin = \"/opt/moblink-rust-relay/target/release/moblink-rust-relay\"' setup.json.tmp | sudo tee setup.json > /dev/null"
ssh "$SSH_TARGET" "rm $BELAUI_PATH/setup.json.tmp"

# Install moblink-rust-relay
ssh "$SSH_TARGET" "cd $BELAUI_PATH; bash ./install-moblink-rust-relay.sh"

echo "Moblink relay installed successfully."

# shellcheck disable=SC2029
ssh "$SSH_TARGET" "cd $BELAUI_PATH; bash ./override-belaui.sh"

Expand Down
19 changes: 2 additions & 17 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ TEMP_DIR="$HOME/.tmp/belaui"
TARGET_DIR="/opt/belaUI"

# Check if dependencies are installed
JQ_INSTALLED=$(jq --version 2>/dev/null) || false
RSYNC_INSTALLED=$(rsync --version 2>/dev/null) || false

# stop on error
set -e

if [ -z "$JQ_INSTALLED" ] || [ -z "$RSYNC_INSTALLED" ]; then
if [ -z "$RSYNC_INSTALLED" ]; then
echo "Installing missing dependencies"

sudo apt-get update
sudo apt-get install -y rsync jq
sudo apt-get install -y rsync
fi

# Clone the repository branch into a temporary directory
Expand Down Expand Up @@ -58,20 +57,6 @@ rm -rf "$TEMP_DIR"
# Set ownership to root:root and preserve permissions
sudo chown -R root:root $TARGET_DIR

# Add moblink_relay_enabled: true to setup.json
echo "Enabling Moblink Relay. You can disable it in $TARGET_DIR/setup.json"
sudo cp $TARGET_DIR/setup.json $TARGET_DIR/setup.json.tmp

# Enable moblink relay and set path to moblink-rust-relay
sudo jq '.moblink_relay_enabled = true | .moblink_relay_bin = "/opt/moblink-rust-relay/target/release/moblink-rust-relay"' $TARGET_DIR/setup.json.tmp | sudo tee $TARGET_DIR/setup.json > /dev/null
sudo rm $TARGET_DIR/setup.json.tmp

# Install moblink-rust-relay
cd $TARGET_DIR || exit
sudo bash ./install-moblink-rust-relay.sh

echo "Moblink relay installed successfully."

# Run the override script
cd $TARGET_DIR || exit
sudo bash ./override-belaui.sh
Expand Down
4 changes: 0 additions & 4 deletions server/belaUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { initRTMPIngestStats } from "./modules/ingest/rtmp.ts";
import { initSRTIngest } from "./modules/ingest/srt.ts";
import { updateModems } from "./modules/modems/modem-update-loop.ts";
import { UPDATE_GW_INT, updateGwWrapper } from "./modules/network/gateways.ts";
import { initMoblinkRelays } from "./modules/network/moblink-relay.ts";
import { initNetworkInterfaceMonitoring } from "./modules/network/network-interfaces.ts";
import { initRemote } from "./modules/remote/remote.ts";
import { setup } from "./modules/setup.ts";
Expand Down Expand Up @@ -75,8 +74,6 @@ if (setup.apt_update_enabled) {

initNetworkInterfaceMonitoring();

initMoblinkRelays();

// check for Cam Links on USB2 at startup
checkCamlinkUsb2();

Expand All @@ -96,6 +93,5 @@ process.on("SIGUSR2", function udevDeviceUpdate() {
// make sure we didn't inherit orphan processes
killall(["belacoder"]);
killall(["srtla_send"]);
killall(["moblink-rust-relay"]);

initHttpServer();
173 changes: 0 additions & 173 deletions server/modules/network/moblink-relay.ts

This file was deleted.

3 changes: 0 additions & 3 deletions server/modules/wifi/wifi-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import { logger } from "../../helpers/logger.ts";
import { getms } from "../../helpers/time.ts";

import { updateMoblinkRelayInterfaces } from "../network/moblink-relay.ts";
import {
NETIF_ERR_HOTSPOT,
getNetworkInterfaces,
Expand Down Expand Up @@ -236,8 +235,6 @@ export async function wifiUpdateDevices() {
}
logger.debug("Wifi interfaces", wifiInterfacesByMacAddress);

updateMoblinkRelayInterfaces();

/* If some wifi adapters were marked unavailable, recheck periodically
This might happen when the system has just booted up and the adapter
typically becomes available within 30 seconds.
Expand Down
5 changes: 1 addition & 4 deletions setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
"mmcli_binary": "./mocks/mmcli",
"killall_binary": "./mocks/killall",
"bitrate_file": "/tmp/belacoder_br",
"ips_file": "/tmp/srtla_ips",
"moblink_relay_enabled": true,
"moblink_relay_bin": "/opt/moblink-rust-relay/target/release/moblink-rust-relay",
"moblink_relay_streamer_password": "1234"
"ips_file": "/tmp/srtla_ips"
}