At the moment, enabling the USB follow (or the on boot) option(s) does not do anything.
The main reason for this is because the USB follow function can invoke a race-like condition. If the USB power disappears for a second, it may cause the device to start a power off sequence, when really, the device might already be booting and starting to address the drives.
The solution to this is to implement a simple check using a global variable to decide if the process should go ahead.
For example:
interrupt_operation = False
def usb_power_off(pin):
if CONFIG['power']['follow_usb_delay']:
time.sleep(CONFIG['power']['follow_usb_delay'])
# Wait 1 second, for safety.
time.sleep(1)
if interrupt_operation:
continue
else:
psu.off()
At the moment, enabling the USB follow (or the on boot) option(s) does not do anything.
The main reason for this is because the USB follow function can invoke a race-like condition. If the USB power disappears for a second, it may cause the device to start a power off sequence, when really, the device might already be booting and starting to address the drives.
The solution to this is to implement a simple check using a global variable to decide if the process should go ahead.
For example: