Skip to content

Commit

Permalink
Fix disabling ethernet on pi zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronRP committed Mar 27, 2024
1 parent 66c684f commit a0c619c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/modemd/modemController.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ func setUSBPower(enabled bool) error {
if enabled {
commands = []string{
"echo 1 | tee /sys/devices/platform/soc/3f980000.usb/buspower", // Enable USB hub
"echo 1 | tee /sys/bus/usb/devices/1-1:1.0/1-1-port1/disable", // Disable Ethernet plug (thanks uhubctl)
//"echo 1 | tee /sys/bus/usb/devices/1-1:1.0/1-1-port1/disable", // Disable Ethernet plug (thanks uhubctl)
}
} else {
commands = []string{"echo 0 | tee /sys/devices/platform/soc/3f980000.usb/buspower"} // Disable USB hub
Expand All @@ -697,7 +697,11 @@ func setUSBPower(enabled bool) error {
}
return fmt.Errorf("failed to %s USB power: %w, command: %s", enDis, err, command)
}
//time.Sleep(500 * time.Millisecond) // Need to wait or or else disabling ethernet might not work.
}
if enabled {
time.Sleep(500 * time.Millisecond) // Need to wait or or else disabling ethernet might not work.
exec.Command("bash", "-c", "echo 1 | tee /sys/bus/usb/devices/1-1:1.0/1-1-port1/disable")
}
return nil
}
Expand Down

0 comments on commit a0c619c

Please sign in to comment.