USB Tethering instructions for Raspberry Pi D-Star
Dec 7, 2015 17:28:34 GMT -7
Post by ke6czd on Dec 7, 2015 17:28:34 GMT -7
Summary: I personally prefer to tether my Raspberry Pi to my phone. In this scenario (and if you have enough power) the Raspberry Pi is charging your phone and you are NOT dealing with WIFI. Although WIFI normally works very well, it can be a point of failure. Removing this from the RF chain can make a difference if you have a weak or improperly configured WIFI link.
Disclaimer: Below are instructions to make this go. You need to be familiar with Linux and have access to your image (SSH or VNC/Terminal). Please BACK-UP your WORKING IMAGE before proceeding. I do not warranty anything. This is merely a guide of how I got it done.
BugDroid your friend? Here are Android instructions
Login via SSH to your Raspberry Pi.
Type this in:
It should show eth0 and lo at a minimum.
Let's add the USB interface to our network configuration that Android creates when it gets plugged in.
Type this in:
add this to the bottom of the file:
You can save it now.
Let's restart networking by typing this in:
Now plug in your Android phone to your Pi.
Enable USB tethering on your Android device:
Settings → Connections → Tethering and Wi-Fi hotspot → USB tethering (Please be aware that this may be different depending if the manufacturer has made any customizations to Android.)
The Raspberry automatically should be getting an IP address via its USB0 port. The Android device behaves like an NAT router. When your device is connected to either Wi-Fi or a mobile 3G/4G network, it should work.
Run this command:
You should see a minimum of three interfaces now: eth0, lo, and usb0
Your Raspberry Pi should now have internet access via the USB.
Is Steve Jobs your spiritual leader? Ok then, here are iPhone instructions...
Login to your Raspberry Pi via SSH.
Type this in:
You should at minimum see eth0 and lo.
Let's install some software that's required for your iPhone.
Now plug in your iPhone to the USB port.
Let's enable hotspot on your iPhone (steps are for iOS9):
Settings → Cellular → Personal Hotspot → Enable
Run this command again:
You should see three interfaces.
eth0, lo, and eth1 (most of the time eth1 is the default interface name for the iPhone)
Let's add the interface that the iPhone creates to the networking configuration.
Type this in:
Add this to the end of the file:
Save it and restart networking.
After networking has restarted type this in and see if eth1 has an IP assigned to it.
The Raspberry automatically should be getting an IP address via the USB tether.
You can have these both configured on your Raspberry Pi without having any issues that way you can switch mobile phones back and forth without having to alter any configs.
Not working on Android
Not working on iPhone
Disclaimer: Below are instructions to make this go. You need to be familiar with Linux and have access to your image (SSH or VNC/Terminal). Please BACK-UP your WORKING IMAGE before proceeding. I do not warranty anything. This is merely a guide of how I got it done.
BugDroid your friend? Here are Android instructions
Login via SSH to your Raspberry Pi.
Type this in:
ifconfig -s
It should show eth0 and lo at a minimum.
Let's add the USB interface to our network configuration that Android creates when it gets plugged in.
Type this in:
sudo nano /etc/network/interfaces
add this to the bottom of the file:
allow-hotplug usb0
iface usb0 inet dhcp
You can save it now.
Let's restart networking by typing this in:
sudo /etc/init.d/networking restart
Now plug in your Android phone to your Pi.
Enable USB tethering on your Android device:
Settings → Connections → Tethering and Wi-Fi hotspot → USB tethering (Please be aware that this may be different depending if the manufacturer has made any customizations to Android.)
The Raspberry automatically should be getting an IP address via its USB0 port. The Android device behaves like an NAT router. When your device is connected to either Wi-Fi or a mobile 3G/4G network, it should work.
Run this command:
ifconfig -a
You should see a minimum of three interfaces now: eth0, lo, and usb0
Your Raspberry Pi should now have internet access via the USB.
Is Steve Jobs your spiritual leader? Ok then, here are iPhone instructions...
Login to your Raspberry Pi via SSH.
Type this in:
ifconfig -s
You should at minimum see eth0 and lo.
Let's install some software that's required for your iPhone.
sudo apt-get install gvfs ipheth-utils libimobiledevice-utils gvfs-backends gvfs-bin gvfs-fuse ifuse -y
Now plug in your iPhone to the USB port.
Let's enable hotspot on your iPhone (steps are for iOS9):
Settings → Cellular → Personal Hotspot → Enable
Run this command again:
ifconfig -s
You should see three interfaces.
eth0, lo, and eth1 (most of the time eth1 is the default interface name for the iPhone)
Let's add the interface that the iPhone creates to the networking configuration.
Type this in:
sudo nano /etc/network/interfaces
Add this to the end of the file:
allow-hotplug eth1
iface eth1 inet dhcp
Save it and restart networking.
sudo /etc/init.d/networking restart
After networking has restarted type this in and see if eth1 has an IP assigned to it.
ifconfig -a
The Raspberry automatically should be getting an IP address via the USB tether.
You can have these both configured on your Raspberry Pi without having any issues that way you can switch mobile phones back and forth without having to alter any configs.
Not working on Android
- Go to Settings -> Connections -> Tethering -> WIFI Hotspot -> USB Tethering (make sure it is on)
- Turn USB Tethering OFF, wait a few seconds, and turn it back on
Not working on iPhone
- Settings → Cellular → Personal Hotspot → Enable
- Turn your Personal Hotspot OFF, wait a few seconds, and turn it BACK ON
- Make sure to click TRUST on your phone when you connect the cable