TCP/IP remote control for Symbian Phones

A generic remote control software for Symbian Phones

Why?

I live in a small (about 14m² all in all) student apartment, and thus shouldn't need a remote control for my computer. However, I am incredibly lazy. And, when watching a film, I don't want to stand up from my bed just to reduce volume or skip back 10 seconds. Since my laptop doesn't have bluetooth, I needed something that could use wireless LAN. And thus, tcpremote was born

How?

I used PyS60, an incredible piece of software that allows one to easily write S60 programs without having to install the (as a friend told me) homungous toolchain. All one needs is to install the PyS60 .sis and the interactive python shell (as described here). Then, get the source from here or with git from https://thenybble.de/repos/tcpremote.git/.

   /media/JS/Python:
insgesamt 160
drwx------  3 jeeger users 32768  3. Mär 16:56 .
drwx------ 16 jeeger users 16384  1. Jan 1970  ..
drwx------  2 jeeger users 32768  3. Mär 19:32 lib
-rw-------  1 jeeger users  4643  3. Mär 20:29 remote_ui.py

/media/JS/Python/lib:
insgesamt 192
drwx------ 2 jeeger users 32768  3. Mär 19:32 .
drwx------ 3 jeeger users 32768  4. Mär 14:28 ..
-rw------- 1 jeeger users  1515  3. Mär 20:29 datasource.py
-rw------- 1 jeeger users  5329  3. Mär 20:29 executors.py
-rw------- 1 jeeger users  1723  3. Mär 18:32 servers.db

The source files should be layed out like this. Then, start the python shell and execute the remote_ui script.

What exactly?

tcpremote uses the concept of a controller: A controller provides certain commands and subclasses the BaseExecutor class (yeah, I called them executor, because they executed commands. But controller fits better.). For example, the MPlayerExecutor I implemented provides commands like skip forward, skip back, volume up, etc.

These commands are provided for selection in a list. When the user selects a command, the controller is called to execute the specified command. How it does this is completely up to the implementor. The MPlayerExecutor and MPDExecutor use a common base class SocketBase that allows easy TCP/IP connectivity.

Also, the program contains a server list which saves the server name, the address and the controller that was used. It prompts the user for the server and then connects and allows execution of the controller commands.

Backend

You will have noticed that tcpremote is only a symbian program, and that no backend server was implemented. That is typically linux: It allows you to do whatever you want with tcpremote (and I was to darn lazy to implement a backend, too). Some examples:

while :; nc -l -p 9000; done | mplayer -slave <some_file>

This provides you with a remote controllable mplayer on port 9000.

while :; nc -l -p 9000; done | zsh

This, besides being dangerous, unauthenticated and unencrypted, allows you to control mpd with the provided MPDExecutor.

Also, the executor framework is so flexible that a backend server can be implemented, even with dataflow in both directions. However, that was not a priority here.

Datum: 2012-03-23 14:26:08 CET

Autor: Jan Seeger

Org version 7.8.03 with Emacs version 23

Validate XHTML 1.0