I have a Raspberry Pi that I use as a multi-purpose 24/7 device for DLNA, CIFS, VPN etc. Now I bought a TellStick, that is a USB device that can send 433MHz radio commands to wireless power switches, dimmers etc. The manufacturer offers sources and tools for linux, which is really great, btw.
Using a special command (named tdtool) I can send commands to my power switches, e.g.
tdtool --on 1
This switches on device 1. This works very well and stable, so that I want to get away from shell commands in order to make the handling easier. My idea is to set up a very simple web server that only needs to be able to receive GET or POST requests and triggers some action like running the command "tdtool --off 3". So the web server does not even need to serve pages, it just needs to listen to requests.
I want to create a HTTP-based solution because that would allow me to use my smartphone as a remote control. There is an Android app named "Tasker" that is awesome on its own, but it also allows sending customized HTTP requests based on certain conditions, so that I could make my lights go bright when I come home (and Tasker recognizes a connection to my WIFI network or similar).
As the Raspberry is not the most powerful piece of hardware, I'd like to keep things as simple as possible. Basically, I need this:
A HTTP get request comes in, for example:
/switch?device=1&action=on
According to this request, the server should translate that somehow into this:
tdtool --on 1
I am sure that I would find a way to build something like that with Apache and PHP, but I think that would be somewhat overdressed in my case. What would you recommend? Is there some cool python magic that could make this happen? Or some fancy mini webserver with a CGI script? Any thoughts and code samples are greatly appreciated, thanks in advance!