webOS Nation Forums >  webOS apps and software >  webOS development > Possible tether work-around
Possible tether work-around

  Reply
 
LinkBack Thread Tools Display Modes
Old 06/26/2009, 05:11 PM   #161 (permalink)
Member
 
Join Date: Jun 2009
Posts: 2
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by fish199902 View Post
Sure, I'll try to be as accurate as I can for windows, however my only windows install is in a virtual machine. ...
I rooted my Pre, set up the SSH and DropBear, and set up the Putty tunnel as shown above, but it only allows my laptop to connect through the Pre's WiFi connection, not the Pre's EVDO connection.

I can see that the EVDO device in the Pre is ppp0, and the WiFi is eth0, but the SSH tunnel only goes through the eth0 (WiFi). Using the SSH terminal on the Pre, if I do an "/sbin/ifconfig," I see the eth0 device come and go as I enable and disable the Pre's WiFi, and with it, the ability for my tethered laptop to see the Internet.

Although I'm a long term user of Linux, this problem is beyond my current knowledge. If I don't get an answer from someone here, I'll continue looking into it as I have time. Hopefully, someone knows more about this than me, and can find a solution faster.

I looked at DropBear for configuration instructions, but there's no documentation, and the code is extremely complicated. However, I suspect that the solution is in changing the iptables in some way, but that's just a guess on my part.

Anybody got any ideas about this?
Dr. Mike is offline   Reply With Quote
Old 06/26/2009, 06:58 PM   #162 (permalink)
Member
 
prephil's Avatar
 
Join Date: Jun 2009
Location: Worcester, Ma
Posts: 57
Likes Received: 0
Thanks: 3
Thanked 2 Times in 2 Posts
Default

Going through Sprint, here's the kicker...you have to have "simply everything plan" then they charge $40 more to tether
prephil is offline   Reply With Quote
Old 06/26/2009, 07:48 PM   #163 (permalink)
Member
 
Join Date: Feb 2005
Posts: 197
Likes Received: 0
Thanks: 3
Thanked 1 Time in 1 Post
Default

Having the same code 10 device cannot start problem. Uninstalled/resinstalled/enabled/disabled. I've tried disabling other network adapters incase there was a conflict. Nothing I've tried has changed it.

Any ideas?


Quote:
Originally Posted by jack87 View Post
i to am getting the same thing on winxp pro 32bit

Update:

Third time is a charm i guess... i tried three times and it started working after the third.. dont know why

Update 2:
So i tried connecting to the pre using putty and ssh with no luck. it is showing that i am connected to the usb network. i did configure the tcp ip settings. funny thing is it shows the network twice and same name very odd. but when i configured the tcp ip for one it automatically put the same settings in the other

Update 2.1:

Ok silly me i was trying to connect to putty using my computer's ip haha (192.168.0.203) as i fixed it to 192.168.0.202 and ran the tether.sh file after connecting via ssh it started working like a charm... for the dns i used the two following which were recommended for my sprint ip.

204.74.97.104
209.213.196.218

Thanks again emkman you rock....... as for the mac 10.4 still no luck any ideas of what i should try?
beavis10 is offline   Reply With Quote
Old 06/26/2009, 07:59 PM   #164 (permalink)
Member

 
Join Date: Apr 2003
Location: Boston-area
Posts: 6,973
Likes Received: 116
Thanks: 418
Thanked 1,252 Times in 710 Posts
Default

I don't know if it can be linked to here or not, but I've got the start of something modified from the flashlight application, using the org.webosinternals.shell program to run the scripts. (That'll work better when they apparently update the shell program to start automatically on boot.)

The problem is, I can't actually get the tethering to work consistently. It turns on wifi in ad-hoc mode, runs the other commands to turn tethering on, and then when I connect, it tells me no Internet access (maybe an issue with assigning an IP address through DHCP or something? I don't know.)
jhoff80 is offline   Reply With Quote
Old 06/26/2009, 08:36 PM   #165 (permalink)
Member
 
SirWill's Avatar
 
Join Date: Jun 2009
Location: Everett, WA
Posts: 441
Likes Received: 0
Thanks: 63
Thanked 48 Times in 41 Posts
Default

