I am using a khadas vim1.4 with kernel 5.16.0-rc2. I would like to turn the power to my USB device off so that I can hard reset the device. How can this be done?
In another post I saw that it should be possible to turn HDMIPWR_EN off, but I am unable to figure out how this can be doen? Is there a specific command for this?
Have tried controlling the GPIOH_3 but it’s in use so I can’t control the GPIO bit.
@Dieter
USB power control will be used by many devices at the same time, not only USB. I don’t recommend you to do this, what is the reason you need the hardware to reboot the USB?
@Frank
I understand your concern. We are using a 3G dongle and after some hours it gets diconnected. The only way to get my connection back is to reset the dongle (by removing the power). I have tried unbinding the usb drivers, restarting the network services etc… but that doesn’t do the trick.
So for a last resort I would like the ability to remove the power to the dongle so that it gets a hard reboot. Or if you know of another way to get my connection back that would also be good.
@Frank
Haven’t seen any option on the dongle that could resolve this issue.
If I look at the schematic of the vim1 I notice there is a mosfet between the power and the power to the USB. Couldn’t the power to the USB be switched off by using the HDMI_5V_EN? GPIOH3?
I know you don’t recommend it, but how could I toggle the HDMI_5V_EN?
I have tried that but I always get the error "-bash: echo: write error: Device or resource busy
" when I try todo the export. Even when I have unbind my usb drivers.
I have tried it on ubuntu 18.04 and there I can control the GPIOH_3. It switches the power off when I place the direction to input and not when I change the value. Am I missing something?
@Dieter I haven’t tested whether the firmware of the mainline can run WiringPi. Generally speaking, other adaptations are required for the mainline to be used.I can find time to test the main line, if you want to use the mainline