Browse Source

added wifi timeout

master
Barb 5 months ago
parent
commit
b3fd38ee7e
3 changed files with 21 additions and 6 deletions
  1. +7
    -0
      README.md
  2. +14
    -6
      Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino
  3. BIN
      Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino.d1_mini.bin

+ 7
- 0
README.md View File

@ -0,0 +1,7 @@
A simple esp fan controller I created for an HP DL380p G8, it replaces the PWM signals from the motherboard
WARNING! ESP8266 may need a pull-up resistor on the pin used for PWM output depending on the model. Upgrading the heatsink on the RAID controller is advised as it tends to be the hottest running component (also stock heatsink is laughable).
How does it work? Fans are usually controlled by 6 individual PWM signals, in order to take control of them, we can cut all the connectors and jump tach to ground (yellow and black cables in my case), this is necessary to avoid fan errors from iLO. The 3 remaining connectors should be +12V, GND and PWM (blue in the 380p G8). I connected all fans and PWM wires in parallel and then hooked the signal up to pin 2 (D4) on my wemos d1 mini. Power for the fans can be taken from the 12V connector on the HDD backplane, directly from the motherboard, or any other high-current capable 12V power plane.
Default speed is 20% and is computed as (100-20)*255, as control logic is reversed for these fans (this way they "fail" fully on when no signal is present! very clever).
Lastly, the system can automatically update fan speed if the ESP is connected to the motherboard via USB: simply sending "S025" will set the fans at 25%, "S050" at 50%... and so on! One must write a script that checks for temperatures and sends these commands out over serial.

+ 14
- 6
Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino View File

@ -22,6 +22,7 @@ const char* PARAM_INPUT_1 = "input1";
const char* ssid = "LILiK_WiFi"; //replace with your SSID
const char* password = "pippopippo"; //password
String hostname = "Ventole_Einstein";
int ConnTimeOut = 120; // sec/2 to wait for wifi connection before timing out
// Default Fan Speed
int fanSpeedPercent = 20;
@ -65,15 +66,21 @@ void setup(void) {
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
while (WiFi.status() != WL_CONNECTED && ConnTimeOut > 1) {
delay(500);
Serial.print(".");
ConnTimeOut--;
}
if (WiFi.status() == WL_CONNECTED) {
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
else {
Serial.println("Connection Failed!");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
// Send web page with input fields to client
server.on("/", HTTP_GET, [](AsyncWebServerRequest * request) {
@ -110,6 +117,7 @@ server.on("/get", HTTP_GET, [] (AsyncWebServerRequest *request) {
// the loop function runs over and over again forever
void loop() {
// serial input from server will take priority over manual value and overwrite it
// Check if a serial interface is running
if(Serial.available()){
// Check the first character: if it is "S" it will be followed by 3 digits for the fan speed


BIN
Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino.d1_mini.bin View File


Loading…
Cancel
Save