Well it would be certainly nice to have an app that would turn on tethering and turn it off using the tether.sh script (Don't care about adhoc wifi) I'm connected right now via usb and am getting good speed.

Download Speed: 896 kbps (112 KB/sec transfer rate)
Upload Speed: 229 kbps (28.6 KB/sec transfer rate)

Very cool. I had BT working before with a putty ssh session tunnel, but I like this method better. usbnet man.

Oh yeah, I'm running Vista Ultimate 32bit

Last edited by SirWill; 06/26/2009 at 08:37 PM. Reason: listing system...
SirWill is offline   Reply With Quote
Old 06/26/2009, 09:03 PM   #166 (permalink)
Member

 
Join Date: Apr 2003
Location: Boston-area
Posts: 6,973
Likes Received: 116
Thanks: 418
Thanked 1,252 Times in 710 Posts
Default

Ignore this post, updated version here: http://forums.precentral.net/web-os-...st1715453.html

Last edited by jhoff80; 06/28/2009 at 12:34 AM.
jhoff80 is offline   Reply With Quote
Old 06/26/2009, 09:21 PM   #167 (permalink)
Member
 
Join Date: Jun 2009
Location: Seattle
Posts: 251
Likes Received: 0
Thanks: 41
Thanked 16 Times in 14 Posts
Default

Quote:
Originally Posted by SirWill View Post
Well it would be certainly nice to have an app that would turn on tethering and turn it off using the tether.sh script (Don't care about adhoc wifi) I'm connected right now via usb and am getting good speed.

Download Speed: 896 kbps (112 KB/sec transfer rate)
Upload Speed: 229 kbps (28.6 KB/sec transfer rate)

Very cool. I had BT working before with a putty ssh session tunnel, but I like this method better. usbnet man.

Oh yeah, I'm running Vista Ultimate 32bit
Too bad usbnet does not work on OS X 10.5
wprater is offline   Reply With Quote
Old 06/26/2009, 09:43 PM   #168 (permalink)
Member

 
Join Date: Apr 2003
Location: Boston-area
Posts: 6,973
Likes Received: 116
Thanks: 418
Thanked 1,252 Times in 710 Posts
Default

Ignore this post, updated version here: http://forums.precentral.net/web-os-...st1715453.html

Last edited by jhoff80; 06/28/2009 at 12:34 AM.
jhoff80 is offline   Reply With Quote
Thanked By: 1lnxraider
Old 06/26/2009, 10:37 PM   #169 (permalink)
Member
 
jack87's Avatar
 
Join Date: Jun 2009
Location: Salt Lake City, Ut
Posts: 1,225
Likes Received: 9
Thanks: 78
Thanked 179 Times in 128 Posts
Default

Quote:
Originally Posted by beavis10 View Post
Having the same code 10 device cannot start problem. Uninstalled/resinstalled/enabled/disabled. I've tried disabling other network adapters incase there was a conflict. Nothing I've tried has changed it.

Any ideas?
You know when you click on have disk to instal driver you get two choices when you do it.. Well do it again you will see one choice click on have disk pick the inf again and now you will see the two choices again pick the other one you didn't pick the first time. This might ask you to find a dll or sys file or two google for them download em and browse for them and after they are selected finish installing the driver. Hen you are done might work might not if it does you are golden if it doesn't reinstal it one more time this time pick the driver you picked the first time and you should be all set.
jack87 is offline   Reply With Quote
Old 06/27/2009, 12:46 AM   #170 (permalink)
Member
 
mu7efcer's Avatar
 
Join Date: Mar 2008
Posts: 921
Likes Received: 7
Thanks: 169
Thanked 229 Times in 141 Posts
Default

Quote:
Originally Posted by jhoff80 View Post
I combined the two scripts into one so that it would be easier, and so it's running the following
The reason that I had the scripts separate was that I didn't assume that everyone would want to tether via wifi. Some may prefer tethering via USB while others prefer it over bluetooth (which is hard to imagine, but still). NO accounting for taste.
Quote:
Any suggestions?
I have not experienced the problem that you have. My connection stays up for hours at a time. But I'm also not doing DHCP on the Pre. I'm configuring a static address on the PC side. Maybe eliminate a variable and configure it static and see if that works first. And if it does, then you might surmise that the problem is related to DHCP...?
mu7efcer is offline   Reply With Quote
Old 06/27/2009, 01:11 AM   #171 (permalink)
Member

 
Join Date: Apr 2003
Location: Boston-area
Posts: 6,973
Likes Received: 116
Thanks: 418
Thanked 1,252 Times in 710 Posts
Default

Quote:
Originally Posted by mu7efcer View Post
The reason that I had the scripts separate was that I didn't assume that everyone would want to tether via wifi. Some may prefer tethering via USB while others prefer it over bluetooth (which is hard to imagine, but still). NO accounting for taste.

I have not experienced the problem that you have. My connection stays up for hours at a time. But I'm also not doing DHCP on the Pre. I'm configuring a static address on the PC side. Maybe eliminate a variable and configure it static and see if that works first. And if it does, then you might surmise that the problem is related to DHCP...?
Yeah, I only combined them after I was having issues, to make it easier to figure out if the app was doing things properly, I can just as easily do it resplit (but then someone would have to code a second button in.)

Edit: Static IP solved it, the app switches it on perfectly it seems. Turning it off there's a slight issue because the script never reinstalls the wifidriver when it's done, so you can't connect to a normal wifi network afterwards, so I'd add wifidriver -i again at the end of the off section.

Last edited by jhoff80; 06/27/2009 at 01:28 AM.
jhoff80 is offline   Reply With Quote
Old 06/27/2009, 08:27 PM   #172 (permalink)
Member
 
mu7efcer's Avatar
 
Join Date: Mar 2008
Posts: 921
Likes Received: 7
Thanks: 169
Thanked 229 Times in 141 Posts
Default

Quote:
Originally Posted by jhoff80 View Post
This is not fully working yet, but... it definitely turns on the Pre Wifi as an AdHoc connection with the PreNet SSID
It isn't working for me at all. It's not turning the AdHoc connection on nor the NAT. I really don't know why.

So far calling my scripts from the webosinternals command tool works well.
Quote:
Originally Posted by jhoff80 View Post
Turning it off there's a slight issue because the script never reinstalls the wifidriver when it's done, so you can't connect to a normal wifi network afterwards, so I'd add wifidriver -i again at the end of the off section.
The script should not do the -i at the end. When it's done it should leave the phone w/out the wifidriver installed. The normal turning on of wifi installs the driver and configures it. $0.02
mu7efcer is offline   Reply With Quote
Old 06/27/2009, 09:22 PM   #173 (permalink)
Member
 
mu7efcer's Avatar
 
Join Date: Mar 2008
Posts: 921
Likes Received: 7
Thanks: 169
Thanked 229 Times in 141 Posts
Default

Quote:
Originally Posted by mu7efcer View Post
It isn't working for me at all. It's not turning the AdHoc connection on nor the NAT. I really don't know why.
I figured out the problem. When I unzipped the file, the tether.sh script had '^M' at the end of each line. This caused an error trying to start the script. This was confirmed when I tried to run the tether.sh script by hand and it caused an error. WebOS doesn't appear to have a dos2unix command so I had to manually remove them all. Which fixed the problem.

Now that it works, it's a lot easier to get into tethering mode. There are a couple of other sliders that I'd like to add to it and call it "hacks"
  1. Turning on / off cpu scaling
  2. Turning on / off smartreflex
Also, I think that I'll add a "status" command to tether.sh to report back whether or not it thinks it's already tethering, then start the slider in the appropriate position on startup. Same for the above new options.
mu7efcer is offline   Reply With Quote
Old 06/27/2009, 09:32 PM   #174 (permalink)
Member

 
Join Date: Apr 2003
Location: Boston-area
Posts: 6,973
Likes Received: 116
Thanks: 418
Thanked 1,252 Times in 710 Posts
Default

Guide to using this:

First of all, have a rooted Pre.

1.) Download the ipk here: Tree for applications in WebOS Internals - Gitorious and use ipkg-opt to install it to your Pre. Note that you cannot install this without rooting, it's not a signed ipk.

2.) Download my application in this post, put it in /var/usr/palm/applications/ (NOT /usr/palm/applications/ ... third party apps go to /var/usr/, built in apps in /usr/ ) and reboot, and you'll see it in your launcher.

