2

So I found out the hard way that the USB tether IP is 192.168.52.x and the WiFi addresses are 192.168.53.x.

My goal is to be able to access the USB tethered device (Raspberry Pi) from WiFi as if it's the same network.

If I had to specific ports, that'd be ok, but I'd like to avoid that if possible. I found this XDA post about reverse tethering (sharing a PC's internet connection over Android WiFi) which I think is really close to what I need, but in a different configuration.

Any help is greatly appreciated!

To add further clarification, let's say there are three devices: an Android phone, a Raspberry Pi, and a Macbook. The Raspberry Pi is tethered via USB to the phone. The Macbook is connected to the phone via WiFi. I want to connect to the Raspberry Pi from the Macbook.

  • the USB tether IP is 192.168.52.x and the WiFi addresses are 192.168.53.x. -- On some devices, its 192.168.42.x and 192.168.43.x respectively. You can always find it easily by looking at the gateway info in your OS. – Firelord Apr 25 '15 at 16:55
  • Could you help here? I can't understand the question properly. Your Pi (running Android I assume) is USB tethered to PC. You also found a post mentioning reverse tethering. You mentioned Android Wifi too. So, the Wifi is created by another source like a Router and its not the android hotspot we're talking of. Your goal is to access your Pi using Wifi. So what's the issue? Can't you connect it to Wifi or does it not come with an in-built adapter (I know of ethernet port only)? – Firelord Apr 25 '15 at 17:02
  • There is a Raspberry Pi, Android phone, and Macbook. The Raspberry Pi is connected to the Android phone and uses USB tethering to get to the internet. I have the Macbook also connected to the Android phone, but via WiFi. I want to be able to access my Raspberry Pi from my Macbook. – Dan Mandle Apr 25 '15 at 20:39
  • Could you please add the info in your last comment into the question? That would be good for someone trying to answer your question. Besides, I want to know, is there a service running on Pi that you want to access, like a server or display sharing or something else. There must be something on Pi you want to access. – Firelord Apr 25 '15 at 20:43
  • As my question states, I want to be able to access the Pi as if it were on the same network. At least port 3000 and 22. – Dan Mandle Apr 25 '15 at 21:15
1

I had the same problem: Raspberry Pi B+, laptop, and android phone. I wanted to use putty from laptop to administrate the Pi.

Solution was:

  1. Install proxy server on android: Proxy server
  2. Install a software to find out network connections of android, for me this worked: Ping and DNS
  3. Connect Pi to android phone through USB tethering. How to: htttps://www.raspberrypi.org/forums/viewtopic.php?f=29&t=90728 (I cannot post more than 2 links here, oh crap, so please remove extra "t" in htttp)
  4. Connect laptop to android phone using WIFI hotspot

Now your phone sees both devices, but Pi cannot see laptop. Solution is to forward packages from laptop to Pi using any relevant phone application (like proxy server mentioned above)

Let's assume that we mainly need to do SSH from laptop to Pi using Putty. So at the end we should have: LaptopPutty->AndroidProxyServer->Pi

AndroidProxyServer will accept connections from LaptopPutty on XX port then AndroidProxyServer will forward the packages to Pi on port 22 (the SSH port)

  1. Run Ping and DNS->network on android and find out what IP address does your Pi, and android phone have. (you will use both later)

  2. Android proxy server setup:

    • open app
    • Add a server
    • Name: any you like
    • Port: any you like, it will be used in Putty (XX)
    • Connection time out: put something huge like 999999, otherwise server will terminate your connection in the middle of some calibrations to your pi
    • Switch to "Rules" tab on the top of the app
    • Add a rule
    • Host: your laptop name. (proxyserver will apply rule if connection comes from this host; laptop name could be found by "whoami" command in windows cmd.)
    • Forward to host:IP address of the Pi, found in step 5
    • Forward to port:22
  3. Run the Android proxy server

  4. on laptop run Putty, and under session set:

    • Host Name (or IP address):Ip address of your Android phone, which you found in step 5
    • Port: XX, the one you put when setting up Android proxy server in step 6
    • Connection type:SSH

Should be working now.

0

I think it'll work if you set up a proxy on your phone that will redirect the requests of your Macbook to the RasPi. That is possible without root. See my detailed answer to a similar problem (not tested with your particular setup): https://android.stackexchange.com/a/116437/118205

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.