Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simply put, Tetherfi works partially at best. #394

Open
SharpFangz69 opened this issue Feb 27, 2025 · 10 comments
Open

Simply put, Tetherfi works partially at best. #394

SharpFangz69 opened this issue Feb 27, 2025 · 10 comments
Labels
bug Something isn't working compatibility documentation Improvements or additions to documentation

Comments

@SharpFangz69
Copy link

Hello, to be frank this is the first issue I've ever opened on Github before. So please forgive me for any errors or faux pas I might make. I am open to any constructive forms of criticism and suggestions.

I have an Unlimited Data Plan with no throttling, and an Unlimited Hotspot plan but that becomes throttled. But I prefer to share my Data Plan. I use another app that is proprietary (Netshare) that shares a SOCKS proxy from my phone's data plan to my computer, and then I connect to TUN via v2rayN on the very same computer. It works almost always and it behaves just like a regular internet connection. My Android device is an unlocked A25 5G (no-root) and my host machine is Arch Linux. However there are two things with my current setup that I am not satisfied with.

  1. It's still a proprietary app.
  2. It supports no USB-tethering, for a more stable internet such as voice-chatting and playing games.

However TetherFi supports USB connections, and it is open-source. It's supposed to do everything Netshare does and more, but simply put it doesn't work.

  1. Wi-Fi Direct
    I am using the experimental SOCKS proxy and the only thing that somewhat work is Telegram. (I use a 3rd party client named 64gram.) I can send messages, voice recordings, etc...but I cannot join a voice chat. However I can do so with Netshare + SOCKS

  2. USB Tethering

It flat-out doesn't work. I've enabled USB-tethering, Location, and I am connected directly to the computer (no USB hub) with an USB cable and it refuses to work.

Image

Image

Image

@pyamsoft
Copy link
Owner

Hi :) thanks for opening the issue

  1. Yeah the SOCKS code is still buggy related to UDP. To keep a long story short, it was very very broken, and Telegram uses UDP for voice chat. The next release version should be better, but I don't have a release timeline for it yet.

  2. USB tethering is a super duper hack, frankly I'm surprised I managed to get something that even slightly works on my own device. For this, I'd love to know the specific error message presented in TetherFi Broadcast Status. You can dismiss this error dialog and then click the little i icon by Broadcast Status to see the specific error.

Also I'd love if you could please show me your TetherFi hotspot screen when WiFi direct is running, as well as how you configure Telegram Proxy settings, if you would be able to :)

Thanks!

@pyamsoft pyamsoft added bug Something isn't working compatibility labels Feb 28, 2025
@pyamsoft
Copy link
Owner

Regarding the USB tethering issue, sadly I can't confirm it on my desktop PC (Arch btw :) ) it is working

I will say though

The first time I connected and turned on USB tethering in the phone settings, it did not work. It just hung forever on the first curl command, so I know the proxy was up and I was talking to "something" but it's like the Android USB stack wasn't "letting me in". I turned the USB tether switch on and off a few times in system settings and restarted the TetherFi hotspot a few times and then it started working.

I then opened a different build of the TetherFi app and it worked instantly, so its "something" on the Android system that doesn't like USB tethering when it first starts or something - not sure.

Here's a curl log showing that I am connected via USB tether:

# A simple "does the USB tether connection work"
❯ curl --proxy http://192.168.225.78:8228 example.com
<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
    body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

    }
    div {
        width: 600px;
        margin: 5em auto;
        padding: 2em;
        background-color: #fdfdff;
        border-radius: 0.5em;
        box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
    }
    a:link, a:visited {
        color: #38488f;
        text-decoration: none;
    }
    @media (max-width: 700px) {
        div {
            margin: 0 auto;
            width: auto;
        }
    }
    </style>
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is for use in illustrative examples in documents. You may use this
    domain in literature without prior coordination or asking for permission.</p>
    <p><a href="https://www.iana.org/domains/example">[More information...](https://www.iana.org/domains/example)</a></p>
</div>
</body>
</html>

# This is the IP of my mobile data network - so the command over USB is correctly using "Prefer Cellular"
# t-mobile in the US
❯ curl --proxy http://192.168.225.78:8228 icanhazip.com
172.58.*.*

# ip output showing that 192.168.225.78 is the USB tether connection
❯ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether c0:a5:e8:44:d4:87 brd ff:ff:ff:ff:ff:ff
10: enp195s0f3u1u2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether fa:10:68:3f:c0:f8 brd ff:ff:ff:ff:ff:ff
    altname enxfa10683fc0f8
    inet 192.168.225.235/24 brd 192.168.225.255 scope global dynamic noprefixroute enp195s0f3u1u2
       valid_lft 3465sec preferred_lft 3465sec
    inet6 fe80::d270:fe7b:2c2c:5924/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

@pyamsoft pyamsoft added the documentation Improvements or additions to documentation label Feb 28, 2025
@SharpFangz69
Copy link
Author

Hi :) thanks for opening the issue

  1. Yeah the SOCKS code is still buggy related to UDP. To keep a long story short, it was very very broken, and Telegram uses UDP for voice chat. The next release version should be better, but I don't have a release timeline for it yet.
  2. USB tethering is a super duper hack, frankly I'm surprised I managed to get something that even slightly works on my own device. For this, I'd love to know the specific error message presented in TetherFi Broadcast Status. You can dismiss this error dialog and then click the little i icon by Broadcast Status to see the specific error.

Also I'd love if you could please show me your TetherFi hotspot screen when WiFi direct is running, as well as how you configure Telegram Proxy settings, if you would be able to :)

Thanks!

  1. Alright I will simply wait concerning UDP improvements with SOCKS. I can't wait to eventually ditch Netshare.

  2. I will have to fiddle with the USB tethering settings and see what works. It seems to be an Android issue and not exactly the issue with your app.

Thank you for your hard work concerning the app, if fully stable/functional this could be a life-changer for many people. Especially those who can't afford much or are on the go.

I will attempt to troubleshoot and show anything of note, I will update with my next post.

@SharpFangz69
Copy link
Author

SharpFangz69 commented Feb 28, 2025

Here's my Wifi direct setup w/Telegram

Image
Image

Image

(On second thought I probably don't need to obscure that anyways. Maybe I do, whatever.)

@SharpFangz69
Copy link
Author

Here's the error I get with direct USB connection

Image

@pyamsoft
Copy link
Owner

OK great :)

First off

For general reference, all IP addresses in TetherFi are private, so showing 192.168.49.1 or whatever is not a risk, since everyone has this number at home :)

Two, the HTTP server runs on 8228. In that blue screenshot above, you should change the port for HTTP to 8228, SOCKS runs on 8229 so that is fine.

Three:

The USB error is a good thing, this is a fun one.

Right now, the USB code is implemented by looking for special interfaces named "RNDIS" or "NCM"

Yours may be named something else. If you are in an environment that can run Android code, I can give you a code snippet to run that will show your special interface names, so that I can add them. If you do not have an Android dev environment, I will give you a simple APK in a few days that will just print out on screen what your Interface names are.

@SharpFangz69
Copy link
Author

OK great :)

First off

For general reference, all IP addresses in TetherFi are private, so showing 192.168.49.1 or whatever is not a risk, since everyone has this number at home :)

Two, the HTTP server runs on 8228. In that blue screenshot above, you should change the port for HTTP to 8228, SOCKS runs on 8229 so that is fine.

Three:

The USB error is a good thing, this is a fun one.

Right now, the USB code is implemented by looking for special interfaces named "RNDIS" or "NCM"

Yours may be named something else. If you are in an environment that can run Android code, I can give you a code snippet to run that will show your special interface names, so that I can add them. If you do not have an Android dev environment, I will give you a simple APK in a few days that will just print out on screen what your Interface names are.

I would prefer the APK thanks, but what exactly is the "Android Dev Environment?" I can run ADB

@pyamsoft
Copy link
Owner

By dev environment I mean the full Android Studio setup :)

No worries, I should be able to make a simple APK and get it to you in a few weeks - I hope thats alright.

@SharpFangz69
Copy link
Author

By dev environment I mean the full Android Studio setup :)

No worries, I should be able to make a simple APK and get it to you in a few weeks - I hope thats alright.

I suppose I do? But sure yeah I could also wait for an APK as well.

@pyamsoft
Copy link
Owner

pyamsoft commented Mar 4, 2025

Hello again

Here is a simple APK that you can install on your device which will display some network related information that TetherFi needs for the USB connection logic.
networktest

Please install this and then:

  • Plug your device into a USB cable
  • Start USB tethering
  • Open this app, it may be called com.pyamsoft.networktest.MainActivity on your Launcher
  • Wait a little bit, it may be blank as it thinks.
    • Take a screenshot of whatever contents it outputs. Thank you!

If you are curious, you can find the entire code for this APK here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants