[App/Source] WifiTether for S4

Search This thread

TrevE

Retired Recognized Developer
Apr 27, 2007
2,031
3,659
androidsecuritytest.com
As some of you may know I have been added as a project owner for WifiTether. Today we have released new version to both Google Play and the android projects site with full S4 compatibility out of the box. I do not have a S4 just wrote the code to make it automagically work so as always we start with the thanks section to everyone else that has had a hand in helping.

Thanks
Harry - Original owner of WifiTether, helped with a bunch of the s4/API level cleanup and fixing my messy code :) Awesome guy.
Ziggy471 - For building new ifconfig binary for us, cutting additional busybox support
Eschelon, NxtGenCowboy, Virus - For testing multiple S4 builds and as always being awesome

Configuration:
*Latest Build recommended, these are just a few devices I have tested on*

Setup-Method: (auto should have right defaults, might need to force)
  • Galaxy S4 - Hostapd
  • Galaxy S3 - Netd-ndc with driver reload 2
  • Evo 3d SoftAP with driver reload 2
  • Sensation SoftAP with no driver reloads
  • Evo 4g SoftAP with no driver reloads

Bugs
  • On GS4 if you enable WPA Security you cannot change SSID/Channel without a device reboot. No security applies changes instantly.
  • You might have to toggle stuff on and off once first if you run into errors. I think there's an error on first creation of config
  • If you switch modes between native wifitether and fallback mode (or stock tethering), your phone may spontaneously combust(wifi crashes) after the routing mess that ensues. Just reboot and you'll be all set again.
  • Seems to work better on SuperSU - Probably due to the per-app permissions vs per command.

Feel free to post any other issues/needed enhancements here. You will probably get a quicker answer from me atleast posting on XDA rather than the google code bugs page.

Download
Source: http://code.google.com/p/android-wifi-tether/source/checkout
Compiled APK: (r570 / 06102013) http://code.google.com/p/android-wifi-tether/downloads/detail?name=wifi_tether_v3_3-beta2.apk

Difference Between Versions
Any apps labeled "-TrevE mod" will be built from my environment. If we have problems or need a quick fix I may build an apk or two not meant for the general public - just for XDA. Harry and I have different keys so you will need to uninstall market versions to use ones that I build and vice versa.
 
Last edited:

eschelon

Retired Recognized Developer
Jun 20, 2009
1,388
8,954
Congrats, TrevE, on becoming project owner of one of the best classic Android apps!
 
  • Like
Reactions: il buono

jimmiem

Senior Member
Dec 7, 2008
51
7
I get a toast message that says tethering has started with errors. When I try to check the log file it says the log file doesn't exist.
 

TrevE

Retired Recognized Developer
Apr 27, 2007
2,031
3,659
androidsecuritytest.com
I have a S4 running CM10.1 and I keep on getting "starting hostapd: failed". Is there a reason why?

Most normal JB+ devices use netdndc, it was kinda surprising (to me atleast) that touchwiz used hostapd. Can you try to use Netd(ndc) setup method mode, and possibly check on/off the send max clients command if that doesnt work?

I get a toast message that says tethering has started with errors. When I try to check the log file it says the log file doesn't exist.

Are you using SuperSU instead of superuser.apk?

Also did you try to just turn it off and turn it on again? Very first time using after installing app you might hit a race condition you never will after that.
 
Last edited:

madsquabbles

Senior Member
Jan 31, 2009
1,973
366
Are you using SuperSU instead of superuser.apk?

Also did you try to just turn it off and turn it on again? Very first time using after installing app you might hit a race condition you never will after that.

i get the same using supersu - i'm on hyperdrive. i've tried all the options mentioned and still getting errors. and of course no logs for some reason - same thing happens with all the versions of wifi tether.

gonna give synergy a run and see how it turns out.

works perfectly on synergy. could be something i did. i only did about 10 min of troubleshooting on hyperdrive b/c i was pretty anxious about trying synergy.
 
Last edited:

open1your1eyes0

Senior Member
Dec 13, 2010
2,651
3,671
New York City
I get a toast message that says tethering has started with errors. When I try to check the log file it says the log file doesn't exist.

Are you using SuperSU instead of superuser.apk?

Also did you try to just turn it off and turn it on again? Very first time using after installing app you might hit a race condition you never will after that.

Same issue on Verizon Galaxy S4 stock ROM using latest SuperSU. Tried multiple times, on Auto and Samsung Galaxy S4 profile and even rebooted. And when I click to show the log it says the log doesn't exist.
 

Abolfazl

Senior Member
Jan 24, 2009
309
56
San Carlos, CA
abolfazl.me
Most normal JB+ devices use netdndc, it was kinda surprising (to me atleast) that touchwiz used hostapd. Can you try to use Netd(ndc) setup method mode, and possibly check on/off the send max clients command if that doesnt work?



Are you using SuperSU instead of superuser.apk?

Also did you try to just turn it off and turn it on again? Very first time using after installing app you might hit a race condition you never will after that.

I would have to switch device profile to the S3. The S4 does not have Netd
 

jimmiem

Senior Member
Dec 7, 2008
51
7
Are you using SuperSU instead of superuser.apk?

Also did you try to just turn it off and turn it on again? Very first time using after installing app you might hit a race condition you never will after that.

Yes, SuperSU, yes turned off and on several times. Even rebooted. Oh, and it's a stock Verizon GS4.
 

Martelle

New member
Apr 4, 2011
3
0
I'm having the same issues. I have tried different settings with no working results.

Rom: Clean Rom
 

madsquabbles

Senior Member
Jan 31, 2009
1,973
366
everything's working perfectly with synergy rom after rebooting after each change. either the other roms have an incompatible tweak or synergy has something tweaked.
 

TrevE

Retired Recognized Developer
Apr 27, 2007
2,031
3,659
androidsecuritytest.com
Real weird, Synergy started with a deodexed base and from the early revisions before really modding we had tether working.

can you guys see if putting these 3 libs in system works? no s4 to test but the updater logic looks correct. you can also just pop em outa the zip and adb push to /system/lib, whatever works as long as they get in there
 

Attachments

  • tether_libs-unsigned.zip
    265.6 KB · Views: 98

Abolfazl

Senior Member
Jan 24, 2009
309
56
San Carlos, CA
abolfazl.me
Real weird, Synergy started with a deodexed base and from the early revisions before really modding we had tether working.

can you guys see if putting these 3 libs in system works? no s4 to test but the updater logic looks correct. you can also just pop em outa the zip and adb push to /system/lib, whatever works as long as they get in there

Nope. Same issue.
 

TrevE

Retired Recognized Developer
Apr 27, 2007
2,031
3,659
androidsecuritytest.com
Alright great! Thank you very much.

if you can try running these commands and see what works ill be able to fix the app based on what works

  1. Go into wifi tether, press menu -> settings -> menu -> (Re)Install binaries / configs.
  2. Next in either a terminal emulator from market or adb shell (preferred) run these commands. Note any output errors that show up in shell. At the end see if you see a new AP pop up called TrevScript. Reboot inbetween the different tests to start fresh again.
  3. netdndc mode - no max clients
    Code:
    rmmod dhd;
    insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt";
    /system/bin/ndc softap stopap;
    /system/bin/ndc softap stop wlan0;
    /system/bin/ndc softap fwreload wlan0;
    /system/bin/ndc softap start wlan0;
    /system/bin/ndc softap set wlan0 wlan0 TrevScript open none 1 0 8;
    /system/bin/ndc softap startap;
    /system/bin/ndc interface setcfg wlan0 192.168.2.254 255.255.255.0 up;
  4. netdndc mode - max clients
    Code:
    rmmod dhd;
    insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt";
    /system/bin/ndc softap stopap;
    /system/bin/ndc softap stop wlan0;
    /system/bin/ndc softap fwreload wlan0;
    /system/bin/ndc softap start wlan0;
    /system/bin/ndc softap set wlan0 wlan0 TrevScript open none 1 25 0 8;
    /system/bin/ndc softap startap;
    /system/bin/ndc interface setcfg wlan0 192.168.2.254 255.255.255.0 up;
  5. hostapd mode
    Code:
    rmmod dhd;
    insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt";
    /data/data/com.googlecode.android.wifi.tether/bin/ifconfig wlan0 192.168.2.254 netmask 255.255.255.0;
    /data/data/com.googlecode.android.wifi.tether/bin/ifconfig wlan0 up;
    /system/bin/hostapd -P /data/data/com.googlecode.android.wifi.tether/var/hostapd.pid -B /data/data/com.googlecode.android.wifi.tether/conf/hostapd.conf;
 
Last edited:

Abolfazl

Senior Member
Jan 24, 2009
309
56
San Carlos, CA
abolfazl.me
if you can try running these commands and see what works ill be able to fix the app based on what works

  1. Go into wifi tether, press menu -> settings -> menu -> (Re)Install binaries / configs.
  2. Next in either a terminal emulator from market or adb shell (preferred) run these commands. Note any output errors that show up in shell. At the end see if you see a new AP pop up called TrevScript. Reboot inbetween the different tests to start fresh again.
  3. netdndc mode - no max clients
    Code:
    rmmod dhd;
    insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt";
    /system/bin/ndc softap stopap;
    /system/bin/ndc softap stop wlan0;
    /system/bin/ndc softap fwreload wlan0;
    /system/bin/ndc softap start wlan0;
    /system/bin/ndc softap set wlan0 wlan0 TrevScript open none 1 0 8;
    /system/bin/ndc softap startap;
    /system/bin/ndc interface setcfg wlan0 192.168.2.254 255.255.255.0 up;
  4. netdndc mode - max clients
    Code:
    rmmod dhd;
    insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt";
    /system/bin/ndc softap stopap;
    /system/bin/ndc softap stop wlan0;
    /system/bin/ndc softap fwreload wlan0;
    /system/bin/ndc softap start wlan0;
    /system/bin/ndc softap set wlan0 wlan0 TrevScript open none 1 25 0 8;
    /system/bin/ndc softap startap;
    /system/bin/ndc interface setcfg wlan0 192.168.2.254 255.255.255.0 up;
  5. hostapd mode
    Code:
    rmmod dhd;
    insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt";
    /data/data/com.googlecode.android.wifi.tether/bin/ifconfig wlan0 192.168.2.254 netmask 255.255.255.0;
    /data/data/com.googlecode.android.wifi.tether/bin/ifconfig wlan0 up;
    /system/bin/hostapd -P /data/data/com.googlecode.android.wifi.tether/var/hostapd.pid -B /data/data/com.googlecode.android.wifi.tether/conf/hostapd.conf;

