Sandstar Web Socket
Real-Time Browser-to-Device Communication
Connect your browser directly to building controllers -- no plugins, no Java applets, no middleware headaches.
Sandstar Web Socket brings real-time, bidirectional communication between web applications and Sedona-based building automation controllers. Open a browser tab, connect to a device, and start reading sensor values, writing setpoints, and monitoring changes -- all in real time.
Built as a native SkySpark extension, it drops right into your existing infrastructure. No extra servers to maintain, no separate processes to babysit. Just install the pod and your web apps can talk to Sedona devices instantly.
Why It Exists
Traditionally, connecting a web browser to a Sedona controller required a separate Kotlin/Java microservice acting as a translator. That meant managing another process, dealing with Java FFI quirks, and debugging across two runtime environments. Sandstar Web Socket eliminates all of that with a single, native Fantom implementation that runs inside SkySpark itself.
Who It's For
- Building automation integrators who need web-based tools for Sedona devices
- SkySpark developers building custom web interfaces for device interaction
- System administrators who want fewer moving parts in their automation stack
Connection Dashboard
Every device, one glance
See every connected controller, active browser session, and message flowing through the system -- live. The status endpoint gives you instant diagnostics without touching a log file.
Connection counts, per-device session states, DASP socket health, and watch manager statistics are all available at /live/soxstatus. Integrate it into your monitoring stack or check it from a browser.
Real-Time Data Flow
Browser to device in one hop
Your browser opens a WebSocket to port 7070. The server translates JSON messages into SOX protocol commands and sends them over DASP/UDP to the Sedona controller. Responses flow back the same path -- no polling, no delays.
Multiple browser tabs share the same device session automatically. The message router handles 17 SOX command types -- reads, writes, subscriptions, file transfers, component management, and more -- all through a single WebSocket connection.
Session Management
Smart pooling, zero connection errors
Sedona controllers support a maximum of 2 concurrent connections. Instead of fighting that limit, the session pool shares a single connection per device across all browser clients. Open five tabs to the same controller -- they all share one session.
If a connection drops, auto-recovery kicks in with exponential backoff. Idle sessions are cleaned up after 5 minutes, and a 30-second linger timeout prevents connection thrashing from rapid connect/disconnect cycles. Your users never see connection errors.
Live Value Monitoring
Watch values change in real time
Subscribe to any component on a Sedona controller and see its values update live. The watch system groups subscriptions by browser tab, so each page gets exactly the data it needs -- and cleans up automatically when you close the tab.
Events are batched for efficiency and delivered through the same WebSocket connection. Background cleanup runs every 10 seconds to catch stale watches from disconnected clients. If a tab stops pinging for 30 seconds, its subscriptions are automatically unsubscribed from the device.
Multiple watches can overlap on the same component -- the system tracks reference counts and only unsubscribes from the device when the last watcher leaves. No duplicate subscriptions, no orphaned watches.
File Transfer
Upload firmware, download configs
Transfer application files (SAX, SAB) to and from Sedona controllers with chunked, resumable transfers. The three-phase protocol -- open, chunk, close -- gives you progress tracking and error recovery built in.
Per-device file locks prevent concurrent transfers from corrupting data. Each transfer gets a unique ID, and abandoned transfers are automatically cleaned up after 5 minutes of inactivity. Upload a new application, download a backup, or rename files on the device -- all through the same API.
Tech Stack
Architecture
Capabilities
- WebSocket Server on configurable port (default 7070) with concurrent browser connections
- Full SOX Protocol implementation over DASP/UDP
- Session Pooling -- max 2 sessions per Sedona device (hardware limit), shared across clients
- Chunked File Transfer with progress tracking for SAX/SAB uploads
- Watch/Subscription system with batched event delivery for live value monitoring
- Component Cache for fast reads without hitting the device on every request
- SkySpark Service with Axon function library for status and diagnostics
Requirements
- SkySpark 3.0+ with Fantom runtime
- Sedona-compatible controllers on the network
- bassgCommon 3.0+ shared library
Interested in this project?
Explore the source code, contribute, or get in touch.