Author Topic: Start your PC with your phone!  (Read 992 times)

0 Members and 1 Guest are viewing this topic.

Offline MathCaTopic starter

  • Contributor
  • Posts: 48
  • Country: ca
  • Слава Україні!
Start your PC with your phone!
« on: March 07, 2023, 10:36:04 pm »
You'll need a simple ESP32 or ESP8266, at least 2 jumper wires and a USB cable for the ESP.

1. Find the power switch connectors on your motherboard. If you need to find the manual of your motherboard, you need to know the model! On Windows, Win+R, msinfo32, and look at the value of BaseBord Product.
* Find the Power Switch.jpg (822.37 kB. 2115x1741 - viewed 40 times.)" alt="" class="bbc_img" />

2. Use jumper wires to make your cables. If you want to continue to be able to use the Power switch on your PC, you have to do a split cable (Y) to receive the signal from the button and from your ESP. You should be able to use both...

3. You can use my very simple code

Code: [Select]
#include <WiFi.h>
#define pinBtn 13

const char* ssid     = "WIFI_NETWORK";
const char* password = "WIFI_PASSWORD";

WiFiServer server(80);

void setup()
{
  Serial.begin(115200);
 
  pinMode(pinBtn, INPUT_PULLUP);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }

  Serial.println(WiFi.localIP());

  server.begin();
}

void loop() {
 
  WiFiClient client = server.available();

  if (client) {
    String currentLine = "";
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (c == '\n') {         
          if (currentLine.length() == 0) {           
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();
            client.print("<html><body>Ukrainians are the best</body></html>");
            client.println();
            break;
          } else {
            currentLine = "";
          }
        } else if (c != '\r') {
          currentLine += c;
        }
        if (currentLine.endsWith("GET /PowerOn")) {
          powerOn();
        }
      }
    }
    client.stop();
  }
}

void powerOn() {
  pinMode(pinBtn, OUTPUT);
  digitalWrite(pinBtn, LOW);
  delay (100);
  pinMode(pinBtn, INPUT_PULLUP);
}

4. Get the IP of your ESP in the Serial Monitor or with your router. You can make it static if you want to be sure it will always be the same.

5. Create your Android app, you can use this free website: http://ai2.appinventor.mit.edu. Then import the file in the Zip, click on Blocks in the top right corner, change http://10.0.0.61/H for http://IP_OF_ESP/PowerOn. And then click on Build, Android App (.apk), download, install and test it!

6. Install the ESP in your case, pass a USB cable where you can and connect it to an always on port and you're done.

Super simple and fast.
Все буде Україна!
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 6257
  • Country: de
Re: Start your PC with your phone!
« Reply #1 on: March 07, 2023, 10:58:30 pm »
Seems to be a solution looking for a problem...
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1625
  • Country: ua
Re: Start your PC with your phone!
« Reply #2 on: March 07, 2023, 11:06:19 pm »
 
The following users thanked this post: MathCa

Offline pardo-bsso

  • Regular Contributor
  • *
  • Posts: 220
  • Country: ar
Re: Start your PC with your phone!
« Reply #3 on: March 08, 2023, 03:54:57 pm »
Seems to be a solution looking for a problem...

I configured the BIOS to start when the AC power comes and then a dumb sonoff clone with tasmota does the rest.
 

Offline MathCaTopic starter

  • Contributor
  • Posts: 48
  • Country: ca
  • Слава Україні!
Re: Start your PC with your phone!
« Reply #4 on: March 08, 2023, 04:27:55 pm »
Seems to be a solution looking for a problem...

Lol it's the basic idea to make a first prototype. Then you should add an optocoupler, a small case for the ESP, get power from the ATX 24 pins cable (purple wire = +5v always on), etc. 😉

But you have to be able to open your pc else yes you could create a lot of problems 😅
« Last Edit: March 08, 2023, 04:44:41 pm by MathCa »
Все буде Україна!
 

Offline MathCaTopic starter

  • Contributor
  • Posts: 48
  • Country: ca
  • Слава Україні!
Re: Start your PC with your phone!
« Reply #5 on: March 08, 2023, 04:43:54 pm »
https://en.wikipedia.org/wiki/Wake-on-LAN

It's definitely a better solution for most! It's also possible by Wi-Fi for those with laptops!

I'm also using the ESP to communicate with a process running in background to do more things like put the computer on sleep when nothing important is running, close the screen, mute the sound, it can also display on the app the state of the PC, lock it when I'm away (disconnected from Wi-Fi), etc. I also love to play with small radar sensors, and it's easy to make them work wirelessly together.

It's 99% for fun 😉 We don't need something similar hopefully.
« Last Edit: March 08, 2023, 07:58:24 pm by MathCa »
Все буде Україна!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf