Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSPS ServerSmartPower

An ESP32-S3 smart control and telemetry project for CSPS server power supplies

MCU Framework Build PMBus License

English | 简体中文

Project Overview

CSPS ServerSmartPower is a DIY smart power distribution and management project for server power supplies. It integrates an ESP32-S3, an OLED display, physical buttons, Wi-Fi, a LittleFS-hosted Web interface, scheduled and conditional tasks, and PMBus/CSPS telemetry into a compact power box.

This project is based on Tomosawa/MYNOVA-SmartPower. It retains the upstream power control, OLED, Wi-Fi, Web, task scheduling, and settings framework while extending the following capabilities:

  • Adaptive telemetry compatibility across different CSPS power ranges
  • Automatic no-load calibration with NVS persistence
  • Low-load detection and input power estimation
  • Startup spike and abnormal telemetry filtering
  • Fast and smooth OLED and Web data updates

Gallery

Controller board and OLED

Controller board, server power supply, and OLED telemetry interface

Completed enclosure at an angle

Completed enclosure at an angle

Completed enclosure side view

Completed enclosure side view

The reference build shown above uses an ESP32-S3, a 128×64 OLED, four DC barrel outputs, and two XT60 outputs. The connector count and mechanical layout may differ between hardware revisions.

Test Video

Watch the power-on, telemetry, load response, and Web control test video

The video is attached to the project Issue. Open the link above to view and play it.

Highlights

Feature Description
Multi-power-range compatibility Designed for server power supplies using the same private CSPS register protocol at address 0x5F
Automatic ratio learning Learns common IIN and IOUT divisors of 32, 64, 128, and 256
Automatic no-load calibration Learns the no-load input power and raw IOUT offset of each power supply
NVS persistence Restores calibration results when the same power supply is used again
Low-load detection Allows confirmed IOUT changes to trigger independently when input telemetry resolution is insufficient
Adaptive startup protection Suppresses false transient power caused by fan startup, capacitor charging, and control-loop settling
Abnormal data filtering Filters single-frame anomalies in input, output, temperature, and fan speed telemetry
Fast and smooth display Follows large changes quickly while smoothing small fluctuations
Multiple control methods Supports physical buttons, the Web interface, scheduled tasks, and conditional tasks

Main Features

Power Control and Interaction

  • Control the power supply through physical buttons or the Web interface
  • Display input and output telemetry, temperature, fan speed, and network information on a 128×64 OLED
  • Use two-button local control with power confirmation pages and automatic screen sleep and wake
  • Support AP and STA Wi-Fi modes
  • Support DNS-assisted access and a LittleFS-hosted Web interface
  • Automatically start the server power supply after AC power is applied
  • Support countdown shutdown
  • Support one-time, daily, weekly, and time-range tasks
  • Support conditional shutdown tasks based on input or output current and power
  • Store settings and tasks in ESP32 NVS

Universal CSPS Telemetry Enhancements

  • Support private CSPS PMBus registers at address 0x5F
  • Use standard PMBus registers as supplementary compatibility channels
  • Learn the real no-load input power instead of assuming a fixed 10 W or 15 W baseline
  • Learn the raw no-load IOUT offset of each power supply
  • Learn common IIN and IOUT divisors automatically
  • Save calibration values and divisors to ESP32 Preferences/NVS
  • Verify restored calibration data in the background
  • Invalidate and relearn clearly mismatched saved baselines
  • Provide PMBus::requestRecalibration() for manual recalibration
  • Allow continuously confirmed IOUT changes to trigger low-load detection independently
  • Temporarily estimate input power from confirmed output telemetry when necessary
  • Use adaptive startup protection to suppress false startup power
  • Filter false output voltage values, input and output spikes, temperature anomalies, and fan speed anomalies
  • Filter intermittent false no-load frames
  • Synchronize power state with the actual PSON pin level

Telemetry and Compatibility

The firmware reads the following private CSPS registers:

Telemetry Register Default scaling
Input voltage 0x08 raw / 32
Input current 0x0A Automatically learned, initial value 64
Input power or auxiliary raw value 0x0C Depends on the power supply implementation
Output voltage 0x0E raw / 256
Output current 0x10 Automatically learned, initial value 64
Temperature 1 0x1A raw / 64
Temperature 2 0x1C raw / 64
Fan speed 0x1E Raw value used as RPM

Compatibility depends mainly on the PMBus address, register mapping, and telemetry behavior. It is not determined by the rated wattage alone. The adaptive telemetry logic targets different power ranges that use the same protocol, but each model and hardware revision still requires real-device testing.

