How To Connect Raspberry Pi To A Phone

Share:

This tutorial includes basic steps to help you connect the raspberry pi to your phone (android, windows, ios). In order to achieve this, we will be going the wireless way! No more wires! This is a step forward to make the raspberry pi truly portable.

Things needed:

  1. Raspberry Pi
  2. Wifi Dongle
  3. A phone with WiFi tethering

First of all set up the WiFi dongle for use with raspberry pi. If you have no idea of how to go about this, here’s a tutorial.

Some information.

Before proceeding with the tutorial, we will need some info about the IP address that your phone allocates to the devices that are connected to it i.e. tethered to it. To find this information, borrow a phone from your friend and install Fing. It’s a network analyser, a fancy way of saying that it can identify the devices connected to your WiFi network (it can do a lot more things).

Settings_Tab_1

Settings_Tab_1

Open the settings tab on your phone (I am using a Nexus 5). Navigate to More –> Tethering & portable hotspot. Have a look at the screenshot on the left.

Click on Set up Wi-Fi hotspot. Change the network name to something simple like DNA-Corp. Security to WPA2 PSK and enter the password. Click on Save. Turn ON the Wi-Fi hotspot button. That’s it! Your phone has been configured as a hotspot.

Connect your friends phone to this Wi-Fi hotspot. Name of the WiFi is DNA-Corp & the password is the same as used above. Fire up Fing, it will automatically detect all the devices that are connected to WiFi network DNA-Corp.

Fing

Fing

Have a look at the screenshot on the right-hand side. You will see the list of devices along with their IP, MAC address & device name. Now the important thing to note here is the range of the IP address in my case it goes from 192.168.43.1 to 192.168.43.255. This range may be different in your case.

Choose an IP address within this range to assign it to your Pi. That will be the static IP with which the raspberry pi will be connected to your phone. I prefer to choose 192.168.43.100. Have a look at this tutorial on how to assign a static IP to raspberry pi.

After making all the necessary changes, the interfaces files should look similar to the one shown below.

mobile_interfaces

mobile_interfaces

NOTE: Don’t forget to make the necessary changes in the wpa_supplicant file. Include the SSID and PSK Key.

Reboot using the command

Ensure that your phone is ON and acting as a WiFi hotspot. If everything is OK, after the reboot is complete, Pi will be connected to your phone. bigsmile

1 Comments

  1. Hey all,

    For anyone wanting to get their RasberryPi project connected online, check out –

    The PiAnywhere 4G & LTE Hat for the Raspberry Pi Beta provides 4G mobile data for the Raspberry Pi mini computer. Our intelligent HAT module provides your Raspberry Pi with mobile data, GPS positioning information and battery support. This is the perfect module for hackers, scientists, and creators as it gives your Pi powerful connectivity wherever you are. Simple plug out module into your Raspberry Pi and start playing. http://www.pianywhere.com

    Reply

Leave a Comment.