0

I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web interface as it would not be necessary to install software on that computer. For obvious reasons it would require log in details.

So basically the problem is sending encrypted commands from a web interface to my computer at home. What would be the best method to achieve this and what programming languages should I use? I know Java, Python and C quite well, but have very little experience with web applications, such as Javascript and PHP.

I have looked at web chat examples as it is sort of similar concept to what I wish to achieve, except the text can be replaced with commands. Is this a viable solution or are there better alternatives?

Thank you

1 Answers1

1

If you're asking about programming your own solution you should ask on StackOverflow (if you confirm this is the case, people will migrate the question automatically).

If you're talking about doing this as a general "control my computer" thing, you can install VNC to remotely log into your computer and do everything remotely as if you were sitting at the console. This would require you forwarding a port from your firewall/router to your computer, and if you want it encrypted, finding a way to either use a SSH tunnel or purchasing a version of VNC that uses encryption and is compatible with your version of Windows, or using a VPN tunnel between your workstation on the Internet to your home network.

VNC wouldn't necessarily require software installation on the client system you're on since there is a java web version that will display your computer's (home) desktop in a web browser.

Depending on what exactly you're trying to do, and what platform you have available, it may not be all that difficult to use some form of email to send commands to your home computer, if it's set up to retrieve email periodically and you could have it parse messages for a keyword or phrase that will trigger a subroutine for carrying out commands. It depends on how flexible you need the system to be and how complicated you want to get; from your description I don't know if you're trying to do something with home security or if you're just trying to shoot your cat with USB-connected NERF missiles from ThinkGeek.

Bart Silverstrim
  • 31,092
  • 9
  • 65
  • 87
  • Thank you very much. The main part of the project is actually a device that I will develop that connects to the computer's usb port. Sorry if it was a bit vague in my original question. This device will perform simple functions such as turning lights on etc. At first I will just attempt to switch the lights remotely using the internet. Later on I will add commands that can control certain aspects of the computer such as the music player. I think doing a full remote desktop connection to control my device is therefore not quite necessary. –  Oct 25 '10 at 13:35
  • If it has a set series of mini-commands, I'd probably look at a way of using a series of quick commands that are evaluated by scripts of some sort. If you're proficient in programming you could probably make a static binary that you could run and use as a control program; encryption could be done on the client and reversed on the server with a small interception program. Depends on how you're planning to do everything, but that would be relatively simple and you might not have to worry about maintaining the website side of the project. But that's just me. – Bart Silverstrim Oct 25 '10 at 13:42
  • Yes, it will have a series of mini commands, but I'm not exactly sure what you mean. Do you suggest I have a small program running on my home computer that receives these commands and relays it to the usb port? And then a web app that sends the commands? What method should I use to send data between the two components? Can SSH be used for that or are there simpler/better methods? Eventually I wish to replace the computer with a single device that connects to the internet and can control many electronic devices in my house. –  Oct 25 '10 at 14:04
  • I was suggesting forgetting the web interface and have a small special-purpose server that receives a string of encrypted text, decrypts it, and relays the commands to your device(s). You can create a static client that takes your commands and encrypts them to send to the server, static so they you can carry it on a USB drive and not install it. It should simplify things as you just maintain your software and not have to maintain your software plus framework or third-party libraries on your final version of the software. – Bart Silverstrim Oct 25 '10 at 14:13
  • I would think you could find a library that will encrypt the command(s) and send them to the server (with a status sent back, I suppose, using the reverse) so the only thing between the two systems are encrypted strings, no tunneling or additional protocols (like https) necessary. – Bart Silverstrim Oct 25 '10 at 14:15
  • Thanks, that makes sense. So the client will just be a small program that I run on the remote computer. It then sends encrypted strings to the client program that is running on the computer in my house and this program controls the devices? –  Oct 25 '10 at 14:29
  • I like that design. You can probably get more experienced feedback on StackOverflow, which is programmer-centric, as to how well this would work, but as someone who has to deal with application installation and setup and maintenance, this approach makes sense to me. Depends on your particular situation as to how well it would work in your situation. – Bart Silverstrim Oct 25 '10 at 14:41
  • This also unmarries the control program from your client; you could still create a web program or any sets of clients that talks to your server application which in turn controls your USB devices. Separating that logic may help with expanding features or debugging down the road, and certainly should make it simpler initially to create the program and prototype. – Bart Silverstrim Oct 25 '10 at 14:42
  • Since it takes just a string of encrypted text (and have it reply with a status/result) you could create a command line client, a graphical client, and web client, and all of them would use the same API to talk to your mini-server without rewriting anything. – Bart Silverstrim Oct 25 '10 at 14:43
  • Yes, that sounds like the best approach. I will first create the apps and then later on I'll create the web client. Thanks for your help, appreciated. –  Oct 25 '10 at 16:16