Friday 16 March 2018

Raspberry Pi 3 Model B & B+ USB Tethering using an Android phone

Raspberry Pi 3 Model B & B+ USB Tethering Using a Android Mobile Phone



Hi,

I post this since it saved me a cost of buying a wifi-adapter and provided useful insight of pi-configuration.
I wanted to access internet from PI. There were 2-3 options.

1. Use Ethernet port.
Since I use wifi all the time, I do not have mechanism to connect my wifi router to LAN port. Although I guess it would have worked simply since I have LAN connector on router as well as on PI. But I had to buy another dataplan since router was dsl. But

2. Buy wifi-adapter and connect same to pi as mentioned in various articles.
Costly affair..

3. Use USB-tethering option of my smartphone.
I have Xperia-U and I use USB tethering option to connect my laptop to internet sometimes. This option I wanted to explore for connecting to internet. Then I could use same data plan everywhere.

So let me explain 3rd option.
On PI-B+ (which I purchased recently) have 4 USB ports. 2 are taken by keyboard and mouse already. One of the remaining can be used to connect to phone.
The default config file used by networking is /etc/network/interfaces works with wifi (wlan0) or eth(eth0) type of interfaces. It does not have entry for tethered device which android provides.

 Step To Install the USB Tethering in Raspberry Pi 3 



1) Open terminal & Type sudo /etc/network/interfaces



So we need to edit this file on Pi and add entries to it for usb (usb0).
#cat /etc/network/interfaces
And Copy Paste this Line ↧↧↧↧↧↧↧↧↧



auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

allow-hotplug usb0
iface usb0 inet static
address 192.168.42.42
netmask 255.255.255.0
network 192.168.42.0
broadcast 192.168.42.255
gateway 192.168.42.41


and then save the file.
You need to restart the board or networking using #sudo /etc/init.d/networking restart

Once this is done connect the phone to Pi using usb cable.
Enable data on android and wait till it activates and then enable USB tethering.

To see if the device is tethered, open a LXterminal session on pi and type #ifconfig
You should see interface usb0 is up and running with a valid IP assigned to it.

The open web-browser and it should be working fine.. :geek:

So you can use your android smartphones usb-tethring for connecting Pi to internet.. :geek:
YOUTUBE VIDEO TUTORIAL






FOLLOW ME OTHER SIDE ⇩⇩⇩⇩⇩⇩⇩⇩

For business inquiries: vinayaktare@gmail.com

GooglePlus  https://www.plus.google.com/
Yahoo  vinayak.tech@yahoo.com
Gmail  vinayaktare0@gmail.com

0 comments: