I don't know if it is possible to start a specific network connection, but you can raise the network conection selector dialog from the command line using:

qcop "QPE/Network" "connectRequest()"

Thanks Daniel that gave me an idea and I did a search on 'qcop'.

I found some more qcop functions:

QPE/Network: connectRequest() disconnectRequest(int)

QPE/System: __network_connect __network_disconnect

I tried the System functions thus:

qcop "QPE/Network" "__network_connect" but that gave me a syntax error so I tried qcop "QPE/Network" "__network_connect()" which got rid of the error but didn't appear to do anything.

The QPE/System functions look interesting but don't appear to have any effect. Has anyone tried to use them?

bam

Oct 27 2006, 09:53 PM

tryqcop QPE/Network connectRequest()

brings up the network applet connection select screen.

speculatrix

Nov 16 2006, 08:40 AM

this has worked for me, from memory...

cardctl scheme qpewlan0cardctl reset

cvmiller

Nov 20 2006, 06:26 PM

QUOTE(bam @ Oct 27 2006, 09:53 PM)

tryqcop QPE/Network connectRequest()

brings up the network applet connection select screen.

These commands look quite interesting. but they don't do a thing for me on my Zaurus ROM. No matter what I type (a valid command, that is) I get the error:bash-2.05$ qcop QPE/Network 'connectRequest()'SlSharedManager: can't get proc entryDisplay size = 480x640

Is there something else that needs to be loaded before issuing qcop commands?

TIA,

Craig...

speculatrix

Dec 5 2006, 04:28 PM

QUOTE(speculatrix @ Nov 16 2006, 05:40 PM)

this has worked for me, from memory...

cardctl scheme qpewlan0cardctl reset

to shutdown the network connection, use "cardctl scheme Suspend"

the problem with this is that it bypasses qtopia and so the network connection applet doesn't indicate connected or not.

freizugheit

Dec 5 2006, 05:54 PM

QUOTE(speculatrix @ Dec 5 2006, 04:28 PM)

to shutdown the network connection, use "cardctl scheme Suspend"

the problem with this is that it bypasses qtopia and so the network connection applet doesn't indicate connected or not.

Use ifconfig to check whether the network connection is up or down.

speculatrix

Dec 6 2006, 04:40 AM

QUOTE(freizugheit @ Dec 6 2006, 02:54 AM)

QUOTE(speculatrix @ Dec 5 2006, 04:28 PM)

to shutdown the network connection, use "cardctl scheme Suspend"

the problem with this is that it bypasses qtopia and so the network connection applet doesn't indicate connected or not.

Use ifconfig to check whether the network connection is up or down.

tee hee , I know that, I'm just pointing out that if you use cardctl to directly switch on wireless, you can't then use the GUI to turn it off!

sdjf

Mar 11 2007, 06:51 AM

To start my dialup connection from the command line, and have qtopia know it is there, I enter:

You would substitute in the pathname of your particular network configuration file. Our roms are different, but I always use the "Internet Wizard" GUI to set up my configuration file.

It should work the same no matter what type of network connection you have. My applet always shows the correct status when I start from commandline.sdjf

BarrySamuels

Mar 12 2007, 04:32 AM

This is to notify the world in general that sdjf is a splendid chap!

His suggestion does, indeed, work and Qtopia seems aware of that!

Just what I need - thanks sdjf.

(Everything comes to him who waits)

sdjf

Mar 12 2007, 04:47 AM

QUOTE(BarrySamuels @ Mar 12 2007, 04:32 AM)

This is to notify the world in general that sdjf is a splendid chap!

His suggestion does, indeed, work and Qtopia seems aware of that!

Just what I need - thanks sdjf.

(Everything comes to him who waits)

Thanks for the compliment (sdjf shuffles feet a little).

I am very sorry I didn't run across your post sooner, and very happy the command worked for you.

sdjf

sdjf

Mar 22 2007, 02:51 PM

Barry,

Do you mind my asking why you wanted to do it in a script? Most people prefer GUIs, although I also am starting my dialup connections from the command line so I have more control over what's going on, although I've been using opie-sh to make my selection of which connection.

sdjf

BarrySamuels

Mar 24 2007, 01:51 PM

QUOTE(sdjf @ Mar 22 2007, 10:51 PM)

Barry,

Do you mind my asking why you wanted to do it in a script? Most people prefer GUIs, although I also am starting my dialup connections from the command line so I have more control over what's going on, although I've been using opie-sh to make my selection of which connection.

