https://github.com/lnb51/spark
Turn on your PC via Telegram bot and ESP32
https://github.com/lnb51/spark
esp32 esp32-c3 remote-power rust-lang telegram-bot
Last synced: 3 months ago
JSON representation
Turn on your PC via Telegram bot and ESP32
- Host: GitHub
- URL: https://github.com/lnb51/spark
- Owner: lnB51
- License: mit
- Created: 2024-08-16T21:53:16.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-08-16T23:18:37.000Z (11 months ago)
- Last Synced: 2025-02-10T03:32:06.860Z (5 months ago)
- Topics: esp32, esp32-c3, remote-power, rust-lang, telegram-bot
- Language: Rust
- Homepage:
- Size: 307 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Spark
#### Remote starter for PC


[](https://github.com/lnB51/spark/blob/master/LICENSE)
This project was designed to solve the problem of arranging a remote workplace. If there were no problems with remote control tools, how to run a computer remotely with minimal costs is a difficult question.## What You’ll Need:
- An ESP32-C3 board ⚙️
- Your trusty PC or laptop 🐱💻
- A cup of tea or coffee (your choice!) ☕
- A good mood 😊
## Prerequisites### Install Rust (with `rustup`)
If you don't have `rustup` installed yet, follow the instructions on the [rustup.rs site](https://rustup.rs)
### Install ESP32 toolchain
If you haven't installed the ESP toolchain yet, here's the link to get started: [espressif](https://docs.espressif.com/projects/esp-idf/en/v5.0.2/esp32/get-started/index.html#manual-installation)### Install Cargo Sub-Commands
```sh
cargo install cargo-generate
cargo install ldproxy
cargo install espup
cargo install espflash
```## Let's get started
#### Copy source code
```sh
git clone https://github.com/lnB51/spark
```#### Create a ```cfg.toml``` file in the root directory. You can use ```cfg.toml.example``` as a template — just update it with your own details.
```sh
[spark]
wifi_ssid = "Spark"
wifi_pass = "Remote"
bot_token = "Hello I'm bot token"
bot_owner_id = 12345678
```P.S.: You can find your ```bot_owner_id``` by visiting [Web Telegram](https://web.telegram.org/a/). Just open your "Saved Messages" and check the webpage URL for the ID. To get your ```bot_token```, use [BotFather](https://telegram.me/BotFather) on Telegram.
If you're using VSCode, I recommend installing [Task runner](https://marketplace.visualstudio.com/items?itemName=SanaAjani.taskrunnercode). I've already set up a ```task.json``` file for you, so you can easily ```build, flash, and monitor``` with just one click!
Just a heads up—log monitoring from the board is only available in debug mode.
If you're not using VSCode, here are the commands you'll need:
#### Build (Debug)
```sh
cargo build
```#### Build (Release)
```sh
cargo build --release
```#### Flash
```sh
espflash flash target/riscv32imc-esp-espidf/debug/spark --list-all-ports
```#### Monitor
```sh
espflash monitor
```## Next steps
After you have uploaded the firmware to the board, you will need to solder the following [Circuit](https://github.com/lnB51/spark/blob/master/images/soldering_scheme.png)
To learn more you can use pinout diagram [Pinout](https://github.com/lnB51/spark/blob/master/images/pinout_scheme.jpg)
## Result
Everything is ready, now you can check your work by sending the following commands to the bot 🤖:
```/poweron``` - Turn on the computer
```/poweroff``` - Turn off the computer in normal mode
```/reboot``` - Force reboot the computer (use only if the computer is frozen or you cannot turn it off in the usual way)
## Modify the Code for Other Platforms
If you want to use a different board, check out the instructions here:
* [Rust on ESP-IDF](https://github.com/esp-rs/esp-idf-template/blob/master/README.md)