3.) Use the app to turn on tethering.

4.) Set up the client PC as static IP. Choose any IP in the 192.168.1.* range. Set subnet mask to 255.255.255.0 and gateway to 192.168.1.1. For DNS servers, I suggest OpenDNS: 208.67.222.222 and 208.67.220.220.

5.) Tether away! (But don't go too crazy or Sprint might see something fishy.)

Also, afterwards you might want to check out this hack, because when the screen goes dim, I believe the Wifi will still turn off, so if you don't plan on charging the Pre while tethering, definitely do this: pre dev wiki: Changing the "Turn off after X" time

Finally, if you generally keep Wifi off, you'll want to modify tether.sh in /var/usr/palm/applications/com.app.tether/app/scripts/ a little bit. Basically, you'll want to take wifidriver -i out of the last line of the "off" section. Seeing as I generally have Wifi on no matter what, for me it works best at the end to reinitialize the Wifi to connect to a standard network.
Attached Files
File Type: zip com.app.tether.zip (12.2 KB, 29 views) Email Attachment

Last edited by jhoff80; 07/01/2009 at 01:05 PM.
jhoff80 is offline   Reply With Quote
Old 06/27/2009, 10:49 PM   #175 (permalink)
Member
 
Join Date: Jun 2009
Location: Tampa, FL
Posts: 18
Likes Received: 0
Thanks: 4
Thanked 1 Time in 1 Post
Default

Removed as I didn't see jhoffs right above mine and no sense in keeping two apps around for the same thing.

Last edited by microbolt; 06/28/2009 at 12:45 AM. Reason: Removed this app as I didn't see jhoff's right above mine
microbolt is offline   Reply With Quote
Old 06/27/2009, 10:51 PM   #176 (permalink)
Member
 
jack87's Avatar
 
Join Date: Jun 2009
Location: Salt Lake City, Ut
Posts: 1,225
Likes Received: 9
Thanks: 78
Thanked 179 Times in 128 Posts
Default

i dont understand.. what does that app do and how do i install it? i have tethering with usbnet set up on my computer now will it conflict. should i change the name of my tether.sh or does this app use a diffrent tether.sh file in its own directory. is it supposed to turn the pre into a wifi access point?

update:
so i got it installed but i am not to sure what its supposed to do. Do i need to make my pre broadcast adhoc wifi first. before this will work?
jack87 is offline   Reply With Quote
Old 06/27/2009, 10:56 PM   #177 (permalink)
Member
 
Join Date: Jun 2009
Location: Tampa, FL
Posts: 18
Likes Received: 0
Thanks: 4
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by jack87 View Post
i dont understand.. what does that app do and how do i install it? i have tethering with usbnet set up on my computer now will it conflict. should i change the name of my tether.sh or does this app use a diffrent tether.sh file in its own directory. is it supposed to turn the pre into a wifi access point?
Its just an gui to access the tether.sh script without having to ssh into the phone. It has its own tether.sh inside its directory so it won't conflict with your setup. Just won't want to enable them both at same time. Its identical to the tether.sh posted earlier. You can see it in the scripts folder of the app.
microbolt is offline   Reply With Quote
Old 06/27/2009, 11:00 PM   #178 (permalink)
Member
 
Join Date: Jun 2009
Location: Tampa, FL
Posts: 18
Likes Received: 0
Thanks: 4
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by jack87 View Post
update:
so i got it installed but i am not to sure what its supposed to do. Do i need to make my pre broadcast adhoc wifi first. before this will work?
I didn't put the adhoc wifi code in there as some users will be doing it over usbnet. The script is located at /usr/palm/applications/com.microbolt.app.tether/app/scripts. Just overwrite the tether.sh with the script you want to use and it will execute it instead

If you wanted it to enable Adhoc wifi as well you could use jhoff80's modified script:

Quote:
#!/bin/sh

case $1 in
"on" )
/usr/sbin/wifidriver -i
iwconfig eth0 mode Ad-Hoc essid PreNet
ifconfig eth0 192.168.1.1 up
echo '**** Stopping PmConnectionManager'
stop PmConnectionManager
echo '**** Enabling IP Forwarding'
echo 1 > /proc/sys/net/ipv4/ip_forward
echo '**** Enabling NAT'
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo '**** Tethering ON'
;;
"off" )
echo '**** Disabling NAT'
iptables -t nat -D POSTROUTING -o ppp0 -j MASQUERADE
echo '**** Disabling IP Forwarding'
echo 0 > /proc/sys/net/ipv4/ip_forward
echo '**** Restarting PmConnectionManager'
start PmConnectionManager
echo '**** Tethering OFF'
/usr/sbin/wifidriver -u
;;
* )
echo "$1 unknown argument. Argument must be 'on' or 'off'"
;;
esac
microbolt is offline   Reply With Quote
Old 06/27/2009, 11:05 PM   #179 (permalink)
Member
 
