MrDB
MrDB

Reputation: 659

Python scripts on DD-WRT embedded router

I've written two Python (2.x) scripts to perform the following:

  1. Custom Proxy server (imports optparse, ConfigParser, TLDextract, SocketServer...)
  2. Web admin for proxy (imports flask, ConfigParser, netifaces...)

These are both currently running on a Raspberry pi (Raspian), however I'm seeking some advice on some options on how to get these to run on a DDWRT router (v24).

My thoughts are either:

  1. Install python and required libraries on DDWRT. Whilst I have found some evidence that python can be installed via ipkg (on USB storage) I'm not clear how to get the required imported libraries installed too?

  2. Create a python-independent binary (e.g. PyInstaller) to run on DDWRT. I have hesitations going down this path as I imagine that I'd need to perform the task on a DDWRT running Python (i.e. back to thought 1), and also how it would handle the imported libraries?

  3. Similar to point 1: Compile a custom OpenWRT image which includes all required Python packages. This does seem like a complex piece of work.

Appreciate any advise that you may have.

Upvotes: 6

Views: 11468

Answers (2)

thistleknot
thistleknot

Reputation: 1158

Entware

https://github.com/Entware/Entware

about 3 steps. Requires an ext2 usb attached with a label of Optware

Upvotes: 0

Lucas Kauffman
Lucas Kauffman

Reputation: 6891

You will need to use optware to get the packages and install them onto your router. There is a very good tutorial on the DD-WRT website. Through optware you can install the different python packages. Do mind that running flask and a proxyserver on a DDWRT router with a limited amount of memory might not be the best idea.

Upvotes: 2

Related Questions