https://github.com/nopnop2002/esp-idf-usb-switch
Turning USB ON/OFF using ESP-IDF
https://github.com/nopnop2002/esp-idf-usb-switch
esp-idf esp32 usb-devices
Last synced: 4 months ago
JSON representation
Turning USB ON/OFF using ESP-IDF
- Host: GitHub
- URL: https://github.com/nopnop2002/esp-idf-usb-switch
- Owner: nopnop2002
- License: mit
- Created: 2025-02-09T06:16:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-03T23:17:54.000Z (7 months ago)
- Last Synced: 2025-12-07T05:19:23.325Z (7 months ago)
- Topics: esp-idf, esp32, usb-devices
- Language: C
- Homepage:
- Size: 66.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esp-idf-usb-switch
Turning USB ON/OFF using ESP-IDF.
We can obtain products that turn USB on/off with a remote control about $4.
Both of these use a frequency of 433MHz radio signal.
Using these, you can turn on/off the USB device from the ESP32.
__The product on the right has only one button, so ON/OFF may not work as expected.__

# Software requirements
ESP-IDF V5.0 or later.
ESP-IDF V4.4 release branch reached EOL in July 2024.
# Hardware requirements
This project supports these wireless transceivers.
- Wireless transmitter
H34A-315/H34A-433
SYN115
STX882
- Wireless receiver
H3V3/H3V4
SYN480R
LR43B/LR33B
SRX882/SRX887
- Wireless RF Remote Control Switch
I used these transceivers.
From left: H3V4F, H34A, SYN480, SYN115


# How to use
First, do teaching.
The teaching results are stored in NVS.
Turn the USB ON/OFF using the teaching results.
# Teaching
```
git clone https://github.com/nopnop2002/esp-idf-usb-switch
cd esp-idf-usb-switch/teaching
idf.py menuconfig
idf.py flash
```
## Configuration


## Wirering
|Receiver Module||ESP32|
|:-:|:-:|:-:|
|DATA|--|GPIO4|
|GND|--|GND|
|VCC|--|3.3V|
## Typical circuit

## Start teaching
At this timing, press the ON button on the remote control.

At this timing, press the OFF button on the remote control.

# Re-teaching
Run this project again.
Previous information will be overwritten.
# ON/OFF by timer
Read [this](https://github.com/nopnop2002/esp-idf-usb-switch/tree/main/timer).
# ON/OFF by cron
Read [this](https://github.com/nopnop2002/esp-idf-usb-switch/tree/main/cron).
# ON/OFF by http/mqtt
Read [this](https://github.com/nopnop2002/esp-idf-usb-switch/tree/main/network).