qreset: A Tool for Resetting Connections

I have written qreset to resolve the following for modems and other PCMCIA networking devices on Qtopia-based ROMs:

It works like a charm for me with a Socket 56k CF modem on Zaurus sl5500 running Sharp ROM 2.38. Any time I experience any of the above problems, I just type "qreset" in my console, and the problems are resolved in just a few seconds. No more crazy guessing about what to do next that might free up my modem to work properly.

I have tested it for a CF modem on ROM 2.38 but believe it may work for other networking devices on Qtopia-based ROMs.

I also am now in the process of testing qreset on my sl6000, ROM 1.12. I have not experienced the above problems enough to do much testing of qreset on my sl6000, so I am not sure how helpful it will be for Tosa users, but it seems to be working fine on my Tosa when I do run it. If you want to try it, I can say that it is definitely compatible with the 2.4.18 kernel.

The primary concern I have about other setups is that I use qcop2 to stop the offending Network process, and know of no way to tell Qtopia precisely which PID (specific Network process) to eliminate instead of letting Qtopia choose whichever one is at the top of the stack, if there is more than one network process running. I have a hunch it could cause problems where someone is simultaneously running, for example, both an external keyboard and a modem.

Although this may not be necessary on later ROMs, if you are running ROM 2.38, you must eliminate respawning of ttyS0 in /etc/inittab. I am finding that the respawning is only an issue on some ROMs. For example, I have found that qreset works fine on my Tosa ROM 1.12, although respawning is enabled. So, although the current version will not work properly for ROM 2.38 setups where such respawning is necessary, people wanting to test running it on later ROMs, even with respawning enabled, are welcome.

I am working on including a command-line option indicating which tty to reset, for those cases where respawning needs to be disabled. I have also written code to run it on dhcpcd processes, although that has not been tested yet. Contact me if such options, or other command line options, are of interest to you.

No matter what ROM your are running, you also must have a fairly fully featured version of ps on your device, such as the ones included in Sharp ROMs. BusyBox's ps will not suffice. The only other dependency is qcop2, which enables qcop messaging from scripts and from the command line.

I have chosen to use Qtopia's qcop command, rather than just using standard kernel commands, because otherwise Qtopia causes problems, and renders the reset ineffectual. If anyone has ideas about how to tell Qtopia which Network process the qcop message is meant for, please tell me!

The script works perfecty for me, but is still filled with a lot of debugging output and comments to myself, in case any bugs surface, and I don't want to post it publicly until a few people have tested it besides just me.

If you are interested in testing qreset, then please read this and then send me a personal message at oesf here or here, or at http://my.opera.com about your setup and which of the problems you experience.


Related Thread at OESF

Start Network Connection From Command Line

Revised September 13, 2010