Self-waking computer for DIY cloud storage

self-waking-cloud-storage

[Dominic] decided to take control of his cloud storage by switching to OwnCloud. Unlike most cloud storage solutions, this isn’t a company offering you free space. It’s an open source software package which your run on your own machine. [Dom] didn’t want to leave his box running 24/7 as it would be unused the majority of the time. So he hacked this router to switch on the computer whenever he tries to access the storage.

Obviously this is a Wake-On-Lan type of situation, but the hardware he has chosen to use doesn’t include those features. Since he already had this TP-Link 703n on hand he decided to use it as a controller for the computer. His method is quite clever. The router is running a script that monitors the computer and the bandwidth it’s using. When traffic from the network stops, the router will issue a shutdown command within just a few minutes. It then assigns itself the computer’s IP address so that it can listen for incoming requests and use the relay on that breadboard to turn the box back on. Obviously running the embedded system is much more efficient than having an entire computer turned on all the time, and it’s WiFi capabilities mean no cords to run to the home network.

Comments

  1. Bob D says:

    I’ll just pick that nit and mention this is just remote storage, it’s not ‘cloud’ storage. Cloud storage has multiple redundancy across multiple locations.

    But a nice hack to use a router to control the uptime of a machine. I can see a lot of uses for that.

  2. sixlocal says:

    For all the cost of the wires and such, couldn’t they have just bought an ethernet card that supports WOL?
    A quick search on ebay turns up dozens of cards that are under $1…

  3. I recently solved a very similar problem. I started out with a similar approach with a server + a router to help it wake up. Problem was that ip stealing for monitoring wakeup requests was very fragile. Server and router could get out of sync and bad things would happen.
    Instead I wrote a tool that monitors arp requests and issues wakeup commands based on those. Arp starts broadcasting once the machine has not been reachable for a while.

    http://taras.glek.net/blog/2013/02/17/router-assisted-automatic-wake-on-lan-plus-suspend/

    • dom says:

      the ARP packets were the first things I noticed and started to code for. during testing, however, ARP was significantly delayed after the machine powered off, so it was unsatisfactory.

      as far as the server and router getting out of sync, i handled that by plugging the server INTO the router, and this is the interface through which the router pings the server. not the most elegant solution, but reliable and fast.

  4. xorpunk says:

    I always get a good laugh when I see ‘professional solutions’ with illiterate people behind it. Especially the cloud solutions that not only lack actual cloud infrastructure, but claim to have FIPS certification on a blade they rent and have no physical access to…

    But hey we’re all hackers, geeks, and physicists XD

    • dom says:

      i’m flattered that you thought that any part of this project was professional or even feigning it lol

    • someone says:

      But hey, luckily everyone is not a know it all jerk like you! Some people just think it is cool to see other people share their projects, perfect or not. They probably learned more getting it to work than you learned making fun of them. Oh, and the correct sentence would be “when I see “professional solutions” with illiterate people behind THEM. Plural. Or, a “professional solution” with illiterate people behind IT. Idiot.

    • milton willis says:

      I’m sure your mother is proud of you and your constructive criticism.
      Tough guys and geniuses of the internet:
      Why do you try so hard to get a rise out of people by belittling them?
      And if you are truly as invaluable as you claim, how do you have the time to squabble
      with those whom are not your intellectual equals?
      Shouldn’t you be counting your money and plowing your troves of women?
      Don’t reply to this. It would be a waste of your precious time. The world needs you.

  5. Nova says:

    The cpu’s io pins are interfacing directly to the relay? Yikes, put a transistor and diode on that stat, else your router won’t be the one waking up sometime due to inductive kick-back stress.

    • dom says:

      still need to do this. every transistor i had on hand is tied up in another project, and i’ve never actually bothered to purchase diodes. i will be salvaging some parts from dead electronics and adding this soon. thanks for the constructive criticism!

  6. Andrew says:

    Tell me what OwnCloud does for me that running an ssh server on my own box at home does not.

    • barry99705 says:

      Automagic picture uploads from your android phone.

      • Andrew says:

        But how does *that* work? If it doesn’t use ssh (which is a common, open standard) then I don’t want it.

        • alt says:

          It uses webdav, which is…. common, open standard. ssh/scp is all very well, but if you have files that you want to just sync between your linux and android and iOS and OSX and Windows devices, and you don’t want the space limitations and possible implications of giving all your data to a 3rd party, then OwnCloud is a very good solution.

    • xorpunk says:

      allows you to say cloud because it’s not on the local physical device…

      Scary thing: People who don’t know what cloud infrastructure actually is are the ones getting jobs with infrastructure companies because an ape can pass the CCN* and get a degree in America…

      Related to this article: Most systems have firmware level support for wake-on-lan and all OSes have sleep state APIs with page-to-disk support built into kernel…

    • anon says:

      A neat GUI with PIM and built-in viewers that can be used to it’s fullest extent from any device that has an HTML5 browser without leaving any marks or having to install anything that an average non-techie’s computer doesn’t already have installed and can be extended with custom functionality such as that found here: http://apps.owncloud.com/

      I don’t use any of these new “cloud” things either but I openly admit that it’s because I’m old and old people doesn’t like change, not because they have nothing good to offer (they do).

    • jaded says:

      The biggest attraction is the availability of integrated smartphone client tools. There are iPhone and Android clients that can upload, download, edit and view photos, music, stupid cat videos, PDFs, Word documents, password files, or whatever. There are iPhone apps that have other data transfer needs that can incorporate OwnCloud as their storage mechanism. (Granted, the iPhone database I use is the completely awesome MyStuff2, and it can do FTP so I don’t need it to have OwnCloud integration. I do, however, have to be home as I won’t FTP over the intarwebz.)

      Think about the many people who need smartphone integration and have less than technical users who use something like DropBox for easy shared access to files.

      The problem with DropBox, Google Drive, iCloud (and their ilk) are that they’re owned and run by others on a for-profit basis, and who are monetizing them in strange ways. For example, a friend started getting a lot of online web ads for Spaghetti-Os, which he found odd as he’s never eaten them. He then realized he’d uploaded a Word document with a short story about Spaghetti-Os to DropBox, and determined that they scan the materials being stored inside them, looking to sell data to advertisers. Running your own instance of OwnCloud won’t betray you in such a fashion.

  7. Jon says:

    This is very brilliant! I never would’ve considered a solution to the problem of storage power usage; I just have my FTP server running 24/7 [although it's just a Raspberry Pi + Powered USB Hub + 500GB USB Drive]. This is one of those interesting articles that keeps me coming back to HaD!

  8. jimbo says:

    spiral shaped sata cable?

  9. Yates says:

    I’ve never seen a Sata cable all twisted like that. When the bits finnaly get form the harddrive to the motherboard they’re going to be all dizzy!

  10. metai says:

    Of course, one could argue that the WR703 itself was capable of running OwnCloud.

  11. janisalnis says:

    Great programming, learn from you alot. One can control USB power by GPIO8 of WR703n. This allows to attach 5 V relay without opening router.

  12. alt says:

    Absolutely not trying to take anything away from this rather nice hack, but it’s the same idea as Apple’s Sleep Proxy. As a network admin I don’t like sleep proxy, purely because at first sight it looks like someone is trying to run an arp-spoofing attack!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,628 other followers