Read the documentation. I believe that I have exposed the API to allow you to toggle that ON/OFF programmatically. If you're good at this sort of stuff, you might be able to drop in a custom button on the Control tab; otherwise, just visit the Settings screen.
I actually read the documentation you wrote but i am no developer, just a 3D printer enthusiast looking to automate my Octoprint. I don't have enough knowledge to understand or even manipulate the code you wrote, where to paste it or about Linux commands in General.
I installed the custom gcode plugin but found it too complicated for a non programmers to understand how to put a shortcut.
In the end, i found out that putting a small piece of tape on the 4th usb connector pin is actually way simpler and just what was needed.
I am sure many like me have not much idea about Linux but are looking for similar answers. I guess that's why plugins exists.
Just a big THANK YOU to @OutsourcedGuru for your hard work and dedication, works great on my model 3B!
Thank you for this @OutsourcedGuru. I'm just using this very simply to toggle my LED frame lights on and off with a Raspberry Pi 3B and it works like a charm. Cheers.
Just discovered this today trying to figure out how to disable the power on my USB ports going to my printer without some silly gimmick. I dont know a lot about using github, but if understand what i read correctly there in the issues and pull requests, that support for the Pi 4B looks to be on the way?
I haven't checked in with the author of the underlying
uhubctl code yet but I anticipate that he's got his sorted out for the Pi 4B by now. I suppose the bad news for you at the moment is that all of my stuff is in storage; I'm building a house during the next couple of months.
Ok cool. It’s certainly not important. Grats on the house.
This is a great plugin idea. I have a 3B+. Installation is easy. It only allows me to turn on and off USB 2 (to control all 4 ports) and USB 3-5 are always greyed out with no ability to toggle them. Pretty sure this is normal for the 3B+.
Any idea why when I toggle the USB off it also turns off connection to my printer? It won't allow octoprint to connect again until I turn USB 2 back on.
This plugin (i.e. the bits being toggled) turn off the USB ports including the power. If you want to block sending 5V to the printer but still communicate with it, then you need a different solution (i.e. tape).
Any chance of a version that supports the 4B as well?
Probably not, the power to the USB ports on the Pi 4 changed and they are either all on or all off, and not that many people are bothered about it.
I thought uhubctl could work to selectively switch off USB ports on certain powered hubs. Maybe that could be an option for 4B owners?
There is a PR that claims to support the RPi 4 Update for Raspberry Pi 4 by TokugawaHeavyIndustries · Pull Request #7 · OutsourcedGuru/OctoPrint-USBControl (github.com)