I want to use USB-OTG on my Raspberry Pi 4, but I want to have a possibility to cut the power off and thus force reboot of the device.
Currently my RPi is powered via Power pins in 40 pin GPIO headers. I use USB-C in OTG mode to simulate external drive and/or external keyboard and mouse (depending on the test I perform).
My problem is that even when I cut the power from GPIO pins - the power provided from another device via USB-C is enough to keep my RPi from turning off.
To solve that I have a couple of ideas in mind:
- Using USB-C as power (again) and using OTG via GPIO pins. Unfortunately I couldn't find any information on how to connect GPIO pins to use them as OTG (maybe it is not possible).
- Separating each line in USB-C cable used for OTG and connecting V+/VBUS/Vcc through a relay that I could use to cut the power off. I'm worried that the breakout board I have for splitting USB-C might not be enough due to missing Tx and Rx pins - I use Adafruit 4090.
Do you think any of above solutions might work? What would be the best case?