Turn on USB Power (RPi) when webcam stream starts and turn off after X seconds Or when stream stops


#1

I hope this is the right area to post this, but I have a small LED strip attached to the USB on my RPi that I'd like to run the command

echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind

when the webcam stream starts when accessed via HTTP and run the unbind command either after a some seconds (~30) or when the stream stops (assuming it does after one closes the window or moves to another part of the OctoPrint site). Is this possible?

Thank you in advance.


#2

There's another thread on here where we're discussing something similar.