Skip to content

keremy321/SmartFactoryDeviceMonitor

Repository files navigation

SmartFactoryDeviceMonitor

A WPF application targeting .NET Framework 4.7.2 for monitoring smart factory devices. It aggregates telemetry, exposes data via OPC UA and REST, publishes MQTT messages, and tracks device heartbeats.

Features

  • Device management and in-memory device store
  • OPC UA server with custom node manager (SmartFactoryNodeManager) exposing device data
  • OPC UA client window for browsing/reading values
  • REST API with snapshot and Server-Sent Events streaming (RestStreamingService)
  • MQTT telemetry publishing (MqttTelemetryService)
  • UDP heartbeat listener/sender (HeartbeatService) for online status checks
  • Basic login/session model (LoginWindow, AppSession, User, UserRole)
  • Simple logging and alert models

Run

  • Start the WPF app. The OPC UA server and REST streaming service can be started from the main window or initialized via corresponding services.
  • REST API default base prefix: http://localhost:5005/

Login

  • admin / admin123 — Administrator role
  • operator / operator123 — Operator role

REST API

  • GET /api/devices — JSON snapshot of current devices
  • GET /api/devices/stream — text/event-stream (SSE) that emits device JSON every second

OPC UA

  • Namespace URI: urn:SmartFactoryDeviceMonitor
  • Address Space:
    • Objects/Devices/Device_{Id} with variables: Name, Status, Temperature, Voltage
  • Server setup in Services/Opc/SmartFactoryOpcServer.cs
  • Node manager in Services/Opc/SmartFactoryNodeManager.cs

Heartbeat

  • UDP listener on port 50000 (HeartbeatService)
  • Heartbeat message format: HB|{deviceId}
  • IsDeviceOnline(deviceId, timeout) checks last heartbeat timestamp

MQTT

  • Publishes telemetry from devices (MqttTelemetryService). Configure broker settings in the service as needed.

Project Structure

  • Models/Device, DeviceStatus, Alert, User, UserRole
  • Services/DeviceService, LoggingService, HeartbeatService, RestStreamingService, OpcUaService, OpcUaClientService, Opc/SmartFactoryOpcServer, Opc/SmartFactoryNodeManager, MqttTelemetryService
  • Persistence/MainDatabase.cs — placeholder for data persistence
  • UI: MainWindow, LoginWindow, OpcUaClientWindow, DeviceChartWindow

About

A WPF application targeting .NET Framework 4.7.2 for monitoring smart factory devices. It aggregates telemetry, exposes data via OPC UA and REST, publishes MQTT messages, and tracks device heartbeats.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages