diff --git a/README.md b/README.md index e69de29..ea6889c 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino b/Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino index 5773cc5..8dbd79c 100644 --- a/Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino +++ b/Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino @@ -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 diff --git a/Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino.d1_mini.bin b/Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino.d1_mini.bin new file mode 100644 index 0000000..783b354 Binary files /dev/null and b/Ventole_Einstein_ESP/Ventole_Einstein_ESP.ino.d1_mini.bin differ