Physical button to interface with shell script

Red Squirrel

[H]F Junkie
Joined
Nov 29, 2009
Messages
9,223
I don't know much about electronics or coding drivers, but it's something that would be fun to learn. Or if there's something premade that will do what I want, then that will do too.

Basically what I want to do is a remote button that has a LED on it, when I push the button, through USB it would run a linux shell script on my server, the script would then tell the device to turn the LED on. When the script is done, it would tell the device to turn the LED off.

How hard would this be to do? I'm hoping to use ether USB or Ethernet. Either way, it will travel over my Ethernet network. If I use USB then I will be using one of those converter boxes to go over Ethernet. What I want to use this for is my backups. I will have a seperate HDD docking station where I put a drive on and turn it on. I would then push the separate button which would tell the server to start the backup job. To indicate it was successful to start (ex: drive mounted successfully) the LED would turn on. When the job is done, the LED would turn off, indicating that it is ok to turn off the drive. This would be situated in my bedroom while the server is in the basement.
 
Cheapest and easiest probably to cannibalize some USB HID device. Take apart an old mouse or gamepad, or go buy a junky one from a dollar shop.

Doing it yourself from scratch is kinda tricky if you want to use USB or Ethernet, neither is an easy interface to implement.

If you have handy an old Linksys WRT54GL or NSLU or other Linux-hackable device, most of these have at least some GPIO you can access and would probably do the job.
 
Yeah seems this is much harder then I am hoping for. Maybe eventually I can dig deeper into this stuff so I can learn USB. The reason i want USB is that serial is hit and miss. Some machines have it, some don't. So when I later on upgrade my server, then maybe it won't have it. Adapters don't usually work all that great.

What I'm thinking of is just stick to my existing system but I can always enhance it. I put the drive in, turn the dock on, and then run a shell script manually which sends me an email if it fails to start, or after it's done running. I can always just add a web interface with an indicator as well.
 
Back
Top