Sunday, December 27, 2009

sflgtc - Seagate FreeAgent Led & Idle timeout Controller for Linux

Today, i got a Seagate FreeAgent external usb hd 500 GB. Since i was really bored, i made this little application that should be able to handle the Led and Idle Timeout on Linux as the windows software does. I dont know if there is something like this for linux, really, i didn't search..... but... hey... another one wont hurt!
Note that it's really dumb :).
To add new seagates devices, just add vendor_id & product_id on the structure, or send me the data and i'll do it.

Let me know, if something it's not working, or new usb commands should be added for a new device.

Good Luck Seagater's :)

Project: http://sflgtc.googlecode.com/
Download: http://sflgtc.googlecode.com/files/sflgtc.c

Test Device: 0bc2:3008 Seagate RSS LLC

Required: libusb-1.0

Notes:

Compile: gcc -o sflgtc sflgtc.c `pkg-config --cflags --libs libusb-1.0`
*
* Usage:
* ./sflgtc -l 0 -> Query Led State
* ./sflgtc -l 1 -> Switch Led On/Off
* ./sflgtc -t 0 -> Query current timeout set on device
* ./sflgtc -t -1 -> Disable timeout on device
* ./sflgtc -t seconds -> Set new timeout ( on win : 3 min, 5 min, 15 min, 1 hour, ... 5 hours its supported )
* ./sflgtc -l 0 -k -> ( Do not unload / load usb-storage module. You must remove it first, use this if you inteend to set led and timeout )
*

If you dont want the app to remove and reload usb-storage, use the "-k" option, but first:
# rmmod usb-storage
# use sflgtc with -k
# modprobe usb-storage

No comments: