Saltar al contenido principal

Fixing the Obico Webcam Feed on Debian 13 (Trixie): Building Janus from Source

· 8 min de lectura

If you've upgraded a printer host to Debian 13 "Trixie" — or you're running a board like the BTT CB1 on a recent Armbian image — you may find that your Obico webcam feed stops working. The premium (high-FPS) stream never starts, and the logs are not especially forthcoming about why.

The short version: Trixie ships no janus package, and Obico's bundled fallback binaries don't cover Debian 13 either. So you have to build Janus yourself — and there are four separate ways to build it that look successful but leave you with a Janus that Obico can't use.

tip

This post is based on a fix worked out and shared by a member of the Obico community in our Discord server, after debugging a BTT CB1 running Armbian 7.0.2 (Debian Trixie). Thanks for writing it up and sharing it back.

What Janus does for Obico

Janus is a WebRTC media server. Obico uses it to deliver the smooth, high-frame-rate webcam stream — the "premium streaming" feature. Without it, you fall back to a low-FPS stream, or to no feed at all.

Normally you never think about it. The Obico installer either finds Janus already on the system or drops in a precompiled copy. Trixie breaks both paths at once.

Why Trixie specifically

There are two independent failures stacking up here.

1. There is no janus package in Trixie. The package exists in bookworm (Debian 12) and again in forky/sid (what comes after Trixie), but it is absent from trixie, trixie-updates, and trixie-backports. It appears to have dropped out during the Trixie freeze and was never backported. So the standard advice — sudo apt-get install -y janus — simply fails with "Unable to locate package".

2. Obico's precompiled fallback doesn't cover Debian 13. When moonraker-obico can't find a system Janus, it looks for a bundled binary matching your board and OS. The bundled variants are:

rpi.debian.11.32-bit    rpi.debian.11.64-bit
rpi.debian.12.32-bit rpi.debian.12.64-bit
mks.debian.10.64-bit

Two things go wrong. There's no Debian 13 build at all, so a Raspberry Pi on Trixie falls back to the Debian 12 binary — which may or may not run against Trixie's newer libraries. And on a board that isn't a Raspberry Pi or a Makerbase/ROC-RK3328-CC, the board identifier resolves to NA, which matches none of the bundled directories. In that case there is no fallback at all.

That second case is a CB1 on Trixie: no distro package, no matching precompiled binary, nothing.

The log lines to look for

If you're searching moonraker_obico.log and landed here, these are the symptoms:

janus_bin_path: None
Janus quit with exit code 1
No Janus API transport is available

janus_bin_path: None means Obico found neither a system Janus nor a usable bundled one — that's the "nothing at all" case above. The other two mean Janus was found and launched, but was built without something Obico needs.

The four things that go wrong when you build by hand

Building Janus from source is straightforward. Building it so that Obico can actually use it is where people get stuck, because every one of these failure modes is silent.

1. Missing build dependencies produce no error

./configure does not fail when libwebsockets-dev or libusrsctp-dev are absent. It quietly builds a Janus without the WebSockets transport or without data channel support. You find out later, at runtime, with "No Janus API transport is available".

Obico talks to Janus over WebSockets specifically — it explicitly disables the HTTP transport in the config it generates — so libjanus_websockets.so is not optional.

2. Data channels are off by default

Obico uses a WebRTC data channel to pass messages alongside the video. You need to configure with --enable-data-channels explicitly, and then actually verify it took:

./configure --prefix=/usr --sysconfdir=/etc --enable-data-channels

Check the configure summary for DataChannels support: yes. If it says no, libusrsctp-dev didn't install correctly.

This one is nasty. If you already built Janus once without --enable-data-channels, re-running ./configure with the flag and then plain make may relink previously-compiled object files rather than rebuilding them. The build succeeds, and you get the same broken binary you had before.

Always make clean && make.

4. Obico finds Janus through dpkg, not PATH

This is the least obvious one. moonraker-obico locates a system Janus by running dpkg -L janus and parsing the output. It needs to find:

  • exactly one path ending in /bin/janus
  • a path containing /janus/plugins/libjanus_streaming.so

A plain sudo make install puts Janus on your system but registers nothing with dpkg, so Obico will never find it. The install has to be dpkg-registered. (checkinstall is the usual shortcut for this, but it proved unreliable on Trixie — the script below builds a minimal .deb by hand instead.)

The script

The script below does all of the above in order, and — importantly — verifies each critical step instead of assuming it worked. It fails loudly if data channels didn't get enabled, and it checks the dpkg registration for the exact paths Obico looks for.

Read it before you run it

This applies to any script you find on the internet, not just this one. Read through it first so you understand what it does to your system. If you're not comfortable reading shell scripts, paste it into an AI assistant and ask it to explain what each step does before you run anything.

#!/usr/bin/env bash
#
# Build and install Janus WebRTC Gateway for Obico on Debian
# trixie / Armbian, where no distro `janus` package is available.

set -euo pipefail

