Pexpect for python


Who would I have to bribe^H^H^H^H^H ask nicely to get a specific python package into the repo?

I’m looking for pexpect, so I can script the interaction with [other machines|the local modem] on my GL-MIFI. I tried pip-installing it, but I get Out Of memory. I guess the platform is not meant to compile itself.

So the only chance I have is to beg here, so $someone compiles it on much better hardware and provides it in the official repo.

Is this the way to do it, or is there a more success-probe way to tread?

thanks for pointing me in the right direction

You mean out of memory, not out of storage, right?

Out of memory while pip was compiling. Or better, while pip was preparing to compile, there was no output yet before it ran out of mem. I have a 2gig microSD in the Mifi, storage should not be a problem (though I don’t know whether pip knows yet how to use that part of the filesystem. But I don’t worry about that because memory is the issue at the moment).

If I may come back to this…

is there a chance to get pexpect into the official repo?

Or does anyone have another easy way to script talking to the Mifi modem via python? (sending AT commands and expecting with timeout on its output) echo/cat will most likely NOT suffice.


PS: I might have found a workable alternative, pyserial. BUT… that’s a python2 package in the repository. May I kindly ask you to also put that out as a python3 opkg?

I tried to compile but faild.

If you just want to send AT command, you do not need python. You can just use our built-in tool.

gl_modem AT <device> <command>

Device is /dev/ttyUSB2 a link. command is your AT command.
For example

gl_modem AT /dev/ttyUSB2 AT+GSN

You will get a return.

Well, I’m running a python script anyway to monitor some stuff at home, so being able to talk to the modem from the script would be awesome.

Thanks for pointing to gl_modem, this might solve some problems.

Is there a list of all these little GL-grown tools that seem to be extremely helpful? :wink:

thanks a lot!

For modem, pls use the gl_modem tool I mentioned.

We do have some other tools, like this one GitHub - gl-inet/bletool

But may not what you need.

gl_modem seems pretty convenient.

Did you manage to compile the python3 version of pyserial?

Alfie already gave you the solution to use gl_modem. If you need python packages that are missing, you can build them using the GL SDK here: