139 lines
3.4 KiB
Markdown
139 lines
3.4 KiB
Markdown
# IPMI Fan Controller v2
|
|
|
|
A simpler, more robust fan controller for Dell T710 and compatible servers using IPMI.
|
|
|
|
## What's Different from v1?
|
|
|
|
- **Direct host execution** - No Docker networking complications
|
|
- **Better error recovery** - Automatically reconnects on IPMI failures
|
|
- **Simpler codebase** - Easier to debug and modify
|
|
- **Working web UI** - Clean, responsive dashboard
|
|
- **CLI testing mode** - Test without starting the web server
|
|
|
|
## Quick Start
|
|
|
|
### 1. Install
|
|
|
|
```bash
|
|
cd ~/projects/fan-controller-v2
|
|
chmod +x install.sh
|
|
sudo ./install.sh
|
|
```
|
|
|
|
This will:
|
|
- Install Python dependencies
|
|
- Create systemd service
|
|
- Set up config in `/etc/ipmi-fan-controller/`
|
|
|
|
### 2. Configure
|
|
|
|
Edit the configuration file:
|
|
|
|
```bash
|
|
sudo nano /etc/ipmi-fan-controller/config.json
|
|
```
|
|
|
|
Set your IPMI credentials:
|
|
```json
|
|
{
|
|
"host": "192.168.1.100",
|
|
"username": "root",
|
|
"password": "your-password",
|
|
"port": 623
|
|
}
|
|
```
|
|
|
|
### 3. Start
|
|
|
|
```bash
|
|
sudo systemctl start ipmi-fan-controller
|
|
```
|
|
|
|
Open the web UI at `http://your-server:8000`
|
|
|
|
## CLI Testing
|
|
|
|
Test the IPMI connection without the web server:
|
|
|
|
```bash
|
|
python3 fan_controller.py 192.168.1.100 root password
|
|
```
|
|
|
|
This will:
|
|
1. Test the connection
|
|
2. Show temperatures and fan speeds
|
|
3. Try manual fan control (30% → 50% → auto)
|
|
|
|
## Features
|
|
|
|
### Automatic Control
|
|
- Adjusts fan speed based on CPU temperature
|
|
- Configurable fan curve (temp → speed mapping)
|
|
- Panic mode: sets fans to 100% if temp exceeds threshold
|
|
|
|
### Manual Control
|
|
- Set any fan speed from 0-100%
|
|
- Override automatic control temporarily
|
|
|
|
### Safety Features
|
|
- Returns to automatic control on shutdown
|
|
- Reconnects automatically if IPMI connection drops
|
|
- Panic temperature protection
|
|
|
|
## Configuration Options
|
|
|
|
```json
|
|
{
|
|
"host": "192.168.1.100", // IPMI IP address
|
|
"username": "root", // IPMI username
|
|
"password": "secret", // IPMI password
|
|
"port": 623, // IPMI port (default: 623)
|
|
"enabled": false, // Start automatic control on boot
|
|
"interval": 10, // Check interval in seconds
|
|
"min_speed": 10, // Minimum fan speed (%)
|
|
"max_speed": 100, // Maximum fan speed (%)
|
|
"panic_temp": 85, // Panic mode trigger (°C)
|
|
"panic_speed": 100, // Panic mode fan speed (%)
|
|
"fan_curve": [ // Temp (°C) → Speed (%) mapping
|
|
{"temp": 30, "speed": 15},
|
|
{"temp": 40, "speed": 25},
|
|
{"temp": 50, "speed": 40},
|
|
{"temp": 60, "speed": 60},
|
|
{"temp": 70, "speed": 80},
|
|
{"temp": 80, "speed": 100}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Connection Failed
|
|
1. Verify IPMI is enabled in BIOS/iDRAC
|
|
2. Test manually: `ipmitool -I lanplus -H <ip> -U <user> -P <pass> mc info`
|
|
3. Check firewall allows port 623
|
|
|
|
### Fans Not Responding
|
|
1. Some Dell servers need 3rd party PCIe response disabled
|
|
2. Try enabling manual mode first via web UI
|
|
3. Check IPMI user has admin privileges
|
|
|
|
### Service Won't Start
|
|
```bash
|
|
# Check logs
|
|
sudo journalctl -u ipmi-fan-controller -f
|
|
|
|
# Check config is valid JSON
|
|
sudo python3 -c "import json; json.load(open('/etc/ipmi-fan-controller/config.json'))"
|
|
```
|
|
|
|
## Files
|
|
|
|
- `fan_controller.py` - Core IPMI control logic
|
|
- `web_server.py` - FastAPI web interface
|
|
- `install.sh` - Installation script
|
|
- `requirements.txt` - Python dependencies
|
|
|
|
## License
|
|
|
|
MIT License - Feel free to modify and distribute.
|