![]() ![]() |
Oct 26 2006, 06:43 AM
Post
#1
|
|
|
Group: Members Posts: 103 Joined: 16-October 05 From: Maldon, Essex, England Member No.: 8,325 |
C3100 with standard Sharp ROM
Can someone give me the required commands to start a specific wireless network connection from the command line please? I want to set up a script to do it. |
|
|
|
Oct 26 2006, 08:01 AM
Post
#2
|
|
![]() Group: Members Posts: 1,002 Joined: 28-April 05 From: Germany Member No.: 7,027 |
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()" A script for establishing a network connection and chacking for availability of Internet could look that way (I have used that a lot for mutt etc.): CODE #! /bin/bash
TRY_IP="130.149.4.20" echo Connecting to Internet... qcop "QPE/Network" "connectRequest()" > /dev/null 2>&1 ping -c 1 "$TRY_IP" > /dev/null 2>&1 while [ $? -ne 0 ] do sleep 5 echo waiting for network... ping -c 1 "$TRY_IP" > /dev/null 2>&1 done |
|
|
|
Oct 27 2006, 05:07 AM
Post
#3
|
|
|
Group: Members Posts: 103 Joined: 16-October 05 From: Maldon, Essex, England Member No.: 8,325 |
QUOTE(daniel3000 @ Oct 26 2006, 04:01 PM) 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? |
|
|
|
Oct 27 2006, 09:53 PM
Post
#4
|
|
|
Group: Members Posts: 1,213 Joined: 9-June 05 From: Gobi Desert, Mongolia Member No.: 7,306 |
try
qcop QPE/Network connectRequest() brings up the network applet connection select screen. |
|
|
|
Nov 16 2006, 08:40 AM
Post
#5
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
this has worked for me, from memory...
cardctl scheme qpewlan0 cardctl reset |
|
|
|
Nov 20 2006, 06:26 PM
Post
#6
|
|
|
Group: Members Posts: 242 Joined: 31-March 04 Member No.: 2,592 |
QUOTE(bam @ Oct 27 2006, 09:53 PM) 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 entry Display size = 480x640 Is there something else that needs to be loaded before issuing qcop commands? TIA, Craig... |
|
|
|
Dec 5 2006, 04:28 PM
Post
#7
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
QUOTE(speculatrix @ Nov 16 2006, 05:40 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. |
|
|
|
Dec 5 2006, 05:54 PM
Post
#8
|
|
|
Group: Members Posts: 409 Joined: 7-November 03 Member No.: 811 |
|
|
|
|
Dec 6 2006, 04:40 AM
Post
#9
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
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 |
|
|
|
Mar 11 2007, 06:51 AM
Post
#10
|
|
|
Group: Members Posts: 454 Joined: 17-November 05 Member No.: 8,551 |
To start my dialup connection from the command line, and have qtopia know it is there, I enter:
qcop QPE/Network 'start(QString,QString)' "/home/root/Applications/Network/modules/DialUp30.conf" "" 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 |
|
|
|
Mar 12 2007, 04:32 AM
Post
#11
|
|
|
Group: Members Posts: 103 Joined: 16-October 05 From: Maldon, Essex, England Member No.: 8,325 |
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) |
|
|
|
Mar 12 2007, 04:47 AM
Post
#12
|
|
|
Group: Members Posts: 454 Joined: 17-November 05 Member No.: 8,551 |
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 |
|
|
|
Mar 22 2007, 02:51 PM
Post
#13
|
|
|
Group: Members Posts: 454 Joined: 17-November 05 Member No.: 8,551 |
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 |
|
|
|
Mar 24 2007, 01:51 PM
Post
#14
|
|
|
Group: Members Posts: 103 Joined: 16-October 05 From: Maldon, Essex, England Member No.: 8,325 |
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. |
|
|
|
Mar 24 2007, 11:50 PM
Post
#15
|
|
|
Group: Members Posts: 454 Joined: 17-November 05 Member No.: 8,551 |
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 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 03:30 AM |