Compatibility Status

  • Verified with this modified project: one 750 W CSPS power supply, including no-load offset handling and low-load display
  • Target range of the adaptive implementation: common server power supplies from 400 W to several kilowatts using the same protocol
  • Models reported as tested by the upstream project: F495E-S0, E750E-S0, F750E-S0, D750E-S2, E1100E-S0, L1100E-S0, D2000E-S2 (EPP), E495E-S1 (EPP), and E750E-S1 (EPP)

The upstream test list is provided only for source attribution and compatibility reference. It does not mean that every listed model has been retested with this derivative firmware.

Low-Load Measurement Limits

The firmware can improve low-load visibility as long as at least one telemetry channel changes.

If the private IIN, private IOUT, standard IOUT, and standard POUT values all remain unchanged under a low load, the software cannot determine that a load has been connected. For stable sub-watt or very low-current measurement, add an INA226, INA238, or a suitable Hall-effect current sensor on the output side.

Calibration

First Use or Power Supply Replacement

  1. Power on the controller and enable the server power supply main output
  2. Disconnect all DC output loads
  3. Keep the output unloaded for approximately 6 to 10 seconds
  4. Wait for no-load calibration to finish and be written to NVS
  5. Connect the load only after the no-load baseline is ready

Use the following status fields to confirm calibration:

CSPS_IDLE_READY = true
CSPS_CAL_SAVE_OK = true
CSPS_CAL_SOURCE = LIVE   # Learned during the current session
CSPS_CAL_SOURCE = NVS    # Restored from NVS on later startups

Replacing the Power Supply

If the new stable no-load input is significantly lower than the saved baseline, the firmware can determine that the previous calibration is mismatched and clear the old record automatically.

A significantly higher input may indicate either a different power supply with higher no-load consumption or a real permanent load. The firmware therefore marks it as a suspected mismatch instead of clearing the calibration automatically.

To force recalibration from a button or Web handler:

// Disconnect all DC loads before calling this function
bool accepted = psu.requestRecalibration();

After calling the function, keep the output unloaded until CSPS_IDLE_READY becomes true again. This interface clears only the CSPS calibration namespace. It does not remove Wi-Fi settings, task settings, or LittleFS Web files.

Hardware

PCB Manufacturing and Prototyping

PCB manufacturing files are available in the project Hardware folder. Download the appropriate files and upload them to JLC for PCB manufacturing and prototyping.

Before ordering, verify the layer count, board thickness, copper weight, surface finish, solder mask color, quantity, and other parameters for the selected hardware revision. PCB files from different revisions may not be interchangeable. Check the file contents and connector definitions before production.

Default Controller Target

  • ESP32-S3 DevKit-compatible board or module
  • Current PlatformIO default configuration: ESP32-S3 with 16 MB Flash and 8 MB PSRAM (N16R8)
  • 128×64 I²C OLED driven by U8g2
  • Server power supply using the supported 0x5F CSPS PMBus mapping
  • PSON control interface and output distribution hardware rated for the required current

Firmware Pin Definitions

Function ESP32-S3 GPIO
Left button 4
Right button 5
PSU PSON 6
PSU PSKILL 7
Kill or protection input 45
PMBus SCL 48
PMBus SDA 47
AC_OK 10

Verify all pin definitions against the actual PCB revision before applying power.

Default Network Settings

Setting Default value
AP name CSPS_POWER
AP password 88888888
AP address 10.0.10.1
DNS redirect domain csps.com
STA mode Enabled by default with no initial credentials

After connecting to the device access point, open http://10.0.10.1 or http://csps.com.

After connecting the device to a router, use the local IP shown on the OLED. Change the default AP password before connecting the device to an untrusted network.

Build and Flashing

Requirements

  • Visual Studio Code with PlatformIO, or PlatformIO Core
  • The esp32s3 environment defined in platformio.ini
  • A partition file matching the Flash configuration in the project root, such as CSPS_16MB.csv
  • Built Web files placed in the PlatformIO data/ directory when using the Web interface

PlatformIO installs the following dependencies automatically:

  • ArduinoJson ^7.4.3
  • AsyncTCP ^1.1.1
  • ESPAsyncWebServer
  • ESP32TimerInterrupt ^2.3.0
  • U8g2 ^2.35.30

Common Commands

# Build the firmware
pio run -e esp32s3

# Upload the firmware
pio run -e esp32s3 -t upload

# Upload LittleFS Web files
pio run -e esp32s3 -t uploadfs

# Open the serial monitor
pio device monitor -b 115200

Clean, rebuild, and upload:

pio run -e esp32s3 -t clean
pio run -e esp32s3 -t upload

Web API Overview

The current firmware provides the following main interfaces:

Function Endpoint or description
PSU telemetry and settings /api/psuinfo, /api/psusetting
PSU power and fan commands /api/psupower, /api/psufan
Wi-Fi AP/STA scanning, saving, enabling, disabling, clearing, and connecting
Automatic startup Start the server power supply after AC power is applied
Scheduled tasks Countdown, time-range, one-time, and recurring tasks
Conditional tasks Execute according to input or output current and power
Time synchronization Network time synchronization

The firmware already provides PMBus::requestRecalibration(). A dedicated Web route and button can be added to expose manual recalibration in the browser.

Debugging and Diagnostics

The production Web-control build disables frequent serial output by default:

#define PSU_JSON_DEBUG 0
#define PSU_SCAN_OK_DEBUG 0

To debug telemetry, enable JSON output in MYNOVA_POWER.cpp:

#define PSU_JSON_DEBUG 1
#define PSU_JSON_CHANGE_ONLY 1

Change-only mode prints when quantized display values change and applies a minimum output interval.

Field Meaning
CSPS_INPUT_SOURCE Current input telemetry source
CSPS_OUTPUT_SOURCE Current output telemetry source
CSPS_IIN_DIVISOR Automatically learned input current divisor
CSPS_IOUT_DIVISOR Automatically learned output current divisor
CSPS_LOW_LOAD_IOUT_ACTIVE Confirmed low-load IOUT channel is active
CSPS_INPUT_ESTIMATED Input is currently estimated from output telemetry
CSPS_STARTUP_GUARD Adaptive startup protection is active
CSPS_OUTPUT_SURGE_HOLD An output surge is being blocked or confirmed
CSPS_CAL_MISMATCH_SUSPECTED The saved baseline may belong to another power supply
CSPS_CAL_AUTO_INVALIDATED Saved calibration has been invalidated automatically

Project Structure

Recommended repository structure:

CSPS-Server-SmartPower/
├─ src/                    # ESP32-S3 firmware source
├─ data/                   # Web build files uploaded to LittleFS
├─ images/                 # README images
├─ Hardware/               # PCB manufacturing files and hardware design resources
├─ platformio.ini
├─ CSPS_16MB.csv           # Partition table used by the default N16R8 build
├─ README.md
├─ README_zh-CN.md
└─ LICENSE

Main firmware modules:

Module Function
pmbus.cpp/.h CSPS/PMBus acquisition, calibration, ratio learning, filtering, and diagnostics
WebService.cpp/.h LittleFS Web service and interfaces
GUIRender.cpp/.h OLED graphical interface
WIFINetwork.cpp/.h AP/STA network functions
TaskManager.cpp/.h Countdown, scheduled, and conditional tasks
Settings.cpp/.h NVS persistence for settings and tasks
ButtonHandle.cpp, EventHandle.cpp Physical buttons and asynchronous event handling

Safety Warning

Server power supplies can deliver extremely high current. A 1200 W power supply can provide approximately 100 A at 12 V and may deliver even higher transient current.

  • AC input and the inside of the power supply contain hazardous mains voltage
  • Do not open or modify the server power supply while it is energized
  • Use wires, connectors, PCB copper, terminals, fuses, and insulation rated for the required current
  • Protect each output branch with a fuse appropriate for that branch's wires and connectors
  • Do not assume that the enclosure, PCB, DC barrel connectors, or XT60 connectors can carry the full rated current of the power supply
  • Confirm polarity before connecting a device
  • Maintain adequate cooling and keep temperature monitoring operational
  • This DIY project has no safety certification and is used at the builder's own risk

Source and License

This project is based on Tomosawa's MYNOVA-SmartPower. When distributing modified firmware or hardware files, retain the upstream copyright notice, source attribution, and license requirements.

Thanks to the upstream project and its dependencies, including MultiButton, ArduinoJson, U8g2, AsyncTCP, ESPAsyncWebServer, and ESP32TimerInterrupt.

This derivative project is intended to remain compatible with the upstream GPL-3.0 license. The repository should include the complete LICENSE file. Hardware design files may contain additional notices, so retain the copyright and license information included with each source file.

Contributions and Compatibility Reports

Issues, real-device logs, power supply model reports, and pull requests are welcome.

When submitting compatibility test results, include:

  • Power supply manufacturer, model, and rated wattage
  • No-load READ_PIN, raw IIN, and raw IOUT
  • Readings under one or more known loads
  • Learned IIN and IOUT divisors
  • Whether low-load mode or input estimation is active
  • Relevant JSON diagnostic information
  • Firmware commit or version

About

ESP32-S3 based smart controller for CSPS server power supplies with PMBus telemetry, OLED display, Web control, adaptive calibration and low-load detection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages