Skip to content
yudjinnPublic

About

Realtime IoT streaming engine for retrofitting analog factory machines for monitoring and OEE metrics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heimdall

A real-time IoT streaming engine for retrofitting analog factory machines with digital monitoring. Ingests telemetry from non-invasive sensors (optical tower lights, CT clamps), tracks machine state in-memory, computes rolling OEE metrics, and broadcasts live updates to dashboards via WebSocket.

Architecture

Sensors ──TCP──> Ingestion ──chan──> Hub ──chan──> Client ──WebSocket──> Dashboard
                (listener)       (actor)      (writePump)
  • Ingestion layer accepts raw TCP connections and decodes newline-delimited JSON telemetry
  • Hub runs as a single goroutine owning all state — no mutexes, channel-only communication
  • Client pairs (readPump/writePump) manage WebSocket connections with backpressure eviction
  • OEE (Availability x Performance x Quality) is computed on the hot path, never from database queries
  • Write-ahead buffer handles sensor reconnection — backlogged telemetry replays into state without flooding dashboards

Project Structure

cmd/server/        Server entry point (TCP + HTTP listeners)
cmd/simulator/     Mock sensor fleet with Markov state transitions
internal/model/    Shared domain types (TelemetryPacket, MachineState, OEE)
internal/ingestion/  TCP listener and JSON decoder
internal/engine/   Hub, Client, state machine, OEE calculation
internal/dashboard/  HTTP server and WebSocket upgrade
static/            Dashboard HTML/JS

Requirements

  • Go 1.22+

Usage

Build both binaries:

go build ./cmd/server
go build ./cmd/simulator

Start the server:

./server
# or with custom addresses:
./server -tcp :9000 -http :8080

Start the simulator:

./simulator
# or with options:
./simulator -sensors 50 -addr localhost:9000 -interval 1s

Open the dashboard at http://localhost:8080, select a factory, and click Connect.

Server flags

Flag Default Description
-tcp :9000 Telemetry TCP listen address
-http :8080 Dashboard HTTP listen address

Simulator flags

Flag Default Description
-addr localhost:9000 Server address to connect to
-sensors 50 Number of simulated sensors
-interval 1s Send interval per sensor

About

Realtime IoT streaming engine for retrofitting analog factory machines for monitoring and OEE metrics.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages