Remote on for Raspberry Pi

This project is about to add a remote power on "switch" to a Raspberry Pi.
To switch the Pi on I use the connector "Run" on the board. If the two connections are shorted the Raspberry will power up. The plan is to use a BC547 transistor to short the pins. A ESP01 Wifi uC will control the transistor, make it conduct when a certain Mqtt-message has arrived.

The first step is to connect the ESP01 to a computer and program it with the "Arduino OTA/BasicOTA" sketch from Examples. This makes it possible to program the Esp via Wifi. The only change in the code for now is the ssid in line 6 that I set to the name of my Wifi.
I also temporarily connect a switch between Gnd and Gpio0 and a small wire between Ch_pd and Vcc and use a USB-ESP01-adapter (see here) to connect to the computer.
The switch is pressed and the device is connected to the computer, then I release the switch and upload the sketch from the Arduno IDE. Then the device is disconnected and connected again. After a short while there will be a new network port in Arduino IDE:s Port menu. This is then used for further programming.