I ran the first one and got

Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Bijan>adb shell
shell@android:/ $ su
su
shell@android:/ # rmmod dhd;
rmmod dhd;
shell@android:/ # rmmod dhd
rmmod dhd
rmmod: delete_module 'dhd' failed (errno 2)
255|shell@android:/ # insmod /system/lib/modules/dhd.ko "firmware_path=/system/e
tc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt"
cmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt"                    <
shell@android:/ # /system/bin/ndc softap stopap
/system/bin/ndc softap stopap
200 0 Softap operation succeeded
shell@android:/ # /system/bin/ndc softap stop wlan0
/system/bin/ndc softap stop wlan0
500 0 Softap Unknown cmd
shell@android:/ # /system/bin/ndc softap fwreload wlan0
/system/bin/ndc softap fwreload wlan0
400 0 Softap operation failed (File exists)
shell@android:/ # /system/bin/ndc softap start wlan0
/system/bin/ndc softap start wlan0
500 0 Softap Unknown cmd
shell@android:/ # /system/bin/ndc softap set wlan0 wlan0 TrevScript open none 1
0 8;
n0 wlan0 TrevScript open none 1 0 8;                                          <
Lost connection to Netd - did it crash?
104|shell@android:/ # /system/bin/ndc softap set wlan0 wlan0 TrevScript open non
e 1 0 8
lan0 wlan0 TrevScript open none 1 0 8                                         <
Lost connection to Netd - did it crash?
104|shell@android:/ # /system/bin/ndc softap startap
/system/bin/ndc softap startap
200 0 Softap operation succeeded
shell@android:/ # /system/bin/ndc interface setcfg wlan0 192.168.2.254 255.255.2
55.0 up
fg wlan0 192.168.2.254 255.255.255.0 up                                       <
400 0 Failed to set prefixLength (Success)
shell@android:/ #
 

drt054

Senior Member
Jan 8, 2011
1,012
196
Cleveland, OH
Has anyone been able to figure out the Wifi Tether Settings for S4 on CM10.1? I have tried several different configs/options. Attempting to connect to my Win8 box. Native tether not working.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    As some of you may know I have been added as a project owner for WifiTether. Today we have released new version to both Google Play and the android projects site with full S4 compatibility out of the box. I do not have a S4 just wrote the code to make it automagically work so as always we start with the thanks section to everyone else that has had a hand in helping.

    Thanks
    Harry - Original owner of WifiTether, helped with a bunch of the s4/API level cleanup and fixing my messy code :) Awesome guy.
    Ziggy471 - For building new ifconfig binary for us, cutting additional busybox support
    Eschelon, NxtGenCowboy, Virus - For testing multiple S4 builds and as always being awesome

    Configuration:
    *Latest Build recommended, these are just a few devices I have tested on*

    Setup-Method: (auto should have right defaults, might need to force)
    • Galaxy S4 - Hostapd
    • Galaxy S3 - Netd-ndc with driver reload 2
    • Evo 3d SoftAP with driver reload 2
    • Sensation SoftAP with no driver reloads
    • Evo 4g SoftAP with no driver reloads

    Bugs
    • On GS4 if you enable WPA Security you cannot change SSID/Channel without a device reboot. No security applies changes instantly.
    • You might have to toggle stuff on and off once first if you run into errors. I think there's an error on first creation of config
    • If you switch modes between native wifitether and fallback mode (or stock tethering), your phone may spontaneously combust(wifi crashes) after the routing mess that ensues. Just reboot and you'll be all set again.
    • Seems to work better on SuperSU - Probably due to the per-app permissions vs per command.

    Feel free to post any other issues/needed enhancements here. You will probably get a quicker answer from me atleast posting on XDA rather than the google code bugs page.

    Download
    Source: http://code.google.com/p/android-wifi-tether/source/checkout
    Compiled APK: (r570 / 06102013) http://code.google.com/p/android-wifi-tether/downloads/detail?name=wifi_tether_v3_3-beta2.apk

    Difference Between Versions
    Any apps labeled "-TrevE mod" will be built from my environment. If we have problems or need a quick fix I may build an apk or two not meant for the general public - just for XDA. Harry and I have different keys so you will need to uninstall market versions to use ones that I build and vice versa.
    2
    So looks like this still doesn't work on 4.3 update either.

    So disappointed that this was abandoned. This was the best and most reliable tethering app since it bypassed the stock one. :(
    1
    Congrats, TrevE, on becoming project owner of one of the best classic Android apps!