Skip to content

Commit 1b3edaa

Browse files
authored
Merge pull request #282 from OpenIPC/build/camex-4.0.1
build: camex 4.0.1 in the tunnel, TCP fixed (2.24.3)
2 parents e61184f + 60c7428 commit 1b3edaa

8 files changed

Lines changed: 40 additions & 10 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ Versions after 2.17 are `MAJOR.MINOR.PATCH` (2.17 is followed by 2.17.1 or 2.18.
1212
`docs/testing.md`, "Versions and releases"); the headings below keep the numbers as they
1313
were released.
1414

15+
## 2.24.3 — 2026-11-18
16+
17+
- The camex tunnel is built from camex 4.0.1 (was 4.0.0), which fixes the tunnel over TCP:
18+
a frame body read in pieces lost its first piece, so traffic from the server to the box
19+
stalled at about 10 KB/s (OpenIPC/camex#180). The client library had the bug too, so a
20+
TCP tunnel needs this build as well as a 4.0.1 server. UDP is unaffected.
21+
- `tests/e2e.sh` takes `TRANSPORT=TCP` and checks the video rate through the tunnel.
22+
1523
## 2.24.2 — 2026-11-17
1624

1725
- The camex tunnel is built from camex 4.0.0 (was 3.19.0). The Android library is unchanged:

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Every item, the remote, sharing a URL from another app and **Reset**: [Usage](do
8989

9090
## Network (a tunnel to the cameras)
9191

92-
Decoder has a tunnel built in, [OpenIPC camex](https://github.com/OpenIPC/camex) 4.0.0: cameras that are clients of the same camex server are watched from anywhere, without a separate VPN app. **Network** in the menu (a row under the grid) holds the server (`host:port`), the client name (the box's ID on the server), UDP or TCP, the server's public key, the pre-shared key, the server timeout, the password of the debug page and **On**: connect now and at every start. Off by default. The server gives the address, MTU and routes; only the tunnel network and the server's routes (none wider than a /8) go through it, the local network is reached as before. The state is shown in the dialog (Connecting, Connected with the address, VPN consent needed, Failed) and in a notification. A camera reached through the tunnel plays over TCP with Auto. Decoder tells the server its web page is on port 8085 (for nginx there; a camex server 3.19.0 or later). The password, when set, guards that page from the local network and through the tunnel alike; empty (the default), the page is open.
92+
Decoder has a tunnel built in, [OpenIPC camex](https://github.com/OpenIPC/camex) 4.0.1: cameras that are clients of the same camex server are watched from anywhere, without a separate VPN app. **Network** in the menu (a row under the grid) holds the server (`host:port`), the client name (the box's ID on the server), UDP or TCP, the server's public key, the pre-shared key, the server timeout, the password of the debug page and **On**: connect now and at every start. Off by default. The server gives the address, MTU and routes; only the tunnel network and the server's routes (none wider than a /8) go through it, the local network is reached as before. The state is shown in the dialog (Connecting, Connected with the address, VPN consent needed, Failed) and in a notification. A camera reached through the tunnel plays over TCP with Auto. Decoder tells the server its web page is on port 8085 (for nginx there; a camex server 3.19.0 or later). The password, when set, guards that page from the local network and through the tunnel alike; empty (the default), the page is open.
9393

9494
<p align="center">
9595
<img src="screenshots/network.jpg" alt="The Network dialog on a TV box: connected, the server and the client name" width="400">

‎README.ru.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
## Network (туннель к камерам)
9191

92-
В Decoder встроен туннель [OpenIPC camex](https://github.com/OpenIPC/camex) 4.0.0: камеры, подключённые клиентами к тому же серверу camex, видны откуда угодно, без отдельного VPN-приложения. Пункт **Network** в меню (ряд под сеткой): сервер (`host:port`), имя клиента (идентификатор приставки на сервере), UDP или TCP, открытый ключ сервера, общий ключ (psk), таймаут сервера, пароль отладочной страницы и **On** — подключиться сейчас и при каждом запуске. По умолчанию выключено. Адрес, MTU и маршруты выдаёт сервер; через туннель идут только его сеть и маршруты сервера (не шире /8), локальная сеть доступна как прежде. Состояние видно в окне (Connecting, Connected с адресом, VPN consent needed, Failed) и в уведомлении. Камера за туннелем в режиме Auto идёт по TCP. Decoder сообщает серверу, что его веб-страница на порту 8085 (для nginx на сервере; нужен сервер camex 3.19.0 или новее). Пароль, если задан, закрывает эту страницу одинаково из локальной сети и через туннель; пустой (по умолчанию) — страница открыта.
92+
В Decoder встроен туннель [OpenIPC camex](https://github.com/OpenIPC/camex) 4.0.1: камеры, подключённые клиентами к тому же серверу camex, видны откуда угодно, без отдельного VPN-приложения. Пункт **Network** в меню (ряд под сеткой): сервер (`host:port`), имя клиента (идентификатор приставки на сервере), UDP или TCP, открытый ключ сервера, общий ключ (psk), таймаут сервера, пароль отладочной страницы и **On** — подключиться сейчас и при каждом запуске. По умолчанию выключено. Адрес, MTU и маршруты выдаёт сервер; через туннель идут только его сеть и маршруты сервера (не шире /8), локальная сеть доступна как прежде. Состояние видно в окне (Connecting, Connected с адресом, VPN consent needed, Failed) и в уведомлении. Камера за туннелем в режиме Auto идёт по TCP. Decoder сообщает серверу, что его веб-страница на порту 8085 (для nginx на сервере; нужен сервер camex 3.19.0 или новее). Пароль, если задан, закрывает эту страницу одинаково из локальной сети и через туннель; пустой (по умолчанию) — страница открыта.
9393

9494
<p align="center">
9595
<img src="screenshots/network.jpg" alt="Окно Network на ТВ-приставке: подключено, сервер и имя клиента" width="400">

‎README.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
## Network(通往摄像头的隧道)
9191

92-
Decoder 内置 [OpenIPC camex](https://github.com/OpenIPC/camex) 4.0.0 隧道:作为客户端接入同一台 camex 服务器的摄像头,可以在任何地方观看,无需另装 VPN 应用。菜单中的 **Network**(网格下方一行)包含:服务器(`host:port`)、客户端名称(设备在服务器上的 ID)、UDP 或 TCP、服务器公钥、预共享密钥、服务器超时、调试页面密码,以及 **On**:立即连接并在每次启动时连接。默认关闭。地址、MTU 和路由由服务器下发;只有隧道网络和服务器的路由(不宽于 /8)经过隧道,本地网络照常访问。状态显示在对话框(Connecting、Connected 及地址、VPN consent needed、Failed)和通知中。经隧道访问的摄像头在 Auto 模式下走 TCP。Decoder 告知服务器其网页位于 8085 端口(供服务器上的 nginx 使用;需 camex 服务器 3.19.0 或更新版本)。设置密码后,无论从本地网络还是经隧道访问,该页面都需要密码;为空(默认)时页面开放。
92+
Decoder 内置 [OpenIPC camex](https://github.com/OpenIPC/camex) 4.0.1 隧道:作为客户端接入同一台 camex 服务器的摄像头,可以在任何地方观看,无需另装 VPN 应用。菜单中的 **Network**(网格下方一行)包含:服务器(`host:port`)、客户端名称(设备在服务器上的 ID)、UDP 或 TCP、服务器公钥、预共享密钥、服务器超时、调试页面密码,以及 **On**:立即连接并在每次启动时连接。默认关闭。地址、MTU 和路由由服务器下发;只有隧道网络和服务器的路由(不宽于 /8)经过隧道,本地网络照常访问。状态显示在对话框(Connecting、Connected 及地址、VPN consent needed、Failed)和通知中。经隧道访问的摄像头在 Auto 模式下走 TCP。Decoder 告知服务器其网页位于 8085 端口(供服务器上的 nginx 使用;需 camex 服务器 3.19.0 或更新版本)。设置密码后,无论从本地网络还是经隧道访问,该页面都需要密码;为空(默认)时页面开放。
9393

9494
<p align="center">
9595
<img src="screenshots/network.jpg" alt="电视盒子上的 Network 对话框:已连接、服务器和客户端名称" width="400">

‎android/app/build.gradle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ android {
2626
applicationId "com.openipc.decoder"
2727
minSdk 21
2828
targetSdk 36
29-
versionCode 59
30-
versionName "2.24.2"
29+
versionCode 60
30+
versionName "2.24.3"
3131
// Keep only these locales of the libraries' resources, as in the other OpenIPC apps
3232
resourceConfigurations += ['en', 'ru', 'zh-rCN']
3333

‎docs/testing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ cd android
138138

139139
The native code is built for arm64-v8a and armeabi-v7a by default; `-PdecoderAbis` takes a list of `arm64-v8a`, `armeabi-v7a`, `x86_64`, `x86` (an empty or unknown one fails the build).
140140

141-
`tests/e2e.sh [API]` plays a camera through a camex server and the tunnel on an x86_64 emulator in Docker (API 21 and 34 are checked): 14 checks, from no camera with Network off to the password of the debug page through the tunnel and a restart of the tunnel with Network → Save. Its output is in `tests/out/` (ignored by git).
141+
`tests/e2e.sh [API]` plays a camera through a camex server and the tunnel on an x86_64 emulator in Docker (API 21 and 34 are checked): 15 checks (16 with `TRANSPORT=TCP`, the tunnel over TCP), from no camera with Network off to the password of the debug page through the tunnel and a restart of the tunnel with Network → Save. Its output is in `tests/out/` (ignored by git).
142142

143143
A release build needs a keystore at `android/key.jks` and `KEYSTORE_PASS`, `KEY_ALIAS`, `KEY_PASS` in the environment (`./gradlew assembleRelease`). Debug and release builds are signed with different keys: to switch, uninstall first, which removes the saved camera URLs.
144144

‎tests/e2e.sh‎

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
# (default ~/.cache/compot/toolchains/android-emulator)
3131
# GRADLE_CACHE Gradle cache (default ~/.gradle)
3232
# KVM_GROUP group id of /dev/kvm on the Docker host (default 992)
33+
# TRANSPORT the tunnel's transport in Network: UDP or TCP (default UDP); the hub takes
34+
# both on one port, the Linux edge stays on UDP
3335
# SHOTS 1: slot 1 over TCP, a lighter camera stream and screenshots in tests/out/shots
3436
# (the picture through the tunnel, the menu, the Network dialog); the emulator's
3537
# software decoder still drops some frames: README pictures come from a TV box
@@ -50,6 +52,8 @@ EMULATOR_DIR=${EMULATOR_DIR:-$HOME/.cache/compot/toolchains/android-emulator}
5052
GRADLE_CACHE=${GRADLE_CACHE:-$HOME/.gradle}
5153
KVM_GROUP=${KVM_GROUP:-992}
5254
SHOTS=${SHOTS:-}
55+
TRANSPORT=${TRANSPORT:-UDP}
56+
case $TRANSPORT in UDP|TCP) ;; *) echo "TRANSPORT must be UDP or TCP"; exit 2 ;; esac
5357
TUNNEL=camex
5458
RESTART_MARK="Tunnel initialized" # camex's log line of each new run (bundles/camex/src/camex.c)
5559
NAME=decoder-e2e-$$
@@ -142,7 +146,7 @@ until LINUX_IP=$(docker exec "$PEER" cat /proc/net/fib_trie 2>/dev/null |
142146
i=$((i + 1)); [ $i -lt 30 ] || { echo "the camex client got no address"; exit 1; }
143147
sleep 1
144148
done
145-
echo "hub ($TUNNEL): $HUB_IP:$HUB_PORT, Linux client: $LINUX_IP"
149+
echo "hub ($TUNNEL, Decoder on $TRANSPORT): $HUB_IP:$HUB_PORT, Linux client: $LINUX_IP"
146150

147151
# the camera: an RTSP server in the Linux edge's network namespace, a 1280x720 test picture
148152
# (screenshots: a lighter stream, the emulator's software decoder keeps up with it)
@@ -174,7 +178,7 @@ WEB_PASSWORD=e2e-pass
174178
# the tunnel's values as the Network screen keeps them (tunnel_<id>_<field>)
175179
TUNNEL_SETTINGS="<string name=\"tunnel_camex_server\">$HUB_IP:5800</string>\
176180
<string name=\"tunnel_camex_name\">decoder</string>\
177-
<string name=\"tunnel_camex_transport\">UDP</string>\
181+
<string name=\"tunnel_camex_transport\">$TRANSPORT</string>\
178182
<string name=\"tunnel_camex_pubkey\">$CAMEX_PUBKEY</string>\
179183
<string name=\"tunnel_camex_psk\">$KEY</string>\
180184
<string name=\"web_password\">$WEB_PASSWORD</string>"
@@ -245,7 +249,10 @@ fi
245249
# a few rounds: the edges find each other through the hub first (slow on Android 5)
246250
pinged=""
247251
for _ in 1 2 3 4 5; do
248-
if $ADB shell ping -c 3 -W 2 "$LINUX_IP" | grep -q ' [123] received'; then pinged=1; break; fi
252+
P=$($ADB shell ping -c 3 -W 2 "$LINUX_IP" || true)
253+
if printf '%s\n' "$P" | grep -q ' [123] received'; then
254+
pinged=1; printf '%s\n' "$P" | grep 'min/avg' || true; break
255+
fi
249256
done
250257
if [ -n "$pinged" ]; then ok "ping through the tunnel to $LINUX_IP"; else bad "no ping to $LINUX_IP"; fi
251258

@@ -291,6 +298,21 @@ else
291298
fi
292299
$ADB exec-out screencap -p > "$OUT/decoder.png" 2>/dev/null || true
293300

301+
# the tunnel's transport: on TCP the app keeps a connection to the hub's port (state 01)
302+
if [ "$TRANSPORT" = TCP ]; then
303+
if $ADB shell cat /proc/net/tcp /proc/net/tcp6 2>/dev/null |
304+
awk -v p=":$(printf '%04X' $HUB_PORT)" '$3 ~ p "$" && $4 == "01" { f = 1 } END { exit !f }'; then
305+
ok "the tunnel runs over TCP to the hub"
306+
else bad "no TCP connection to the hub's port $HUB_PORT"; fi
307+
fi
308+
# the video keeps coming through the tunnel, hub to box; the Docker network has no real round
309+
# trip, so this does not catch camex#180 (TCP at ~10 KB/s with 60 ms RTT; camex has its own test)
310+
rx() { $ADB shell cat /proc/net/dev | awk -F'[: ]+' '$2 == "tun0" { print $3 }'; }
311+
r1=$(rx); sleep 10; r2=$(rx)
312+
RATE_KB=$(( (${r2:-0} - ${r1:-0}) / 10240 ))
313+
if [ "$RATE_KB" -ge 100 ]; then ok "video through the tunnel at $RATE_KB KB/s"; else
314+
bad "video through the tunnel at $RATE_KB KB/s (want 100 or more)"; fi
315+
294316
# the debug page through the tunnel, from the Linux client: the password set in Network is asked
295317
code() { docker exec "$PEER" curl -s -o /dev/null -m 10 -w '%{http_code}' "$@" "http://$TUN:8085/stats.json"; }
296318
c0=$(code) c1=$(code -u "x:wrong") c2=$(code -u "anyone:$WEB_PASSWORD")

0 commit comments

Comments
 (0)