5

I'm trying to SSH into my pi but I don't have a wifi router in the area but I do have cell data. I've been working on giving the laptop internet access via usb tethering to my phone or having the phone set up a wireless hotspot. Then bridging the wireless connection and ethernet connection on the laptop and plugging an ethernet cable to the rpi from the laptop.

I've been unable to get it working so far, not sure if I'm messing something up or if this isn't possible, I usually connect by bridging the wifi and ethernet connections on the laptop when I have a wifi router available. Connecting from the laptop with putty.

2
  • If you can get one device accessing the internet then you just need to attach the other (the Pi via wifi) and set the IP address and default gateway correctly(at a minimum). Have you set up DHCP on the laptop or do you set a static IP address in the Pi? What do you get from running ipconfig -a
    – rob
    Jun 18, 2015 at 10:21
  • Which version of android have worked? I seem to be encountering firewall issues..
    – Wilf
    Oct 5, 2017 at 16:40

3 Answers 3

7

At least with the Raspberry Pi 3 (didn't try with a 2 and a WiFi dongle) and a Mac is easy:

  1. Configure your Raspberry Pi to connect your hotspot (I have two different WLAN blocks, one for the WiFi at home, the other for the mobile hotspot).
  2. Enable the hotspot on your android device and switch on your Pi (plug the USB power cable in)
  3. Connect your Mac to the same hotspot.
  4. Voila! you'll be able to connect to your Pi via ssh [email protected] and develop the heck out of it.
1
  • 1
    Just wanted to add that using VNC or Microsoft Remote Desktop also works this way too. Dec 2, 2016 at 21:25
0

If you are having difficulty connecting via SSH to a Raspi on a local hotspot. Maybe... They both have to be on the same network. That is your laptop has to be on the personal hotspot too. A moment's reflection enables you to understand why. It's using a local network like 192.168.... which is only in your house, not on the whole web. the iPhone 172.20.10.xx is similar!

-1

You don't need internet to ssh to your pi... But you do need a connection between the two(a LAN connection). So forget about the cell tethering altogether(as regards ssh at least, they are two separate issues.)

To ssh to your pi you can either get a switch and two standard network cables or one crossover cable or set up a wifi adapter on the pi and an ad hoc network between the pi and the computer.

The crossover cable is probably the cheapest. You can make one yourself if you've got an RJ-45 crimper. Once you have the link, then you set static IPs on both your PC and the pi. (i.e. set your TCP/IP address in windows to 192.168.0.1 and the pi to 192.168.0.2 and use the netmask 255.255.255.0 for both. You don't need a gateway or DNS if there's no internet)

(To set a static IP on the pi see - http://www.modmypi.com/blog/tutorial-how-to-give-your-raspberry-pi-a-static-ip-address. In windows it's under Network and Sharing Center->Change Adapter Settings. Right click the adapter and select properties then Internet Protocol Version 4.)

once you've done that, you should be able to ssh to the pi at whatever 192.168.xxx.xxx address you gave it.

Edit 2015-12-23: Corrected example IP addresses to ones that are on the same (sub)network address! Edit#2 2015-12-23: Unfortunately the linked method of setting a static IP address probably won't work on recent Raspbian.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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