MEAM-Ware / android-wifi-tether

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

Wireless Tethering for HTC EVO #362

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which device (manufacturer, type)?
HTC Supersonic (HTC EVO)

Which firmware is installed?
Rooted 2.1

What version of wireless tether are you using?
None

Please provide any additional information below.

Thought I would start off this thread now that the EVO is rooted. I have
one already ready to test if needed. This will be fantastic for this phone,
just have to work out how to make it work with 4G.

Original issue reported on code.google.com by Love2Shred on 3 Jun 2010 at 1:39

GoogleCodeExporter commented 9 years ago
Harald, I think you have it a little backwards.

From what I can see the problem is specifically that the device doesn't want to 
give 
up its ARP address. Running wireshark on my laptop I can watch my laptop 
screaming at 
the top of its lungs at the poor device with ARP broadcast packets, but the 
device 
never properly responds.

This means that you have to execute the arp commands on the PC, not the device 
as you 
mentioned earlier (unless we're just using different terminology, in which case 
my 
bad!)

Furthermore the ping trick doesn't really work for me. Watching the wireshark 
traffic 
I can see the first ICMP request and response, then within a ms my Windows 7 
laptop 
sends out the arp packet requesting identification. It will not respond to the 
following 3 pings (I'm guessing this is a security thing to prevent ARP-based 
attacks).

So the question on my mind is as follows: Why is it that the Android phone is 
completely ignoring ARP requests?

Original comment by andrew.r...@gmail.com on 5 Jun 2010 at 2:36

GoogleCodeExporter commented 9 years ago
Harald,

After looking for the ARP_ON flag and other bugs I discovered bug 330 for the 
desire 
and realized that we're both traveling down the same rabbit hole. 

I do not believe ip routing tables to be the source of this issue, or anything 
on the 
surface of the OS. All configuration seems kosher, so I'm off to look deeper. 

Original comment by andrew.r...@gmail.com on 5 Jun 2010 at 2:56

GoogleCodeExporter commented 9 years ago
As a final note before I leave for the day, looking in /etc/firmware shows me 
two 
different versions of the bcm4329 firmware.

One is called fw_bcm4329.bin, and one is called fm_bcm4329_ap.bin. Does the ap 
stand 
for access point possibly?