sdjf

Ah! Now that's a long story.

It all started with the GUI for kismet. I couldn't get it to work for me so I set up a script to do it for me. I renamed the original kismet_qt script, called my new script kismet_qt. so that it would then start when I clicked the kismet icon. My new script starts Kismet Server first then calls the renamed kismet_qt.

That worked for me but as I don't use it frequently I often forgot to start the network connection first. I've now included an extra bit in my script which starts the network connection, waits until it's up and running then proceeds to start the kismet stuff all from clicking an icon. Just the sort of thing someone of my age (70) with a bad memory needs.

Thoroughly confused? Well you did ask.

sdjf

Mar 24 2007, 11:50 PM

Don't want to disappoint you, but I'm not confused at all.

This is linux, after all, and that gives us the ability to write scripts to make things easier for us. I think that was a great idea.

What command did you use to determine if the connection was up? I've used route or ifconfig, but also sometimes use grep to check my log and make sure authentication has been completed.

sdjf

BarrySamuels

Mar 25 2007, 01:29 AM

QUOTE(sdjf @ Mar 25 2007, 07:50 AM)

Don't want to disappoint you, but I'm not confused at all.

This is linux, after all, and that gives us the ability to write scripts to make things easier for us. I think that was a great idea.

Aw shucks - you're only saying that because it's true.

QUOTE

What command did you use to determine if the connection was up? I've used route or ifconfig, but also sometimes use grep to check my log and make sure authentication has been completed.

The short answer's 'grep'. I'm using it for a wireless network connection and I now have at the start of my script:

