sssemil / android-wifi-tether

Automatically exported from code.google.com/p/android-wifi-tether
1 stars 0 forks source link

Wifitethering works only once #691

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Which device (manufacturer, type)?
Nexus One

Which firmware is installed?
Cyanogenmod-6-11072010-NIGHTLY-N1

What version of wireless tether are you using?
2.0.5-pre12

What steps will reproduce the problem?
1. Boot phone
2. Start tethering
3. Stop tethering
4. Re-start tethering and an error is shown, tethering seems to start but does 
not work.

The problem seems to be about the network interface going missing after 
stopping it once. I saw this log when I tried to start tethering manually:

/data/data/android.tether/bin/tether start 1
about to run: [/data/data/android.tether/bin/ultra_bcm_config eth0 softap_gog XX
XXX wpa2-psk XXXXXXXXXXXXXXXXXXX 6]
ASCII_CMD=                      ASCII_CMD=AP_CFG,SSID=XXXXX,SEC=wpa2-psk,KEY=XXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,CHANNEL=6,PREAMBLE
=0,MAX_SCB=8,ENDASCII_CMD=                      ASCII_CMD=AP_BSS_START,SSID=YYYY
Y,SEC=wpa2-psk,KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX,CHANNEL=6,PREAMBLE=0,MAX_SCB=8,ENDabout to run: [/data/data/android.tether/b
in/ifconfig eth0 down]
about to run: [/data/data/android.tether/bin/ifconfig wl0.1 down]
error: SIOCGIFFLAGS (No such device)
about to run: [/data/data/android.tether/bin/ifconfig wl0.1 192.168.2.254 netmas
k 255.255.255.0]
error: SIOCSIFADDR (No such device)
about to run: [/data/data/android.tether/bin/iptables -N wireless-tether]
about to run: [/data/data/android.tether/bin/iptables -F wireless-tether]
about to run: [/data/data/android.tether/bin/iptables -t nat -F PREROUTING]
about to run: [/data/data/android.tether/bin/iptables -t nat -F POSTROUTING]
about to run: [/data/data/android.tether/bin/iptables -t nat -F]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -m stat
e --state ESTABLISHED,RELATED -j ACCEPT]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -s 192.
168.2.0/24 -j ACCEPT]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -p 47 -
j ACCEPT]
about to run: [/data/data/android.tether/bin/iptables -A wireless-tether -j DROP
]
about to run: [/data/data/android.tether/bin/iptables -A FORWARD -j wireless-tet
her]
about to run: [/data/data/android.tether/bin/iptables -t nat -I POSTROUTING -s 1
92.168.2.0/24 -j MASQUERADE]
about to run: [/data/data/android.tether/bin/dnsmasq -i wl0.1 --resolv-file=/dat
a/data/android.tether/conf/resolv.conf --conf-file=/data/data/android.tether/con
f/dnsmasq.conf]
about to run: [/data/data/android.tether/bin/iptables -t nat -I PREROUTING -s 19
script result was []
2.168.2.0/24 -j DROP]

Original issue reported on code.google.com by volkank...@gmail.com on 8 Nov 2010 at 12:41

Attachments:

GoogleCodeExporter commented 9 years ago
By the way, 

I have tried many nightlies of Cyanogenmod as well as 6.1-RC1 and many radios. 
That doesn't seem to solve anything.

Original comment by volkank...@gmail.com on 8 Nov 2010 at 12:42

GoogleCodeExporter commented 9 years ago
First. My test-hardware ALWAYS runs stock-firmwares! And the app runs perfectly 
fine on nexusone with android 2.2.1 (stock).

The only thing what could cause such an issue is that a wifi-driver was chosen 
by cyanogenmod which does NOT create a wl0.1 interface for tethering.

Let me know the output of:
1) start tethering from cmd-line:
adb shell
cd /data/data/android.tether/bin
./tether start 1
2) run the iwconfig-cmd and post the output here:
/data/data/android.tether/bin/iwconfig

Original comment by harald....@gmail.com on 8 Nov 2010 at 1:25

GoogleCodeExporter commented 9 years ago
Hi harald.mue,

It may be true. It has been a long time since I used the stock firmware. 
1) I already pasted the output of that command in the problem definition.
2) The output of iwconfig is below (While using official tethering):

# /data/data/android.tether/bin/iwconfig
/data/data/android.tether/bin/iwconfig
lo        no wireless extensions.

dummy0    no wireless extensions.

ifb0      no wireless extensions.

ifb1      no wireless extensions.

rmnet0    no wireless extensions.

rmnet1    no wireless extensions.

rmnet2    no wireless extensions.

usb0      no wireless extensions.

eth0      IEEE 802.11-DS  ESSID:""  Nickname:""
          Mode:Master  Frequency:2.437 GHz  Access Point: Not-Associated
          Bit Rate:54 Mb/s   Tx-Power:32 dBm
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Link Quality=5/5  Signal level=0 dBm  Noise level=0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

wl0.1     IEEE 802.11-DS  ESSID:"XXXXX"  Nickname:""
          Mode:Master  Frequency:2.437 GHz  Access Point: 02:1A:11:FA:7F:0A
          Bit Rate=54 Mb/s   Tx-Power:32 dBm
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off

3) iwconfig without official tethering
# /data/data/android.tether/bin/iwconfig
/data/data/android.tether/bin/iwconfig
lo        no wireless extensions.

dummy0    no wireless extensions.

ifb0      no wireless extensions.

ifb1      no wireless extensions.

rmnet0    no wireless extensions.

rmnet1    no wireless extensions.

rmnet2    no wireless extensions.

usb0      no wireless extensions.

Original comment by volkank...@gmail.com on 8 Nov 2010 at 1:32

GoogleCodeExporter commented 9 years ago
So, what is the output of iwconfig after you have started tethering from 
cmd-line?

Original comment by harald....@gmail.com on 8 Nov 2010 at 1:42

GoogleCodeExporter commented 9 years ago
Oh. Ah. So it does work on the first start and fails on the second?

Do you see an error (printed on console) when stopping?
cd /data/data/android.tether/bin
./tether stop 1

Original comment by harald....@gmail.com on 8 Nov 2010 at 1:57

GoogleCodeExporter commented 9 years ago
Hi harald.mue,

No I don't see any errors. Let me attach 4 files.

1- First start, no problems: wifi1.txt
2- Stop, no problems: wifi2.txt
3- Second start and iwconfig output: wifi3.txt

Original comment by volkank...@gmail.com on 8 Nov 2010 at 2:09

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry what i meant was let me attach 3 files :)

By the way, upon recommendation of one of my friends with the same ROM, i tried 
wifi-tether 2.0.2 and it works nicely (and with 802.11n by the way) but it is 
ad-hoc mode and WEP only. So I don't really want to use that.

Original comment by volkank...@gmail.com on 8 Nov 2010 at 2:11

GoogleCodeExporter commented 9 years ago
Ok. I think I know what's going wrong here. Will try to fix that - stay tuned!

Original comment by harald....@gmail.com on 10 Jan 2011 at 3:43

GoogleCodeExporter commented 9 years ago
Very nice :-) Waiting for it.. 

Original comment by volkank...@gmail.com on 11 Jan 2011 at 4:46

GoogleCodeExporter commented 9 years ago
I've already fixed that ... but I need to clean-up my code a bit (looks 
awfulafter testing).

Original comment by harald....@gmail.com on 13 Jan 2011 at 8:51