Skip to content
Skills Library
DevOps & cloud · Automation

psportal-highbitrate-openwrt

/psportal-highbitrate-openwrt

Install, configure, verify and roll back the PS Portal high-bitrate relay on an OpenWrt/ImmortalWrt router (router-mode port of atameric/ps5-portal-high-bitrate). Use when a user wants to raise the PlayStation Portal → PS5 session bitrate target from the router itself, or when an installed relay does not patch a session and needs diagnosis.

Licence
MIT
Last repository change
08.11.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
7
Scripts
5
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 08.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 5 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/configure.sh, scripts/detect.sh, scripts/install.sh, scripts/rollback.sh, scripts/verify.sh

What it does and when to use it

Install, configure, verify and roll back the PS Portal high-bitrate relay on an OpenWrt/ImmortalWrt router (router-mode port of atameric/ps5-portal-high-bitrate). Use when a user wants to raise the PlayStation Portal → PS5 session bitrate target from the router itself, or when an installed relay does not patch a session and needs diagnosis.

Original author description

Install, configure, verify and roll back the PS Portal high-bitrate relay on an OpenWrt/ImmortalWrt router (router-mode port of atameric/ps5-portal-high-bitrate). Use when a user wants to raise the PlayStation Portal → PS5 session bitrate target from the router itself, or when an installed relay does not patch a session and needs diagnosis.

How it works

  1. 0. Hard gates (stop if any fails)
  2. 1. Install
  3. 2. Enroll (needs the two IPv4 addresses)
  4. 3. Baseline (mandatory, no mutation)
  5. 4. Verify the mutation path (bounded, recommended first)
  6. 5. Persist (only after step 4 passes)
  7. 6. Verification checklist
  8. 7. Diagnostics decision tree
  9. 8. Rollback
  10. 9. Hard rules
Original SKILL.md headings · 150 lines, 1,026 words
SKILL.md preview
---
name: psportal-highbitrate-openwrt
description: Install, configure, verify and roll back the PS Portal high-bitrate relay on an OpenWrt/ImmortalWrt router (router-mode port of atameric/ps5-portal-high-bitrate). Use when a user wants to raise the PlayStation Portal → PS5 session bitrate target from the router itself, or when an installed relay does not patch a session and needs diagnosis.
license: MIT
---

# PS Portal high-bitrate relay — OpenWrt router skill

Operate this repository on a live router. Follow the steps in order; every step
has a pass condition. Never skip a gate and never improvise nftables.

## 0. Hard gates (stop if any fails)

| Gate | Check |
|---|---|
| OpenWrt / ImmortalWrt with `fw4` (nftables) | `nft --version` works, `/etc/config/firewall` uses fw4 |
| Root shell on the router | `id -u` = 0 |
| `python3` ≥ 3.9 and `scapy` ≥ 2.6 | `python3 -c 'import scapy'` |
| ≥ 35 MB free on `/overlay` | `df -k /overlay` |
| PS5 and Portal on the **same L2** as the LAN bridge | both resolve on `br-lan`, no client isolation |
| Both devices awake and enrolled | DHCP reservations or leases visible |
| Human accepts experimental risk | one Portal firmware layout only was validated upstream (7.1.7) |

Run the automated probe instead of doing this by hand:

```sh
sh skill/scripts/detect.sh
```

It prints JSON with `"ok": true|false` and a `reasons` array. If `ok` is false,
report the reasons and stop.

## 1. Install

```sh
sh skill/scripts/install.sh
```

Idempotent: installs `python3`/`python3-pip` if missing, `scapy==2.6.1` via pip,
copies the modules to `/usr/lib/portal-bitrate`, installs the procd service and
the `portal-bitrate` CLI, precompiles bytecode.

Pass condition: `portal-bitrate 2>&1 | head -1` prints the usage header.

## 2. Enroll (needs the two IPv4 addresses)

Discover them from the router (never guess):

```sh
cat /tmp/dhcp.leases
ip neigh show dev br-lan
```

Confirm which MAC is the PS5 and which is the Portal with the human before
enrolling — a swapped enrollment silently relays the wrong direction.

```sh
sh skill/scripts/configure.sh --ps5-ip <PS5_IP> --portal-ip <PORTAL_IP> --profile 65
```

The script validates the addresses, detects the LAN bridge (default `br-lan`),
enrolls both MACs by ARP and writes `/etc/portal-bitrate/auto-config.json`.
It refuses to continue if either device does not answer ARP.

## 3. Baseline (mandatory, no mutation)

The baseline relays the real `Portal → PS5` control traffic without changing any
byte and writes a receipt. It requires a **fresh session** inside the window, so
this is a human-in-the-loop step:

1. Start it in the background with a generous window:
   `portal-bitrate baseline --seconds 240 > /tmp/psportal-baseline.log 2>&1 &`
2. Poll the log until it contains `BASELINE READY` (allow ~90 s: the guardian is
   a cold Python + scapy process on small routers).
3. Tell the human: "disconnect the Portal from the PS5, then reconnect it now".
4. Wait for the run to end, then check
   `/var/lib/portal-bitrate/auto-baseline.json` exists with `"restored": true`
   and `forwarded_out > 0`.

Pass condition: receipt present, `forwarded_out > 0`, `errors: []`,
`recovery.json` clean (no `restoration_errors`).

## 4. Verify the mutation path (bounded, recommended first)

```sh
portal-bitrate arm 180      # background window; prints "ready" when armed
```

`arm` waits for `AUTO READY` itself and prints `ready: disconnect the Portal from
the PS5, then reconnect it now.` Tell the human that line verbatim, then poll
`/var/lib/portal-bitrate/status.json`:

Pass condition: `counts.modified_packets_including_retransmits >= 1` **and**
`counts.unique_modified_startups >= 1`, and the human confirms picture/controls.
If the counters stay 0, the packet layout does not match — do not retry blindly;
report the firmware version and stop. The window ends by itself and restores the
direct path; verify with `sh skill/scripts/verify.sh` afterwards.

## 5. Persist (only after step 4 passes)

```sh
/etc/init.d/portal-bitrate enable
/etc/init.d/portal-bitrate start
sh skill/scripts/verify.sh     # must show exactly one relay instance
```

Service mode patches every new session automatically but forwards all
`Portal → PS5` control packets through userspace. On weak CPUs prefer telling the
human to run `portal-bitrate session <secs>` before each play session instead.

## 6. Verification checklist

`sh skill/scripts/verify.sh` prints JSON. Require all of:

- `relay_instances` ∈ {0, 2} (main + guardian; never 4+)
- if the service is enabled: `service_running: true`
- `guard_table_present` matches the relay state (present only while running)
- `arp_restored: true` when no relay is running
- `baseline_receipt: true` before active runs
- `config_enrolled: true`

## 7. Diagnostics decision tree

| Symptom | Cause | Fix |
|---|---|---|
| `ERROR: IPv4 forwarding is enabled. No changes made.` | router-mode env missing (the procd `env` list was overwritten) | use the CLI, or one list: `procd_set_param env PORTAL_BITRATE_ROUTER_MODE=1 PYTHONUNBUFFERED=1` |
| `ERROR: ` + `_queue.Empty` | guardian didn't report in time (cold start) | verify timeout is 90 s, run `python3 -m compileall -q /usr/lib/portal-bitrate/`, check RAM |
| `modified_packets_including_retransmits` stays 0 | no fresh session captured / layout mismatch | ensure the relay was armed before the reconnect; report firmware |
| Portal shows a network-warning icon but streaming works | half-open IPv6 on the LAN (addresses advertised, no IPv6 uplink) — `detect.sh` reports `ipv6_half_open: true` | disable LAN IPv6 (see `docs/troubleshooting.md`), then toggle Wi-Fi on the Portal |
| Portal stutters, drops to 720p/360p | CPU saturation on the router (OpenClash streaming auto-select, LuCI OpenClash page polling), Wi-Fi 20 MHz fallback, weak PS5 RSSI | `uci set openclash.config.stream_auto_select=0 && uci commit openclash && /etc/init.d/openclash restart`; close LuCI OpenClash tabs; check `iwinfo rax0 assoclist`; wire the PS5 |
| Portal cannot reach the PS5 at all | stale spoofed ARP after an unclean kill | `portal-bitrate repair` |
| Two relays / port 7681 UI says one instance but two run | manual run + service | stop service, kill leftover `portal_auto.py`, remove lock, start service |
| guard table left behind | hard kill | `portal-bitrate guard` |
| `Previous relay recovery is unconfirmed` | crash left the marker | `portal-bitrate repair` |
| baseline receipt rejected | `module/*.py` edited after baseline | re-run baseline |