JANUS_SRC="${1:-$HOME/janus-gateway}"
PKG_VERSION="1.4.2" # update as needed with Janus source version

echo "==> Installing build dependencies"
sudo apt update
sudo apt install -y \
git build-essential autoconf automake libtool pkg-config gengetopt \
libmicrohttpd-dev libjansson-dev libssl-dev libsofia-sip-ua-dev \
libglib2.0-dev libopus-dev libogg-dev libcurl4-openssl-dev \
liblua5.3-dev libconfig-dev libnice-dev libsrtp2-dev \
libwebsockets-dev libusrsctp-dev

if [ ! -d "$JANUS_SRC" ]; then
echo "==> Cloning janus-gateway to $JANUS_SRC"
git clone https://github.com/meetecho/janus-gateway.git "$JANUS_SRC"
fi

cd "$JANUS_SRC"

if [ ! -f configure ]; then
echo "==> Running autogen.sh"
./autogen.sh
fi

echo "==> Configuring (WebSockets + DataChannels enabled)"
CONFIGURE_OUTPUT="$(./configure --prefix=/usr --sysconfdir=/etc --enable-data-channels 2>&1)"
echo "$CONFIGURE_OUTPUT"
echo "==> Confirm DataChannels support is actually enabled before continuing"
if ! echo "$CONFIGURE_OUTPUT" | grep -q "DataChannels support:.*yes"; then
echo "!! DataChannels support did not report 'yes' in the configure summary."
echo "!! Check that libusrsctp-dev installed correctly before continuing."
exit 1
fi

echo "==> Clean build (avoiding silently keeping stale objects linked)"
make clean && make

echo "==> Removing any previous janus dpkg registration, if present"
sudo dpkg -r janus 2>/dev/null || true

echo "==> Staging install into a fake root for packaging"
rm -rf /tmp/janus-pkg
mkdir -p /tmp/janus-pkg/DEBIAN
make install DESTDIR=/tmp/janus-pkg

cat <<EOF | sudo tee /tmp/janus-pkg/DEBIAN/control > /dev/null
Package: janus
Version: ${PKG_VERSION}
Section: net
Priority: optional
Architecture: $(dpkg --print-architecture)
Maintainer: $(whoami) <$(whoami)@$(hostname)>
Description: Janus WebRTC Gateway (built from source, with WebSockets + DataChannels)
EOF

echo "==> Building and installing the .deb"
dpkg-deb --build --root-owner-group /tmp/janus-pkg /tmp/janus.deb
sudo dpkg -i /tmp/janus.deb

echo "==> Verifying dpkg registration (this is what Obico checks)"
JANUS_DPKG_LISTING="$(dpkg -L janus)"
VERIFY_FAILED=0

check_dpkg_entry() {
local pattern="$1"
local label="$2"
if echo "$JANUS_DPKG_LISTING" | grep -qE "$pattern"; then
echo " OK - $label found in dpkg registration"
else
echo " FAIL - $label NOT found in dpkg registration"
VERIFY_FAILED=1
fi
}

check_dpkg_entry 'bin/janus$' "janus binary"
check_dpkg_entry 'libjanus_streaming\.so' "streaming plugin"
check_dpkg_entry 'libjanus_websockets\.so' "websockets transport"

if [ "$VERIFY_FAILED" -ne 0 ]; then
echo
echo "!! dpkg registration is incomplete. Obico's find_system_janus_paths()"
echo "!! runs 'dpkg -L janus' and will not find Janus correctly until"
echo "!! every check above passes."
echo "!! Re-run 'dpkg -L janus' by hand to inspect what actually got"
echo "!! registered, and check the make/dpkg-deb output above for errors."
exit 1
fi

echo
echo "Done. Restart moonraker-obico to pick it up:"
echo " sudo systemctl restart moonraker-obico"

Save it, make it executable, and run it:

chmod +x build-and-install-janus-for-obico-on-trixie.sh
./build-and-install-janus-for-obico-on-trixie.sh

Note that this compiles Janus from source on the printer host. On a small single-board computer that can take a while — budget 10–20 minutes and don't do it mid-print.

Verifying it worked

After the script finishes, restart the Obico service:

sudo systemctl restart moonraker-obico

Then check the log for the line that previously said None:

grep janus_bin_path ~/printer_data/logs/moonraker-obico.log | tail -1

You want an actual path, something like /usr/bin/janus. Load your printer in the Obico app and the premium stream should come up.

If it still doesn't, run dpkg -L janus by hand and confirm the three paths the script checks for are all present.

A note on running scripts from the internet

The community member who shared this fix added a caveat worth repeating, because it's good general advice: read any script you pull off the internet before you run it, especially one that runs sudo. If you'd rather not read shell yourself, hand it to an AI assistant and ask it to walk you through what it does. It takes a minute and it's a habit worth having.

Getting help

If you're stuck on Janus, webcam streaming, or anything else Obico-related, come find us in the Obico Discord. Community fixes like this one are exactly how a lot of the rough edges get found.

— The Obico Team