

zav
-
Posts
6 -
Joined
-
Last visited
Reputation Activity
-
zav got a reaction from tkaiser in [OPiOne] USB power off
Thank you very much tkaiser! Thank you all!
Works great! Problem solved!
Message to descendants :
1) Taking out of control of the respective driver
# cd /boot
# bin2fex ./bin/orangepione.bin > newbin
# nano ./newbin
Change line 'usb_drv_vbus_gpio = port:PL02<1><0><default><0>' on 'usb_drv_vbus_gpio = '
# rm ./script.bin
# fex2bin ./newbin > script.bin
# rm ./newbin
!REMEMBER! - after reboot power on USB OTG port will be OFF by default!
# reboot
2) Export gpio pin PL02.
To obtain the correct number you have to calculate it from the pin name. Use this formula:
(position of letter in alphabet - 1) * 32 + pin number (HL02) letter L - stay on 12 position in alphabet.
(HL02) pin number - 2
result:
(12-1)*32+2=354 Use GPIO sysfs do next:
# echo 354 > /sys/class/gpio/export
# echo "out" > /sys/class/gpio/gpio354/direction
Power ON
# echo 1 > /sys/class/gpio/gpio354/value
Power OFF
# echo 0 > /sys/class/gpio/gpio354/value
Enjoy!
-
zav got a reaction from guidol in [OPiOne] USB power off
Thank you very much tkaiser! Thank you all!
Works great! Problem solved!
Message to descendants :
1) Taking out of control of the respective driver
# cd /boot
# bin2fex ./bin/orangepione.bin > newbin
# nano ./newbin
Change line 'usb_drv_vbus_gpio = port:PL02<1><0><default><0>' on 'usb_drv_vbus_gpio = '
# rm ./script.bin
# fex2bin ./newbin > script.bin
# rm ./newbin
!REMEMBER! - after reboot power on USB OTG port will be OFF by default!
# reboot
2) Export gpio pin PL02.
To obtain the correct number you have to calculate it from the pin name. Use this formula:
(position of letter in alphabet - 1) * 32 + pin number (HL02) letter L - stay on 12 position in alphabet.
(HL02) pin number - 2
result:
(12-1)*32+2=354 Use GPIO sysfs do next:
# echo 354 > /sys/class/gpio/export
# echo "out" > /sys/class/gpio/gpio354/direction
Power ON
# echo 1 > /sys/class/gpio/gpio354/value
Power OFF
# echo 0 > /sys/class/gpio/gpio354/value
Enjoy!
-
zav reacted to chwe in [OPiOne] USB power off
Shouldn't this be possible with the OTG Port by toggling PL2?
Edit: But restart isn't really a nice approach to solve your issue not?
-
zav reacted to tkaiser in [OPiOne] USB power off
Tried it out this way and then used the usual GPIO sysfs:
root@orangepione:/# echo 354 > /sys/class/gpio/export root@orangepione:/# echo "out" > /sys/class/gpio/gpio354/direction root@orangepione:/# echo 1 > /sys/class/gpio/gpio354/value root@orangepione:/# lsusb Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 05e3:0723 Genesys Logic, Inc. GL827L SD/MMC/MS Flash Card Reader Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub root@orangepione:/# echo 0 > /sys/class/gpio/gpio354/value root@orangepione:/# lsusb Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Calculating the respective sysfs node is following the mainline rule here (even with legacy kernel): https://linux-sunxi.org/GPIO
-
zav reacted to tkaiser in [OPiOne] USB power off
And this works surprisingly VERY WELL. My Orange Pi powering a Banana Pi (since there we can measure voltage):
The Orange Pi is powered through Xunlong's 5V/3A PSU. And this is how it looks wrt voltage on the Banana Pi (the white cable in between is an 20AWG rated MicroUSB cable):
### Current system health: Time CPU load %cpu %sys %usr %nice %io %irq CPU PMIC DC-IN C.St. 11:38:12: 960MHz 0.18 10% 6% 2% 0% 2% 0% 48.9°C 30.1°C 5.14V 0/6 11:38:13: 960MHz 0.18 17% 15% 2% 0% 0% 0% 48.7°C 29.9°C 5.12V 0/6 11:38:14: 960MHz 0.18 25% 20% 1% 0% 3% 0% 48.4°C 29.7°C 5.15V 0/6 11:38:15: 960MHz 0.18 10% 8% 2% 0% 0% 0% 48.4°C 30.0°C 5.16V 0/6 11:38:16: 528MHz 0.18 22% 19% 2% 0% 0% 0% 48.2°C 29.9°C 5.15V 0/6 11:38:18: 960MHz 0.32 10% 6% 2% 0% 1% 0% 49.4°C 30.7°C 5.07V 0/6 11:38:20: 960MHz 0.32 100% 7% 92% 0% 0% 0% 50.3°C 31.0°C 5.10V 0/6 11:38:21: 960MHz 0.32 75% 7% 68% 0% 0% 0% 49.1°C 30.2°C 5.15V 0/6 11:38:23: 960MHz 0.38 16% 11% 0% 0% 4% 0% 49.0°C 30.0°C 5.16V 0/6 11:38:24: 528MHz 0.38 11% 10% 1% 0% 0% 0% 48.6°C 30.2°C 5.10V 0/6 Starting at 11:38:18 a short stress test had been started in the background. Voltage still at 5.07V which is just... great.
Adding a host powered SSD to Banana Pi of course led to an instant poweroff. But on the Orange Pi it was just a simple CLI command to get the Banana restarted (without SSD connected of course!):
echo 0 > /sys/class/gpio/gpio354/value ; sleep 2 ; echo 1 > /sys/class/gpio/gpio354/value
-
zav got a reaction from boobypi in [OPiOne] USB power off
Thank you very much tkaiser! Thank you all!
Works great! Problem solved!
Message to descendants :
1) Taking out of control of the respective driver
# cd /boot
# bin2fex ./bin/orangepione.bin > newbin
# nano ./newbin
Change line 'usb_drv_vbus_gpio = port:PL02<1><0><default><0>' on 'usb_drv_vbus_gpio = '
# rm ./script.bin
# fex2bin ./newbin > script.bin
# rm ./newbin
!REMEMBER! - after reboot power on USB OTG port will be OFF by default!
# reboot
2) Export gpio pin PL02.
To obtain the correct number you have to calculate it from the pin name. Use this formula:
(position of letter in alphabet - 1) * 32 + pin number (HL02) letter L - stay on 12 position in alphabet.
(HL02) pin number - 2
result:
(12-1)*32+2=354 Use GPIO sysfs do next:
# echo 354 > /sys/class/gpio/export
# echo "out" > /sys/class/gpio/gpio354/direction
Power ON
# echo 1 > /sys/class/gpio/gpio354/value
Power OFF
# echo 0 > /sys/class/gpio/gpio354/value
Enjoy!