Docker containers for the controller, running redfish and prometheus exporter
Find a file
2026-02-09 16:34:09 +00:00
app first commit 2026-02-09 16:34:09 +00:00
exporter first commit 2026-02-09 16:34:09 +00:00
rdc first commit 2026-02-09 16:34:09 +00:00
.env first commit 2026-02-09 16:34:09 +00:00
.env.example first commit 2026-02-09 16:34:09 +00:00
docker-compose.yml first commit 2026-02-09 16:34:09 +00:00
Dockerfile first commit 2026-02-09 16:34:09 +00:00
README.md first commit 2026-02-09 16:34:09 +00:00
requirements.txt first commit 2026-02-09 16:34:09 +00:00

Redfish API for Rear Door Cooler

A Redfish-compliant REST API for monitoring and controlling a rear door cooler system running on a WAGO controller.

Overview

This service provides a full Redfish service implementation that exposes:

  • Chassis resources with thermal and power management
  • Thermal resources with temperature sensors and fan monitoring
  • Power resources with power supply status
  • Actions for fan control, valve control, and system reset

The API reads sensor data from files in /tmp/rdc on the WAGO controller and provides write operations for control commands.

Features

  • Full Redfish 1.20+ compliant API
  • Basic HTTP authentication
  • Read/write operations for sensor data and control commands
  • Docker containerization for easy deployment
  • Support for:
    • 6 air-on temperature sensors
    • 6 air-off temperature sensors
    • 2 water temperature sensors (in/out)
    • 2 cabinet temperature sensors
    • 6 fans with RPM, voltage, current, and power monitoring
    • 2 power supplies
    • Pressure and valve feedback
    • Leak detection

Quick Start

Using Docker Compose

  1. Create a .env file from .env.example:

    cp .env.example .env
    
  2. Edit .env and set your credentials:

    REDFISH_USERNAME=admin
    REDFISH_PASSWORD=your_secure_password
    
  3. Start the service:

    docker-compose up -d
    
  4. Access the API:

Using Docker

docker build -t redfish-rdc .
docker run -d \
  -p 8000:8000 \
  -v /tmp/rdc:/tmp/rdc:ro \
  -e REDFISH_USERNAME=admin \
  -e REDFISH_PASSWORD=password \
  --name redfish-rdc \
  redfish-rdc

Local Development

  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Set environment variables:

    export REDFISH_USERNAME=admin
    export REDFISH_PASSWORD=password
    export RDC_PATH=/tmp/rdc
    
  3. Run the application:

    uvicorn app.main:app --host 0.0.0.0 --port 8000
    

API Endpoints

Service Root

  • GET /redfish/v1/ - Service root with links to all resources

Chassis

  • GET /redfish/v1/Chassis - Chassis collection
  • GET /redfish/v1/Chassis/RearDoorCooler - Main chassis instance
  • PATCH /redfish/v1/Chassis/RearDoorCooler - Update chassis properties

Thermal

  • GET /redfish/v1/Chassis/RearDoorCooler/Thermal - Thermal resource with temperatures and fans
  • POST /redfish/v1/Chassis/RearDoorCooler/Thermal/Actions/Fan.SetSpeed - Set fan speed
  • POST /redfish/v1/Chassis/RearDoorCooler/Actions/Oem/FanControl - Enable/disable fan

Power

  • GET /redfish/v1/Chassis/RearDoorCooler/Power - Power resource with power supplies

Actions

  • POST /redfish/v1/Chassis/RearDoorCooler/Actions/Chassis.Reset - Reset chassis
  • POST /redfish/v1/Chassis/RearDoorCooler/Actions/Oem/ValveControl - Control valve

Authentication

The API uses Basic HTTP authentication. Include credentials in the Authorization header:

Authorization: Basic <base64(username:password)>

RDC File Structure

The service expects files in /tmp/rdc/ (or path specified by RDC_PATH):

Temperature Sensors

  • TEMP_AIR_ON_0_01_TEMP through TEMP_AIR_ON_0_06_TEMP - Air on temperatures
  • TEMP_AIR_ON_0_01_CONN through TEMP_AIR_ON_0_06_CONN - Air on connection status
  • TEMP_AIR_OFF_0_01_TEMP through TEMP_AIR_OFF_0_06_TEMP - Air off temperatures
  • TEMP_AIR_OFF_0_01_CONN through TEMP_AIR_OFF_0_06_CONN - Air off connection status
  • TEMP_WATER_IN_0_TEMP, TEMP_WATER_OUT_0_TEMP - Water temperatures
  • TEMP_WATER_IN_0_CONN, TEMP_WATER_OUT_0_CONN - Water connection status
  • TEMP_CAB_0_TEMP, TEMP_CAB_1_TEMP - Cabinet temperatures
  • TEMP_CAB_0_CONN, TEMP_CAB_1_CONN - Cabinet connection status

Fans (01-06)

  • FANS_XX_RPM - Fan RPM
  • FANS_XX_V - Fan voltage
  • FANS_XX_I - Fan current
  • FANS_XX_P - Fan power
  • FANS_XX_STATUS - Fan status
  • FANS_XX_ENABLED - Fan enabled (writable)
  • FANS_XX_ONLINE - Fan online status
  • FANS_XX_CMD - Fan command/speed setpoint (writable)
  • FANS_XX_SP - Fan setpoint

Power

  • A_POWER_STATUS - Power supply A status
  • B_POWER_STATUS - Power supply B status

Other

  • PRESSURE_FBK0 - Pressure feedback
  • VALVE_FBK0 - Valve feedback
  • VALVE_RAW - Valve command (writable)
  • LEAK_DETECT - Leak detection status
  • FAN_SPEED_RAW - Raw fan speed

Environment Variables

  • REDFISH_USERNAME - Basic auth username (default: admin)
  • REDFISH_PASSWORD - Basic auth password (default: password)
  • REDFISH_PORT - API port (default: 8000)
  • RDC_PATH - Path to RDC files directory (default: /tmp/rdc)

Development

Project Structure

redfish_docker/
├── app/
│   ├── main.py              # FastAPI application
│   ├── auth.py              # Authentication middleware
│   ├── models/              # Redfish data models
│   ├── routes/              # API route handlers
│   ├── data/                # Data access layer
│   └── utils/               # Utility functions
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md