Flexible BitTorrent Client for Embedded Devices
Today, I and my colleages were thinking about embedding BTQueue into a kind of Linux-based router. Well, it is not easy to do so because of the nature of Python interpreter and its slogan.
Battery included!
I found Python for OpenWRT. It looks very promising and amazing by its size about 20 MB. In short, it is only usable on any routers with big flash memory or with USB for external storage. Unfortunately, these routers are not available in Thailand. So I suppose to have an embedable version of BTQueue. How to do that? The easiest solution is to slim down Python. I found Tiny Python. Anyway, it is just for MS Windows platform. So I looked for another solution not limited to just Python. Lua might be a good candidate here as a glue to ctorrent or libtorrent. The full set of Lua is about 100 KB.
Well, there are so many things needed to be done.
- BTQueue is not like other BitTorrent client such that it relies on client/server concept. As a result, user may remotely control an instance of BTQueue by small network packets. In particular, I'm talking about XML-RPC support in BTQueue. It seems Lua has LuaXMLRPC. I will try it to see how it goes.
- In Python, I have
optparse
which seems to be the most powerful option parser I used to see. In Lua, I don't see any replacement comparing tooptparse
. The best one I see is just GetOpt. - In PYthon, I have
Cmd
module which let me develop command line prompt like interactive Python shorter than ever and most of all it is very powerful and is appliable to XML-RPC handler. Lua don't have it again.
As a starting point to that goal, I have to learn to to develop programs in Lua. Codenone could help me alot. My first Lua code is here.
Tags: btqueue, bittorrent, linux router, lua, python
- sugree's blog
- 4334 reads
LuaXMLRPC for OpenWRT
Post new comment