This is a PC sided companion to the ESP Power Button Project. Watch The Video ESP Power Button GitHub
This is a companion app to the ESP Power Button Project. This program runs in background on your PC and does two things:
- Provide System stats to the ESP over serial.
- Receive Button Presses from the ESP over serial and coonvert them to key presses.
You can modify the project to add more system stats to send or receive a wider range of key presses if you wish.
Download the compiled and ready to run binary from the releases page.
Data sent over serial is in the following format:
"SYSSTATS:%d\t%d\t%d\n",cpuPer,memPer,dskPer
If you wish to run to project as is than download the latest "LS_Keyboad_Wedge.exe" from the releases page. See the Usage section on how to run it. OR If you wish to make some changes to the code then follow these steps:
Setup VSCode for compiling with MinGW from the instruction provided here.
- Clone/Download the repo
git clone https://github.com/LiveSparks/WinSerial
- Setting up tasks.json
- Before opening the project in VSCode, go into the .vscode folder and rename
tasks.json
totasks.json.bak
- Open the root folder in vs code and create a new
tasks.json
file by following the instructions here. - Now open the new
tasks.json
file and modify the value of"args":
variable to look like this:
"args": [ "-mwindows", // Comment-out this to see a command prompt when the program is run. "-g", "${workspaceFolder}\\*.cpp", "-o", "${fileDirname}\\LS_Keyboard_Wedge.exe", "-l", "pdh", "-static", "-static-libgcc", "-static-libstdc++" ],
- Before opening the project in VSCode, go into the .vscode folder and rename
- Compiling
You can now compile the program with the keyboard shortcut
Ctrl+Shift+B
.
NOTE: By Default the NO window opens up when you run the program. To kill the program, you have to do so from the Task Manager. If you want a console window to appear comment out the -mwindows
line in your tasks.json
file.
- DO NOT run the file as is.
- Search and open up device manager.
- Expand
Ports(COM & PLT)
. - Plug in the ESP that is running the ESP Power Button Sketch.
- Note down the new COM port that appears.
- Open the folder that contains the LS_Keyboard_Wedge.exe file.
Shift+Right Click
in this folder and click on "Open PowerShell Window here" OR you can type "cmd" in the top address bar to open a command prompt.- Inside the terminal, run the following:
Replace
LS_Keyboard_Wedge.exe COM1
COM1
with whatever COM port you noted down in step 5. - No new window will open up. If no error pops up and it looks like nothing is happening than the program is running successfully in the background.
- To kill the program open up task manager and search for
LS_Keyboard_Wedge.exe
. It might be under a dropdown ofWindows Command Processor
. Select it and click "End Task".
If you want to run the programm automatically on boot-up. Make sure that the ESP is always connected to the same USB Port.
- Right click on the
.exe
file and clickCreate shortcut
. - Right click on the shortcut and open up properties.
- Modify the value in the Target text box to include the COM port of your ESP at the end. Example:
C:\Users\RaviK\Documents\Projects\WinSerial\LS_Keyboard_Wedge.exe COM12
- Click OK to save and cut/copy the shortcut.
- Press
Win+R
and typeshell:startup
. - Paste the shortcut in the window that appears. The Program should now run automatically on every reboot.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License.
Your Name - @LiveSparksYT - livesparking@gmail.com
Project Link: https://github.com/LiveSparks/WinSerial