## 8. Rollback

```sh
sh skill/scripts/rollback.sh            # keeps /etc/portal-bitrate config
sh skill/scripts/rollback.sh --purge    # removes enrollment too
```

Then confirm: no `portal_auto.py` process, no `inet portal_bitrate_guard` table,
ARP entries for the PS5/Portal are back to the real MACs.

## 9. Hard rules

- Only the scoped table `inet portal_bitrate_guard`; never `nft flush`, never
  `inet fw4`, never `ip_forward`, never DNS/DHCP edits.
- One relay instance; never mix `session` with the service.
- Never claim 4K or guaranteed latency gains — this port does neither.
- Never publish the user's MACs/IPs/Wi-Fi keys/subscription URLs.
- Do not reboot the router unless the human asks.
Files in this package (7)
  • SKILL.md 7 KB
  • manifest.json 3 KB
  • scripts/configure.sh 2 KB
  • scripts/detect.sh 4 KB
  • scripts/install.sh 1 KB
  • scripts/rollback.sh 1 KB
  • scripts/verify.sh 4 KB

Versions

The database has no other skills named psportal-highbitrate-openwrt.

Database snapshot: 13.11.2026 · package version d303f9c02510 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95openwrt-kwrt-remote-ops
    远程运维 OpenWrt / Kwrt(openwrt.ai 系)路由器——SSH 通道搭建、固件升级后抢修(全屋断网/DNS 黑洞/OpenClash 消失)、插件增删、新 opkg 不支持本地 ipk 时自建本地源离线安装、OpenClash 内核与启用故障、软件源报错定位、overlay 空间治理与 U 盘 extroot 建议。当用户给出路由器 IP/账号要求登录排障、说"升级固件后连不上网/WiFi 上不去、电脑没网"、提到 OpenClash/PassWall/SSR Plus 启用失败、opkg 软件源报错、装不上插件、overlay…
  • 100portal-relay-hetzner
    Create a Hetzner Cloud server for a Portal relay with the hcloud CLI, attach a Hetzner Cloud Firewall that opens only the relay ports, keep a stable primary IPv4, and hand the host to portal-relay for deployment. Use when the user wants to run a Portal relay on Hetzner Cloud. Do…
  • 100portal-relay
    Set up and run a public Portal relay on any Linux host with a public IP — Docker Compose deployment, embedded authoritative DNS with one-time NS delegation, optional TCP/UDP lease ports for game hosting, and registration in the public relay pool. Use when the user asks to run…
  • 100ztc1-control
    Install, configure, and control zTC1 Wi-Fi power strips on OpenWrt/LuCI (luci-app-ztc1control). Use when installing the ipk/apk, enabling the HTTP API, toggling plugs, setting timers/countdowns, querying device status, or troubleshooting port 8091 and service problems.…
  • 100openwrt-installer-image
    Use when building, repairing, or validating the OpenWrt Console installer ISO/USB image (the 192.168.1.1 embedded-router firmware image with situational-awareness and firewall databases, minus VPN keys and regional/port-map rules). Covers the four boot-stage failures that only…
  • 90dc-qalink-pi-setup
    Set up a DreamPi / Raspberry Pi (or any Linux box with pppd) as the dc-qalink relay from a PC on the same network - find it, key-based ssh, checks, install and start the relay service, verify. Use when asked to set up, install, find or fix the Pi / relay side of the Dreamcast QA link.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.