Usb tether

I have been trying to set up usb tethering from my phone to my osmc pi 3+ since last night. I do not have internet here so i use my phones, i was able to do it under raspbian.

I thought it would be the same but i cannot for the life of me to get this to work. I have created a file in /etc/network/interfaces

In that file is
auto eth1
allow-hotplug eth1
iface eth1 inet dhcp 《also tried static

This did nothing eth1 still has no ip, I then tried
connmanctl tether ethernet on
I now have a new interface named tether but still no internet and eth1 still shows no ip while tether shows local 192.168.0.1.

Any help would be much appreciated. I have search and searched for a solution but all i can find is topics about gigabit.
Edit: I also tried setting the connman.prefs to yes to enable dns proxy. Forgot to mention.

Probably the simplest way is to use your phone in tethering mode (mobile hot-spot) and connect the Pi with WiFi.

If not, what is the output of ifconfig when the phone is plugged into USB?

Yes that is the simplest way and wish I could continue that route but my phone tends to run hot when hotspot is enabled. While the tether seems to run flawlessly

Output:

    osmc@osmc:~$ ifconfig -a
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether b8:27:eb:0e:11:d4  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=-28670<BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether 00:00:00:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 248  bytes 21047 (20.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 248  bytes 21047 (20.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tether: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.0.1  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::ecd2:a5ff:feb9:fb48  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:0e:11:d4  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2  bytes 164 (164.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.43.86  netmask 255.255.255.0  broadcast 192.168.43.255
        ether b8:27:eb:5b:44:81  txqueuelen 1000  (Ethernet)
        RX packets 506  bytes 54580 (53.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 419  bytes 69332 (67.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0.

Can you get rid of the tether and post ifconfig again? There’s no reason to be using tether.

osmc@osmc:~$ connmanctl tether ethernet off
Disabled tethering for ethernet
osmc@osmc:~$ ifconfig -a
eth0: flags=-28670<BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether b8:27:eb:0e:11:d4  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=-28670<BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether 00:00:00:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 248  bytes 21047 (20.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 248  bytes 21047 (20.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.43.86  netmask 255.255.255.0  broadcast 192.168.43.255
        ether b8:27:eb:5b:44:81  txqueuelen 1000  (Ethernet)
        RX packets 1084  bytes 108826 (106.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 795  bytes 124922 (121.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Delete the file you put in etc/network/interfaces. If I plug my phone into a Pi running OSMC it just works:

osmc@pi2b:~$ ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether b8:27:eb:be:9f:dd  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.42.146  netmask 255.255.255.0  broadcast 192.168.42.255
        ether 3a:9c:f2:fd:c1:36  txqueuelen 1000  (Ethernet)
        RX packets 16  bytes 1550 (1.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 29  bytes 11911 (11.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.1.23  netmask 255.255.255.0  broadcast 192.168.1.255
        ether b8:27:eb:eb:ca:88  txqueuelen 1000  (Ethernet)
        RX packets 714  bytes 284062 (277.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 500  bytes 68136 (66.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Phone needs setting as a USB modem of course and wired networking needs to be on in MyOSMC.

Thats a no go for me boss, same result as last ifconfig. Rebooted as well, I’m also metering my phones data to see if its even attempted to pull any sort of data and nothing.

Glad to atleast see osmc picks up my phones eth1. Raspbian I had to create the interface file because the s7 doesn’t work off usb0.

So the phone insists on being called eth1? What happens if you go

ip link set eth1 up

Yes sir, and same as when I create the interface file.

osmc@osmc:~$ sudo ip link set eth1 up RTNETLINK answers: Cannot assign requested address.

I used to get the same error on raspbian thats why i created that file it solved it there but here idk

I’m getting to the edge of my knowledge here and I don’t know if Raspbian uses connman. I can successfully connect to the internet through USB with devices that indentify as usb0 (phone and dongle) or wwan0 (mobile broadband puck). I’m guessing the issue is connman’s refusal to recognise more than one device per technology, so the built-in eth0 is getting in the way.

But how to fix?:man_shrugging:

Thinks: is tethering via Bluetooth an option?

Well I appreciate the help, I will keep at it. Im sure I will figure it out soon as I can find a way around connman. I dont believe raspbian does ill have to pop that hdd in and check.

I have tried bluetooth tether and managed to get it working but there is a bug in bluez thats been there for years and has yet to be fixed. Itll connect but kill bluetooth after a couple mins. Fix is to cold start the pi each time. Not really worth the hasle.

Raspbian almost certainly uses NetworkManager.
But if OP is using /etc/network/interfaces; then this should be achievable under the classic ifupdown package.

Sam

Yes should be but connman seems to block eth1 at every turn. Raspbian is on my hdd, this is the stock oscm img on the sd downloaded last night.

I got tired of playing with it, searched everywhere for a solution. So now im installing networkmanager and dhcp client from scratch. Went ahead and removed connman. Just about there with dhcp. Not the way to go but I’m bored.

Ok so after installing dhclient and network manager I was still failing to connect. What I failed to notice was my mac was null the entire cant connect without a mac.

So I created a startup script to assign the eth1 device a mac and rerun dhclient to abtain an ip. Also in order for it to work on startup I had to make my tether start automatically when the pi powered on. But seems to be working right now few hiccups here and there.

I’m sure anyone else running the s7 as a usb tether can use this without removing conman. Just need to set the mac in order to get it to work.

IFNAME=eth1
ip link set dev $IFNAME down
ip link set dev $IFNAME address d2:12:20:69:41:91 
ip link set dev $IFNAME up
dhclient $IFNAME
2 Likes

@Dobbytwisted you’re a life saver!!

I was running a Samsung Galaxy S7 Edge and trying to use USB Tethering to connect by Raspberry Pi 3 B+. I’d never have thought to fix the empty MAC address. Thanks for the pointer – everything’s working perfectly now.