I also have qcop QPE/Network 'stop()' at the end but I'm not sure it's working properly without some 'cardctl' commands to eject/insert the card. It stops the network Ok but the network may not restart without me ejecting and re-inserting the card (I can't remember ). I've got to look into it more.

sdjf

Mar 25 2007, 02:48 AM

Oooh...that sounds very familiar.

Don't work too hard at it...in about four weeks, after I deal with some other deadlines, I expect to be asking you to test the script I've written that resets the network applet. If it works, you should be able to simply call qreset from your script before each time you go to start a connection.

My concern has been that I only have one tty active, and don't know whether it will work properly for multiple active tty processes. I've tried asking both here and at the trolltech mailing list how to direct the 'stop' to a specific tty or pid, and gotten no answers. From looking at the qtopia docs, it may not be officially possible. I guess it might be possible with a lot of painfully worked out tweaking of the qcop message stack to do it, to ensure that the process you want to stop is at the top.

Can you do the following for me, once with wlan active, and once when you are totally offline :

ps ax | grep tty

You may also wish to look at the page I've written at http://www.sdjf.esmartdesign.com/respawn.html about halting the respawning of ttyS0, although it may not be appropriate for your setup if you need to keep a constant connection going to a local network, like your desktop.

I also do not know which Network ttys are used for what on ROMs other than my own. My CF slot is ttyS3, and the serial i/o port is ttyS0, on my sl5500 with ROM 2.38.

Oh, yeah, I found it was a lot easier to control Network behavior by stopping that respawning, and it also speeded my Zaurus up as well.

sdjf

BarrySamuels

Mar 25 2007, 03:13 AM

QUOTE(sdjf @ Mar 25 2007, 10:48 AM)

Oooh...that sounds very familiar.

Don't work too hard at it...in about four weeks, after I deal with some other deadlines, I expect to be asking you to test the script I've written that resets the network applet. If it works, you should be able to simply call qreset from your script before each time you go to start a connection.

Sounds good - I can wait.

QUOTE

My concern has been that I only have one tty active, and don't know whether it will work properly for multiple active tty processes. I've tried asking both here and at the trolltech mailing list how to direct the 'stop' to a specific tty or pid, and gotten no answers. From looking at the qtopia docs, it may not be officially possible. I guess it might be possible with a lot of painfully worked out tweaking of the qcop message stack to do it, to ensure that the process you want to stop is at the top.

Can you do the following for me, once with wlan active, and once when you are totally offline :

What does your Z call the slot your CF card is in? I don't remember another command other than to grep the ps output for details, at least not after being up most of the night.

CF card is ttyS3

QUOTE

Ah...if it's a pppd connection,

It ain't

sdjf

Mar 25 2007, 03:00 PM

Ah! That's what I needed to know. My script could work, but I still don't know if you have ttyS0 running as well. My hunch is that you entered something other than "ps ax | grep tty" or that you weren't using the wireless when you ran the above.

That's cool. So, next time you do run that script, I'd suggest you maybe background it with an ampersand at the end of the command line, or so something to see if you have ttyS0 also running.

But can you try the "ps ax | grep pppd" and see what you get when you are not using wireless? And show the command you entered as well as it's output?

Oops...it was my mistake. I see when I run "ps aux | grep pppd" that the tty part gets cut off:

root 31707 0.0 0.5 1984 160 ttyS3 SN 15:41 0:00 /usr/sbin/pppd tt

Line was too long <:( Oh well.

Grepping for pppd should cover that...

Cheers,sdjf

sdjf

Mar 25 2007, 04:29 PM

Barry, I believe your trouble getting the card to go online the next time around is not due to using stop, but because of the qcop Network messages sent by other apps. Do you use a browser when you are connected? Or email or a chat client? Any of them can and may send their own independent messages telling qtopia when they shut down and resulting in extra stops or something getting sent later. Also, if you close your console while you are connected, that can mess things up as well for the next time around. There's nothing wrong with doing it, but it's just one of many things that can affect connections a time or two later, because of the rather whacky way our early qtopias handle network messages.

There are so many things that can interfere with connectivity that it makes more sense to me to wait until you're ready to use kismet to actually do the resetting.

If you want to see what I used to go through to get online because of what Opera 7.30 did to the GUI, see my old post at:

But I know other apps do the stuff as well. Sometimes respawning of an unused tty can screw things up, and that's why I've been asking if you see any ttyS0 in your process listings, and if you actually use it for anything.

sdjf

BarrySamuels

Mar 29 2007, 06:47 AM

QUOTE(sdjf @ Mar 25 2007, 11:00 PM)

Ah! That's what I needed to know. My script could work, but I still don't know if you have ttyS0 running as well. My hunch is that you entered something other than "ps ax | grep tty" or that you weren't using the wireless when you ran the above.

Oh - no - I - didn't. :-)) Just to be sure I entered 'ps ax | grep tty' again and got the same result.

QUOTE

That's cool. So, next time you do run that script, I'd suggest you maybe background it with an ampersand at the end of the command line, or so something to see if you have ttyS0 also running.

I ran the script normally by clicking the icon then opened a console and did the same again and got the same results. Is that sufficient?

QUOTE

But can you try the "ps ax | grep pppd" and see what you get when you are not using wireless? And show the command you entered as well as it's output?

Oops...it was my mistake. I see when I run "ps aux | grep pppd" that the tty part gets cut off:

root 31707 0.0 0.5 1984 160 ttyS3 SN 15:41 0:00 /usr/sbin/pppd tt

Line was too long <:( Oh well.

Grepping for pppd should cover that...

I entered 'ps ax | grep pppd' (not using wireless) and the result was:

11087 ttya0 SN 0:00 grep pppd

QUOTE

Barry, I believe your trouble getting the card to go online the next time around is not due to using stop, but because of the qcop Network messages sent by other apps. Do you use a browser when you are connected? Or email or a chat client?

No. The script that I run is for Kismet only i.e. network scanning and is not used with anything else.

sdjf

Mar 29 2007, 07:32 AM

Sigh...let's try another time...

Maybe just look over the output of 'ps ax' with your eyes, and find all the lines that contain ttyS when the CF card is plugged in and shows in the taskbar. And see if there are any other tty's in addition to ttya0 that show in the list. Hopefully your eyes will pick up on whatever grep isn't fetching for us.

If your system knows the CF card is plugged in, and it's on ttyS3, then it has to show up somewhere on the list, esp. when you're running kismet.

And have you ever seen any lines showing a ttyS0 in the list? If not, that's great for my script. If yes, then it will be a good test, but I'd like to see what those ttyS0 lines look like.

sdjf

sdjf

Mar 31 2007, 08:11 PM

I forgot to ask. Do you have a pppd log? The resetting script works better with access to a pppd log.

On my ROM 2.38, it's in /tmp/qpe-pppd-log. Does that file exist on yours?

sdjf

BarrySamuels

Apr 8 2007, 11:17 PM

QUOTE(sdjf @ Mar 29 2007, 03:32 PM)

Sigh...let's try another time...

Maybe just look over the output of 'ps ax' with your eyes, and find all the lines that contain ttyS when the CF card is plugged in and shows in the taskbar. And see if there are any other tty's in addition to ttya0 that show in the list. Hopefully your eyes will pick up on whatever grep isn't fetching for us.

I did 'ps ax' and the only occurrences of ttyS in the list are the ones I've already mentioned. Perhaps this version of ps ain't so good.

QUOTE

If your system knows the CF card is plugged in, and it's on ttyS3, then it has to show up somewhere on the list, esp. when you're running kismet.

I got the ttyS3 information from qpeGPS which has ttyS3 set as the Com port.

QUOTE

And have you ever seen any lines showing a ttyS0 in the list? If not, that's great for my script. If yes, then it will be a good test, but I'd like to see what those ttyS0 lines look like.

I suppose the answer there is no.

sdjf

Apr 9 2007, 01:53 AM

This might be easier to discuss in chat. I check #zaurus at irc.freenode.net for people I need to chat with, somewhere between 10pm-1am Calif time, so that'd be around 5am-8am GMT. You have a chat client?

When you do

which ps | xargs ls -l

What do you get? If you follow any symlinks and it points to busybox, then it won't be very useful output from ps.

If it is not a busybox ps, then how about pasteing in or uploading a copy of 'ps ax' from when you are online here?

Also, do you have any kind of log showing what happens when you go online/use kismet?

sdjf

BarrySamuels

Apr 9 2007, 02:54 AM

QUOTE(sdjf @ Apr 9 2007, 09:53 AM)

When you do

which ps | xargs ls -l

What do you get? If you follow any symlinks and it points to busybox, then it won't be very useful output from ps.

It points to /bin/ps

QUOTE

If it is not a busybox ps, then how about pasteing in or uploading a copy of 'ps ax' from when you are online here?

Oh, cool! I was just reading about dhcpcd. You are using that instead of pppd to get online.

But it doesn't seem to tell the kernel what tty it's using and that's why you couldn't find any ttyS in the ps listing. I need a way to test and make sure the resetting has been completed, and am not sure it will work as well when I can't check for the ttyS entries.

I think the next thing that would help, then, is a 'ps ax' when you can't get online, before you mess around with yanking out the card or using any cardctl commands.

I take it there is no log of dhcpcd's progress?

Look for logs in /tmp/ and in /var/log/ when you are actually online with kismet.

Are they earlier, unsuccessful attempts by kermit to connect? I really need to see a "ps ax" from while kermit is searching. Try getting that by immediately entering "ps ax" right after kermit starts up. If you have trouble capturing the output, send it to a file with something like: "ps ax > kermitps".

We need to be able to study your network port's status from all angles, in order to automatically determine whether the resetting is successful or not.

I know what to check for with pppd connections, but dhcpcd is more of a challenge because it doesn't show a tty even though it uses one.

The lack of a dhcpcd log of some sort also complicates debugging. Please snoop around the forums and web and see if you find information about dhcp or dhcpcd logs.

Another possible place to look for ttyS3 information is in the /proc file system, but I haven't found an indicator there that I think we can count on.

Whoa...I think I may have the answer..."cardctl status". Paste in four sets of output from that...one from when you are having trouble and want to yank out the card, one from after you have put it back in, and one more each from while kermit is negotiating and also once when you are finally connected. This might be what we need.

The other thing I also need to know is the name of the lock file created, if there is one. A stale lock on ttyS3 also can be the problem.

What browser(s) do you use on your Zaurus? Do you ever use them when you aren't going online?

I don't know what Skype does. If it won't let you access #bash at irc.freenode.net, you might consider getting a chat client...I recommend NeIC for the Zaurus. You also could get access through the http://www.tyrannozaurus.com gateway to #bash, or get a desktop client such as(I think) Xirc for Linux or Mirc for M$. Tyrannozaurus has links for irc client downloads..

I've turned my script topsy-turvy, adding dhcpcd stuff to it, and that's fine, but I had to rewrite the new sections a couple times as elvis kept running out of space and messing things up. I'm backing up the revisions more frequently now, as in, almost every time.

I also saw someone somewhere on the web, suggesting killing rpciod, and you can try that when you're having problems, but I think it could create it's own problems to do it without going through qtopia and cardctl in sync with each other. They mentioned that killing rpciod releases any "stuck NFS points." Anyhow, that's another option to play with adding to my script if my model doesn't work as is.

sdjf

BarrySamuels

Apr 12 2007, 12:45 PM

QUOTE(sdjf @ Apr 9 2007, 11:16 AM)

I take it there is no log of dhcpcd's progress?

Good guess.

QUOTE

Look for logs in /tmp/ and in /var/log/ when you are actually online with kismet.

The only relevant logs appear to be for Kismet and that's only wireless network information.

QUOTE

Please paste in your results...whether you meant "shows the details for /bin/ps" or "shows a symlink pointing to /bin/ps" is not clear without me eyeballing your output.

-rwxrwxr-x 1 root root 89312 Apr 5 2005 /bin/ps

QUOTE

I don't know what Skype does.

You what? I thought everybody knew of Skype. It's one of those Internet telephone type thingies - if I might use the technical term - talk to someone on the other side of the world for free.

I'll try and get round to providing what other information I can a little later on.

sdjf

Apr 12 2007, 04:02 PM

I confess I'd heard of Skype but it wasn't something I committed to memory...things get filed in my brain according to importance and must have run out of room.

Your ls of ps looks perfect...when you can, give me an md5sum...I'm wondering if we have the same file...my ls looks similar:

-rwxrwxr-x 1 root root 89312 Apr 12 17:00 /bin/ps

602103a27e13b84221a56532d27f8ecb /bin/ps

sdjf

Apr 15 2007, 07:12 PM

Hey, I just found instructions for how to enable the log for dhcpcd in, of all places, the man page!

QUOTE

To catch dhcpcd debugging output add the following line to /etc/syslog.conf file: local0.* /var/log/dhcpcd.log and then refresh syslogd daemon: kill -1 `cat /var/run/syslogd.pid`

It should help in debugging networking problems.

sdjf

sdjf

Apr 17 2007, 04:07 AM

Barry and I have ripped copies of "ps" off of our Sharp ROMs, so that those of you wanting to use a more fully-featured ps who only have the BusyBox versions, can install a better version.

I have written up installation instructions, and also given examples of how much more efficient script-writing can be when using it, at:

Unlike the BusyBox ps, it shows you what tty each process is using, unless that information is hidden from ps. And can sometimes provide additional help in identifying processes that may be interfering with getting online.

sdjf

BarrySamuels

Apr 18 2007, 12:42 PM

QUOTE(sdjf @ Apr 16 2007, 03:12 AM)

Hey, I just found instructions for how to enable the log for dhcpcd in, of all places, the man page!

I have only just realised something ( I am slow sometimes ) I can't enable logging for my dhcp server 'cause I'm using the one in my router.

QUOTE

Your ls of ps looks perfect...when you can, give me an md5sum...I'm wondering if we have the same file...my ls looks similar:

-rwxrwxr-x 1 root root 89312 Apr 12 17:00 /bin/ps

602103a27e13b84221a56532d27f8ecb ps

sdjf

Apr 18 2007, 02:02 PM

Oh dear. I do not understand. The one in your router? Does that mean that dhcpcd is not on your zaurus? Then how come it shows in the ps listing on the Z? [EDIT: it's logging on the dhcpcd client side I am talking about, not the server side, although I suppose that could be helpful, but isn't necessary.]

I actually started another topic yesterday specifically asking for info on dhcpcd logs:

Maybe we should move the log issue to that thread. I did ask for some more info there that'd be helpful.

There's gotta be some way to log what's happening with dhcpcd and the router or whatever, or how can anybody do any debugging? Yikes!!

Also, your ps is obviously the same as mine...and Antikx tried it out on his C1000 with a pdaXii rom and it seemed okay, so it looks like it's pretty generic...thank you.

sdjf

EDIT: Here's another thought. Can you post your file that qtopia uses as a cfg file for your connection (of course garbling any sensitive or passwd info)? I think it was:

/home/root/Applications/Network/modules/WLAN0.conf

sdjf

Apr 30 2007, 07:32 AM

Barry,One of the reasons I am so insistent about a dhcpcd log is that, at least for pppd logs, the presence or absence of that log is an important clue about whether it is appropriate to use qstop http://www.sdjf.esmartdesign.com/scripts/qstop.html and cardctl commands. If your kismet script checks that, and there is no log even though dhcpcd is not supposed to be running, you're gonna know something is definitely wrong, that some process has erased the log without actually running. At least that's my hunch.