Backend unavailable — start sensing-server #55

Closed
opened 2026-03-01 15:05:42 +08:00 by ruinmi · 3 comments
ruinmi commented 2026-03-01 15:05:42 +08:00 (Migrated from github.com)

I ran this on WSL2 and here is the commands I use:

Image Image Image
I ran this on WSL2 and here is the commands I use: <img width="883" height="187" alt="Image" src="https://github.com/user-attachments/assets/978d8a82-ab17-4cb2-8cad-60ca4c4310e6" /> <img width="2210" height="1391" alt="Image" src="https://github.com/user-attachments/assets/5623f76f-0870-405f-a066-7e9a59dc7be1" /> <img width="1272" height="1033" alt="Image" src="https://github.com/user-attachments/assets/e16a607c-fb28-448d-b60a-ef4ae040809a" />
ruvnet commented 2026-03-01 15:13:22 +08:00 (Migrated from github.com)

Fixed in 3b72f353 and the Docker Hub image has been republished.

Root Cause

The UI had three hardcoded port references that didn't match the Docker container:

File Was Now
`ui/config/api.config.js:4` `http://localhost:8080` `window.location.origin` (auto-detect)
`ui/config/api.config.js:119` `localhost:8080` (WebSocket) `window.location.host` (auto-detect)
`ui/services/sensing.service.js:11` `ws://localhost:8765/ws/sensing` Derived from page origin

The server binary defaults to HTTP on 8080 and WebSocket on 8765. Inside Docker, the Dockerfile passes `--http-port 3000 --ws-port 3001`. The UI was ignoring the actual serving port and always trying 8080/8765 — which don't exist inside the container.

What Changed

  1. UI auto-detects port — `BASE_URL` and WebSocket URL now use `window.location.origin` / `window.location.host`, so the UI works on any port (Docker :3000, native :8080, custom)

  2. WebSocket on HTTP port — Added `/ws/sensing` route to the HTTP server (port 3000) so the UI only needs one port to reach both REST and WebSocket. The dedicated WS port (3001) still works for direct connections.

Verify

docker pull ruvnet/wifi-densepose:latest
docker run -p 3000:3000 ruvnet/wifi-densepose:latest
# Open http://localhost:3000/ui/index.html

The "Backend unavailable" warning should no longer appear. The Sensing tab's Gaussian splat visualization should connect and show live simulated data.

Verified endpoints on the new image:

  • `GET /health` → `{"status":"ok"}`
  • `GET /api/v1/sensing/latest` → live CSI data
  • `GET /api/v1/vital-signs` → breathing + heartbeat
  • `ws://localhost:3000/ws/sensing` → WebSocket stream (same port as HTTP)
  • `http://localhost:3000/ui/index.html` → Three.js UI (24 KB)
Fixed in [3b72f353](https://github.com/ruvnet/wifi-densepose/commit/3b72f353) and the Docker Hub image has been republished. ### Root Cause The UI had **three hardcoded port references** that didn't match the Docker container: | File | Was | Now | |------|-----|-----| | \`ui/config/api.config.js:4\` | \`http://localhost:8080\` | \`window.location.origin\` (auto-detect) | | \`ui/config/api.config.js:119\` | \`localhost:8080\` (WebSocket) | \`window.location.host\` (auto-detect) | | \`ui/services/sensing.service.js:11\` | \`ws://localhost:8765/ws/sensing\` | Derived from page origin | The server binary defaults to HTTP on 8080 and WebSocket on 8765. Inside Docker, the Dockerfile passes \`--http-port 3000 --ws-port 3001\`. The UI was ignoring the actual serving port and always trying 8080/8765 — which don't exist inside the container. ### What Changed 1. **UI auto-detects port** — \`BASE_URL\` and WebSocket URL now use \`window.location.origin\` / \`window.location.host\`, so the UI works on **any port** (Docker :3000, native :8080, custom) 2. **WebSocket on HTTP port** — Added \`/ws/sensing\` route to the HTTP server (port 3000) so the UI only needs **one port** to reach both REST and WebSocket. The dedicated WS port (3001) still works for direct connections. ### Verify ```bash docker pull ruvnet/wifi-densepose:latest docker run -p 3000:3000 ruvnet/wifi-densepose:latest # Open http://localhost:3000/ui/index.html ``` The "Backend unavailable" warning should no longer appear. The Sensing tab's Gaussian splat visualization should connect and show live simulated data. Verified endpoints on the new image: - \`GET /health\` → \`{"status":"ok"}\` - \`GET /api/v1/sensing/latest\` → live CSI data - \`GET /api/v1/vital-signs\` → breathing + heartbeat - \`ws://localhost:3000/ws/sensing\` → WebSocket stream (same port as HTTP) - \`http://localhost:3000/ui/index.html\` → Three.js UI (24 KB)
ruvnet commented 2026-03-01 15:14:07 +08:00 (Migrated from github.com)

the UI is a work on progress. i generally use Claude Code as the UI.

the UI is a work on progress. i generally use Claude Code as the UI.
ruinmi commented 2026-03-01 15:16:02 +08:00 (Migrated from github.com)

great

great
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dearsky/wifi-densepose#55