Python in a router

I'm trying to get python working in my Asus RT-AC51U. I got python3 and pip installed and working on a USB stick using opkg with -d. But pip3.9 seemed to have /usr/bin hard coded and couldn't find python. I changed that to
#!/mnt/sda1/usr/bin/python3</code>

Now I can run pip, but can't install any modules with it. It runs for ages and then stops e.g. with "killed" which seems to be due to out of memory. Was about 34 MB virtual according to dmesg.

Is using pip out of question with such a low resource system? I'm quite new to python. I'm trying to install this python module https://github.com/yozik04/vallox_websocket_api

I've got it working on my PC and Android phone.

How can I get it working on my Asus router? How to install without pip?

Those probably have more RAM then your router...

2 Likes

Of course they have a lot more RAM and "disk" space.

But is it possible to get this working? Pip seems to be the problem. I don't need it for anything else than installing this module. How to install it without pip?

I got this solved. I just compared what I had in my PC at /usr/lib/python3.9/site-packages/ to what the module tar.gz had. Then I just copied the files to /mnt/sda1/usr/lib/python3.9/site-packages/.

Works just fine although the python code I use takes 7.5 s to run compared to 0.5 s on a remote PC.

Pip doesn't seem to be made for such a small systems. Shouldn't be that hard to do some checks and then copy files.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.