When starting the sprint mobile hotspot app on my EVO I notice the following:
- The app somehow tells the 3G driver/process/we to use a different vision 
username 
and password (this results in a "bad user/pass" when you don't have the service
- The app starts up the WiFi point in infrastructure mode.
- My laptop has no problems when requesting ARP identification data.

I think this is starting to look like a deliberate modification. You mentioned 
you 
could load a different wifi firmware on demand. Can you load up the ap version?

Original comment by andrew.r...@gmail.com on 5 Jun 2010 at 3:22

GoogleCodeExporter commented 9 years ago
FYI - the "Desire workaround" works on my Evo.  Definitely not handing out IPs 
via DHCP though.  Using the 
Unrevoked root on 2.1 FW.

Original comment by fileman...@gmail.com on 6 Jun 2010 at 3:30

GoogleCodeExporter commented 9 years ago
and what exactly is the workaround bro? Im using the Unrevoked root as well..

Original comment by phodge...@gmail.com on 6 Jun 2010 at 4:32

GoogleCodeExporter commented 9 years ago
And for all working on this ..its greatly appreciated and having wifi work is
awesome..coming from using Palm Pre with wifi tether  installed..this phone 
blows my
Pre away...just hoping to get wifi tether working...thanks!

Original comment by phodge...@gmail.com on 6 Jun 2010 at 4:34

GoogleCodeExporter commented 9 years ago
Check comment 28 from harald.mue.  It's a bit of a pain right now to have to 
set a static client IP and then have to 
ping it, but hopefully they can fix that eventually...

Original comment by fileman...@gmail.com on 6 Jun 2010 at 4:40

GoogleCodeExporter commented 9 years ago
ok..thank you..i will try it out!

Original comment by phodge...@gmail.com on 6 Jun 2010 at 4:43

GoogleCodeExporter commented 9 years ago
@andrew: yep. with the latest experimental version of the app it is possible to 
load 
different wifi firmwares. regarding the evo, desire, nexusone (which all come 
with 
the same wifi-chip built-in) you only have to put the "alternative" firmware on 
the 
sdcard in a directory named "android.tether" (the directory needs to be created 
first).

if you want to load the _ap.bin you can now simply put that firmware in the 
directory.
Via adb do the following:
adb shell
mkdir /sdcard/android.tether
cat /system/etc/firmware/fw_bcm4329_ap.bin > 
/sdcard/android.tether/fw_bcm4329.bin

Now, if you start you should see something like "Loading bcm4329.ko module 
(fw_bcm4329.bin from /sdcard/android.tether) - see attached screenshot.

I don't have a desire or evo ... and that's the reason I can't help more to 
find a 
solution for this issue. :(

Original comment by harald....@gmail.com on 6 Jun 2010 at 5:22

Attachments:

GoogleCodeExporter commented 9 years ago
Ah. And could somebody please pull the kernel-config from a evo?
adb pull /proc/config.gz .
and upload it here?

Thanks.

Original comment by harald....@gmail.com on 6 Jun 2010 at 5:28

GoogleCodeExporter commented 9 years ago
Harald, I've been plugging away at the issue. I saw the installation scripts in 
edify 
and inferred this.

I was just manually loading them using insmod and rmmod to ensure. Here are my 
notes 
on this issue:

Testing if kernel module accurately loads firmware:

Procedure
1. Run rmmod bcm4329 to unload current kernel driver
2. Run insmod /system/lib/modules/bcm4329.ko 
firmware_path=/etc/firmware/fw_dcm4329.bin
3. Start Wifi_tether utility

Observations:
1. Running with no parameters -> standard behavior
2. Running with correct firmware specified -> standard behavior
3. Running with AP firmware specified -> standard behavior
4. Running with a nonsense firmware file -> Error setting up connection
5. Running with old firmware from Cyanogen ROM -> standard behavior

Conclusions:
The firmware_path parameter does work correctly. I confirmed this by looking 
through 
the bravo source code for the bcm module and finding the section that copies 
the 
input string into the firmware path. 

Tests using standard conditions:
For some reason when setting up a ping on the Android device my laptop doesn't 
like 
to save it's ARP data into it's routing table. Watching the traffic I can see 
that 
while the ping from the device to my laptop is running my laptop will 
constantly ask 
for it to respond to an ARP request. It will only reply to one and every 
hundred or 
so of these requests. When it does reply the ping will work for 1-2s until the 
laptop 
asks again for it to identify itself, in which case it is mostly silent.

This is very intriguing to me, the ARP responses I do see come from the device 
itself, meaning the device is capable of producing an ARP response! It just 
chooses 
not to 99% of the time. 

Reading through the bcm4329 driver file I've noticed that they've commented out 
the 
section that allows for ARP registration to be "off-loaded". Reading the spec 
sheet 
on the bcm chip it looks to try to do as much network IO onboard as possible to 
cut 
back on UART bandwidth to the ARM processor and to allow for more sleep time 
for the 
main CPU. This logically implies that they would have the IC manage the ARP 
table. 
HTC has disabled this functionality it looks like, leaving the OS in charge. 

Interestingly enough I see a ton of functions in the broadcom driver that 
mention "AP 
mode".  This could be a vector to enabling infrastructure mode, although I 
don’t know 
how one would call those functions. Kernel modules are a little over my head.

-----

Using TCP DUMP:

I watch the capture from wireshark on my laptop and TCP dump on the Android 
device. 
The following behavior has been observed:

1. When pinging my laptop the device will occasionally receive the ARP packet 
and 
reply to it, giving my laptop a temporary ARP table entry, it fails when the 
laptop 
requests it again.

2. When not pinging all ARP requests are ignored.

3. If the device ignores the ARP request it doesn't even show up in TCPDUMP. 
Could 
this be part of the issue? I think tcpdump hooks pretty deep into the kernel 
and 
should show all raw packet traffic. Is some sort of sleep mode keeping the 
device 
from receiving the packets? Maybe it's some sort of promiscuous mode that needs 
to be 
enabled? If the device doesn't think it needs to respond to the packet (it is a 
broadcast packet) then it will just ignore it. Maybe the ping command tells the 
device that it is undergoing active communication with my laptop?

---

If you want to do live debugging or need additional information feel free to 
hit me 
up on google talk.

Original comment by andrew.r...@gmail.com on 6 Jun 2010 at 5:31

GoogleCodeExporter commented 9 years ago
Kernel Config, taking a look at it myself now.

Original comment by andrew.r...@gmail.com on 6 Jun 2010 at 5:32

Attachments:

GoogleCodeExporter commented 9 years ago
And more information:

When using the Sprint hotspot application, even through I don't have internet 
access 
due to not paying the fee and the apn info being incorrect, my laptop has no 
trouble 
getting ARP responses from the device.

I've checked iptables --list and ip route show dev eth0 for any clues but they 
both 
stay consistent before and after the hotspot is started.

Original comment by andrew.r...@gmail.com on 6 Jun 2010 at 5:33

GoogleCodeExporter commented 9 years ago
Startup of Wifi Driver:

SPRINT HOTSPOT UTILITY:
<4>[ 5350.746154] Dongle Host Driver, version 4.218.161.0
<7>[ 5351.397888] set brightness = 164
<3>[ 5353.265350] mmc0: Command timeout (cmd= 8 mci_st=00000004)
<7>[ 5353.289428] mmc0: queuing CIS tuple 0x91 length 3
<6>[ 5353.289794] mmc0: new high speed SDIO card at address 0001
<4>[ 5353.295410] DHD: dongle ram size is set to 294912(orig 294912)
<4>[ 5353.395233] wifi: Disable 802.11n
<4>[ 5353.494415] Enter set packet filter
<4>[ 5353.496948] start to add pkt filter 100
<4>[ 5353.503875] Enter set packet filter
<4>[ 5353.506530] start to add pkt filter 102

<4>[ 5353.512969] 
dhd_preinit_ioctls:str=0x00112233445538e7d819d70c0800450000000000000000000000000
00000
00000

<6>[ 5353.514648] eth0 (): not using net_device_ops yet
<4>[ 5353.518615] eth0: Broadcom Dongle Host Driver mac=38:e7:d8:19:d7:0c

<6>[ 5354.037048] led_hotspot_status_value = 1
<4>[ 5354.129608] penguin, get AP_PROFILE_SET
<4>[ 5354.131866] wl_iw: set ap profile:
<4>[ 5354.133941]       ssid = EVO ******
<4>[ 5354.137176]       security = wpa-psk
<4>[ 5354.137573]       key = 1234567890
<4>[ 5354.152282]       channel = 0
<4>[ 5354.152557]       max scb = 2
<4>[ 5354.983978] wds: 0021 @ 01
<6>[ 5354.984100] qmi: wds: network stopped
<4>[ 5354.984375] wds: 0022 @ ff
<6>[ 5354.984588] qmi: wds: DISCONNECTED
<7>[ 5356.081939] ALS value: 0xB0, level: 5 #
<7>[ 5356.082519] set brightness = 164
<4>[ 5356.337585] Set auto channel = 1
<4>[ 5356.338806] wl_iw_setap: do passhash...
<4>[ 5356.437713] [00]: d8ce9015
<4>[ 5356.437835] [01]: 83fb21f6
<4>[ 5356.438049] [02]: c2a67115
<4>[ 5356.438171] [03]: bd9507c0
<4>[ 5356.438262] [04]: f9f16a42
<4>[ 5356.438385] [05]: a4308725
<4>[ 5356.438598] [06]: 92d86b98
<4>[ 5356.438720] [07]: fa184156
<4>[ 5356.438842] wl_iw_setap: passphase = 
1590ced8f621fb831571a6c2c00795bd426af1f9258730a4986bd892564118fa
<4>[ 5356.450347] ap setup done
<4>[ 5356.452423] send AP_UP
<4>[ 5356.453399] penguin, get AP_ASSOC_LIST_GET
<6>[ 5356.454193] rmnet_stop()
<4>[ 5356.471343] wds: 0021 @ 01

STANDARD WIFI ON:
<4>[ 5542.693817] Dongle Host Driver, version 4.218.161.0
<3>[ 5545.224090] mmc0: Command timeout (cmd= 8 mci_st=00000004)
<4>[ 5545.232208] msmfb_start_dma 20.111 ms after vsync request
<7>[ 5545.240600] mmc0: queuing CIS tuple 0x91 length 3
<6>[ 5545.240783] mmc0: new high speed SDIO card at address 0001
<4>[ 5545.247802] DHD: dongle ram size is set to 294912(orig 294912)
<4>[ 5545.422363] wifi: Disable 802.11n
<4>[ 5545.519622] Enter set packet filter
<4>[ 5545.522216] start to add pkt filter 100
<4>[ 5545.530151] Enter set packet filter
<4>[ 5545.533538] start to add pkt filter 102

<4>[ 5545.540222] 
dhd_preinit_ioctls:str=0x00112233445538e7d819d70c0800450000000000000000000000000
00000
0000000000000000000000000000

<6>[ 5545.542358] eth0 (): not using net_device_ops yet
<4>[ 5545.546325] eth0: Broadcom Dongle Host Driver mac=38:e7:d8:19:d7:0c

<4>[ 5546.694702] Enter set packet filter
<4>[ 5546.705078] Enter set packet filter
<4>[ 5546.707550] start to add pkt filter 104
<7>[ 5556.769165] eth0: no IPv6 routers present

Original comment by andrew.r...@gmail.com on 6 Jun 2010 at 7:02

GoogleCodeExporter commented 9 years ago
Doing everything in comment 59 got tethering working for me on my shiny new 
EVO. Thanks!

Original comment by elstupi...@gmail.com on 6 Jun 2010 at 7:46

GoogleCodeExporter commented 9 years ago
I can confirm that the instructions in post #59 work.  Looking good!  I'm 
posting this while being tethered right 
now!

Original comment by gamm...@gmail.com on 6 Jun 2010 at 8:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Confirmed, the steps in comment #59 make it work!!

Original comment by lewisb...@gmail.com on 6 Jun 2010 at 8:39

GoogleCodeExporter commented 9 years ago
This does work! Confirmed. So easy I'm going to assume we'll have a fix in the 
next day 
or two that will load the driver square from the directory it sits in, no copy 
to sd 
needed. 

Original comment by andrew.r...@gmail.com on 6 Jun 2010 at 8:58

GoogleCodeExporter commented 9 years ago
Thanks guys for your work. I want to make sure I am understanding correctly. If 
I use 
th unrevoked root and the fix from comment #59, I will be able to use the 
android wifi 
tether on my Evo?

Original comment by brian.m....@gmail.com on 6 Jun 2010 at 9:32

GoogleCodeExporter commented 9 years ago
Correct Brian,

I have also confirmed WEP is working:

- Auto setup method
- Default passkey

And access control dialogs are popping up on the phone and access control list 
works 
as advertised.

Original comment by andrew.r...@gmail.com on 6 Jun 2010 at 9:37

GoogleCodeExporter commented 9 years ago
Excellent work, guys.

Harald, I'm an EVO user and the founder of AndroidPolice.com. I'm watching every
reply to report a working wifi tether as soon as you release it officially, 
without
workarounds.

This sounds like a very easy implementation - is that right?

Original comment by archon810 on 6 Jun 2010 at 9:52

GoogleCodeExporter commented 9 years ago
Just to confirm..it is working for me from the fix from comment #59 ..and I 
didnt
know how to adb shell but now i do after some research..Sweet job yall..im a 
real
happy now!!! 

Original comment by phodge...@gmail.com on 6 Jun 2010 at 10:19

GoogleCodeExporter commented 9 years ago
and also confirmed that I set up my own WEP and passkey and also changed ssid  
to my
own and works great..BIG UPS TO YOU ALL!!!

Original comment by phodge...@gmail.com on 6 Jun 2010 at 10:23

GoogleCodeExporter commented 9 years ago
To all the newbies like myself to adb shell.. make sure you dont mount your 
Phone as
a hard disk when you first plug in your phone to your pc..just let it charge.  
I made
the mistake and tried to mount as a hard disk  and then tried to adb 
shell...(Newbie
mistake!..i know!) and I kept getting a read only file error when "mkdir" in adb
shell... sorry for all the comment posts too...

Original comment by phodge...@gmail.com on 6 Jun 2010 at 10:27

GoogleCodeExporter commented 9 years ago
59 allows me to get the wifi tether application to start a ad-hoc network.  I 
can see 
that network with my laptop and connect to it, but I cannot access the internet 
through 
it.  My computer does not get a ip address from the ad-hoc network, nor does it 
see any 
DNS servers.

However my phone is still able to browse the internet using its own browser 
just fine 
while running the Ad-hoc network, so it's not a connection problem from the 
phone to 
the cell tower. 

Original comment by nitro2...@gmail.com on 6 Jun 2010 at 10:29

GoogleCodeExporter commented 9 years ago
nitro2985:  That happened with me.  I uninstalled, rebooted, and reinstalled 
experimental the tether pre-13 APK and it connected online.  3G + 4G.

Original comment by khomosl...@gmail.com on 6 Jun 2010 at 10:43

GoogleCodeExporter commented 9 years ago
I see there is a new release, pre14

Original comment by brian.m....@gmail.com on 6 Jun 2010 at 10:49

GoogleCodeExporter commented 9 years ago
Confirming that it works Khomoslomo.  I'm posting this while tethered to my Evo.

Original comment by nitro2...@gmail.com on 6 Jun 2010 at 10:51

GoogleCodeExporter commented 9 years ago
The new release eliminates the need for the hoop jumping.

Original comment by andrew.r...@gmail.com on 6 Jun 2010 at 10:52

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Using Unrevoked root and pre14 release, I am able to tether in 3G. Will test 4G 
later 
today.

Original comment by brian.m....@gmail.com on 6 Jun 2010 at 11:05

GoogleCodeExporter commented 9 years ago
pre14 installed on my EVO and the WiFi hotspot is now visible. I can connect to 
it
but because I have no 3G/4G coverage where I am at, I can't confirm the data 
passing
through. Can someone please confirm?

Original comment by archon810 on 6 Jun 2010 at 11:05

GoogleCodeExporter commented 9 years ago
@archon810: I've not made any changes to add support for the evo. Loading the 
right 
wifi-firmware (which is used for the built-in hotspot-feature) did the trick. I 
don't 
even own such a device - other users have figured that out.

@ALL: Use this application at your own risk. It is possible that use of this 
program 
may violate your carrier's Terms of Service.

Original comment by harald....@gmail.com on 6 Jun 2010 at 11:06

GoogleCodeExporter commented 9 years ago

Original comment by harald....@gmail.com on 6 Jun 2010 at 11:10

GoogleCodeExporter commented 9 years ago
I just noticed that -Press to stop tethering- doesn't actually stop the 
Network, or
the Wifi, or any thing else.

I was using IheartRadio on my iPad, hit the "Stop" button, and streaming 
continued,
and the network and WiFi continued to run.

Original comment by axlrod...@gmail.com on 6 Jun 2010 at 11:16

GoogleCodeExporter commented 9 years ago
@axlrodgun my pre14 works fine and stops the network.

@harald that's still adding support for the EVO in my book. It wasn't working 
and now
it is. I am giving credit to both you and Andrew for an absolutely awesome case 
of
remote debugging and cooperation.

Well done, guys!

Original comment by archon810 on 6 Jun 2010 at 11:23

GoogleCodeExporter commented 9 years ago
I installed pre14 and I'm still unable to get it to work.  I have rooted via 
toast's 
method, and then installed the pre14 build.  Am I missing anything here?

Original comment by melviny...@gmail.com on 6 Jun 2010 at 11:44

GoogleCodeExporter commented 9 years ago
It appears to be working after a restart

Original comment by melviny...@gmail.com on 7 Jun 2010 at 1:58

GoogleCodeExporter commented 9 years ago
Also did comment 59 and version 2.0.2-pre13 works on my evo.

Original comment by AIRiedem...@gmail.com on 7 Jun 2010 at 2:26

GoogleCodeExporter commented 9 years ago
no go on pre14 with method #59 above, htc evo

Original comment by VoX...@gmail.com on 7 Jun 2010 at 2:47

GoogleCodeExporter commented 9 years ago
Hello, I have tried to get this app to work on my Evo rooted using Unrevoked. I 
got it where it connects using my 
computer, haven't tested the data side to see if that works or not. But what 
I'm wanting is to use it as a WiFi 
hotspot for my old Hero, but when looking at the list of WiFi locations, it's 
not showing up. How can I fix this?

Original comment by emrys...@yahoo.com on 7 Jun 2010 at 3:06

GoogleCodeExporter commented 9 years ago
sigh.. 30 bucks .. who cares. this is ridiculous. I always have a different 
"unique"
scenario where 99 out of 100 work and I'm the ONE that doesn't

Followed everything to the T. EXACTLY.

DOESN'T BROADCAST SSID AT ALL. MY HERO CANNOT SEE MY EVO PERIOD. 

Original comment by VoX...@gmail.com on 7 Jun 2010 at 4:43

GoogleCodeExporter commented 9 years ago
Okay you two saying the SSID isn't being broadcasted.. did you have the old 
build installed first?  if so use Astro 
to uninstall it completely than install this new build with Astro again.  It 
works great so please don't complain 
thank all those who contributed to getting this up and running - it wasn't an 
easy process. Also restart both your 
computer and your phones sometimes thats all you need.  Don't follow comment 59 
anymore.  Download the 
newest build and install it and report back!

Original comment by prsal...@gmail.com on 7 Jun 2010 at 5:04

GoogleCodeExporter commented 9 years ago
reinstalled - rebooted nothing. 

so you're saying that pre14 is supposed to work just by installing it and 
running it? 

it's cool I just can't run this app on my phone it must be a defective one. I've
rebooted till I'm blue in face.

Original comment by VoX...@gmail.com on 7 Jun 2010 at 5:27

GoogleCodeExporter commented 9 years ago
Uninstalled, rebooted my Evo, then reinstalled the latest release. My Hero 
still cannot find my Evo's network.

Original comment by emrys...@yahoo.com on 7 Jun 2010 at 5:28

GoogleCodeExporter commented 9 years ago
@VoXPCS - Yes, pre14 works with the Evo 4G as is (provided your phone is 
rooted.)  However, your problem 
probably lies more with the Hero (and Android OS) not able to see or connect to 
ad-hoc networks out of the box.  
There's plenty of threads on Google about this problem.  Try using a laptop or 
one of those iBrick devices as a 
client if you don't want to try to workaround, but your Evo's WiFi tethering's 
probably functioning fine.

Original comment by fileman...@gmail.com on 7 Jun 2010 at 5:40

GoogleCodeExporter commented 9 years ago
@emrys_90@yahoo.com: The client needs to support joining ad-hoc-networks ...
android-devices are not able to join such networks. This app does not support
infrastructure at the moment - maybe in the future.

Original comment by harald....@gmail.com on 7 Jun 2010 at 7:22

GoogleCodeExporter commented 9 years ago
Enjoy the publicity, guys. Engadget and BGR both picked up my story: 
http://www.engadget.com/2010/06/07/htc-evo-4g-gets-unlimited-wifi-hotspot-skills
-courtesy-of-root/
http://www.boygeniusreport.com/2010/06/07/turn-your-evo-4g-into-a-free-wi-fi-hot
spot/

Rock on and I hope the influx of donations is noticeable!

Original comment by archon810 on 7 Jun 2010 at 2:01

GoogleCodeExporter commented 9 years ago
Using Sprint Hotspot it was able to connect to my Evo, whats different about 
Sprint Hotspot and this app?

Original comment by emrys...@yahoo.com on 7 Jun 2010 at 2:05