I am working on a solar Pi timelapse rig and need to save power between shots. Killing power to the USB ports will cut my power consumption by almost 1 watt. I am able to successfully kill power with the following commands in bash:
echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind
echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind
I am new to Python and would like for this script to be run in my Python script that is controlling the camera. I thought I would use the subprocess command but I am not having any luck.
subprocess.call(['echo','1-1|sudo tee /sys/bus/usb/drivers/usb/unbind'],shell=True)