jack87's Avatar
 
Join Date: Jun 2009
Location: Salt Lake City, Ut
Posts: 1,225
Likes Received: 9
Thanks: 78
Thanked 179 Times in 128 Posts
Default

Quote:
Originally Posted by microbolt View Post
I didn't put the adhoc wifi code in there as some users will be doing it over usbnet. The script is located at /usr/palm/applications/com.microbolt.app.tether/app/scripts. Just overwrite the tether.sh with the script you want to use and it will execute it instead

If you wanted it to enable Adhoc wifi as well you could use jhoff80's modified script:
awesome
jack87 is offline   Reply With Quote
Old 06/27/2009, 11:15 PM   #180 (permalink)
Member
 
jack87's Avatar
 
Join Date: Jun 2009
Location: Salt Lake City, Ut
Posts: 1,225
Likes Received: 9
Thanks: 78
Thanked 179 Times in 128 Posts
Default

ok so i put my own script in the directory but no luck. the script i used has the fallowing code in it... also the script you had by default still didnt work (i am using usbnet)


#---------------- begin code --------------------------

stop PmConnectionManager

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

read -p "Press Enter key to stop tether"

start PmConnectionManager

#---------------- end code --------------------------

but looking at your code it should work flawlessly with the same stuff in the code i had i dont understand maybe its not actually running the script. how would i know?

update:
i also tried your script with jhoff80 app still no luck. doesnt seem to want to work with usbnet. i dont know if its actually running the script or not doest seem like its forwarding the ip

Last edited by jack87; 06/27/2009 at 11:29 PM.
jack87 is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0