Mudi (GL-E750) USB Power Cycle

Anyone know the command (or more specifically the gpio pin number) that could be used to force the USB port to power cycle?

Would this be the correct command for the Mudi?

echo 0 > /sys/class/gpio/gpiochip0/device/subsystem/devices/ahb:apb/18030000.usb-phy/value
sleep 1
echo 1 > /sys/class/gpio/gpiochip0/device/subsystem/devices/ahb:apb/18030000.usb-phy/value

Or does the Mudi not support power cycling the USB port?

The USB port is controlled by a single-chip microcomputer, and it can’t be turned off

Do you want to powercycle the USB-port or do you want to powercyle a device connected to the USB-port?
If you want to do this, you could use an WLAN-USB-switch.

The issue I was attempting to solve was a Raspberry PI was connected to the Mudi (at a remote location). The Raspberry is fully powered by the Mudi’s battery (via USB). At some point in time the Raspberry crashed due to some unknown issue (I suspect a out of memory error, but would need to investigate the root cause of the crash). When the Raspberry crashed the device did not restart itself; even though the Raspberry is connected to the Mudi (and the Mudi is verified as being online). Reconnecting the Raspberry to the Mudi would correctly power on the Raspberry, so I figured a (remote) USB power cycle would simulate a USB reconnect and reboot the Raspberry. I’m not sure if WLAN-USB-switch would work for this - any info on where to read more about this?

Search on AliExpress (or Amazon, sometimes on Ebay too) the following words:

“sonoff 5V micro usb switch”

This was in fact the device I was contemplating on purchasing to accomplish this task :smile:

Just slightly disappointed that this cannot be performed via software, since other GL-iNet devices do have this capability.

This is the device I use to switch USB-powered devices: Delock Produkte 11828 Delock WLAN EASY-USB Smart Schalter MQTT

Are you sure that the USB-output of the Mudi delivers sufficient power to the RASPI??

Since the RPI has been running well for 2 weeks via (Mudi) USB power: I’d say the Mudi does provide sufficient USB power to run the Pi. It is all based on the USB power specification - which the Mudi + Pi should both respect.

The day the crash occurred I was performing a lot of fairly resource intensive tasks: running node project builds/npm package installs/etc. Which is why I suspect an out of memory issue. However, the RPI did perform decently well that whole time - till the crash. So you might be onto something about too large of a power draw possibly causing the crash. My thoughts are that the resource intensive tasks will probably be few and far between (like performing major changes on the Pi) and as long as the Pi can run the assigned tasks daily (requiring less resources): I should be okay with this setup.

Thanks for that device link. I’ll check it out!

1 Like