Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: jbbum on July 25, 2021, 12:23:26 PM

Title: How to setup usbip for connection to cell phone
Post by: jbbum on July 25, 2021, 12:23:26 PM
Looking for the extensions necessary to get cell phone connected through usb for tethering.
Title: Re: How to setup usbip for connection to cell phone
Post by: Juanito on July 25, 2021, 12:32:06 PM
I seem to recall somebody had networkmanager working with a mobile to make an Internet connection in piCore-9.x
Title: Re: How to setup usbip for connection to cell phone
Post by: vinnie on July 25, 2021, 12:49:32 PM
If it is for android usb tethering you don't need anything more of base tc.
Now I don't have tinycore started but going by memory you have to:
1) connect the phone
2) activate usb tethering
3) open the graphical interface for network management
4) set usb0 as interface name
5) select dhcp

and it should work.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 25, 2021, 01:15:34 PM
Guess I need to explain my need.  I have the pi3 onboard wifi setup as an AP.  Basically, I want to use the pi as a wifi repeater by connecting to a cell phone using usb tethering because eth0 is not available.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 25, 2021, 01:17:05 PM
The setup is headless.  No gui. 
Title: Re: How to setup usbip for connection to cell phone
Post by: Juanito on July 25, 2021, 01:25:51 PM
Modemmanager/networkmanager have a cli interface.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 25, 2021, 04:23:34 PM
I think I need to start over.  Raspbian has the ability to recognize the usb tethering of a phone.  It registers usb0 as a device and gives it an ip.  Then you can ping over it and get a response.  I am looking for the extensions necessary to make this work on piCore without using network manager.
Title: Re: How to setup usbip for connection to cell phone
Post by: Rich on July 25, 2021, 05:23:18 PM
Hi jbbum
You might need the  usbip  kernel modules extension.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 25, 2021, 06:12:31 PM
Hi Rich.  I loaded those modules but no usb0.  Swapped with the net-usb modules and now have the usb0.
rndis_host 1-1.4:1.0 usb0: register 'rndis_host' at usb-3f980000.usb-1.4, RNDIS device, aa:34:06:61:71:7b
[   91.231022] usbcore: registered new interface driver rndis_host.
 Now have to find a procedure to access the interface driver.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 25, 2021, 06:38:55 PM
ifconfig -a does give a usb0 device
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 26, 2021, 11:08:46 AM
I can now get usb0 setup by "sudo ifconfig  ${interface}  ${ipaddr}  netmask  ${netmask}  up"
But, can't access it.  Did a ping -I usb0 but no results.
Title: Re: How to setup usbip for connection to cell phone
Post by: Rich on July 26, 2021, 11:19:31 AM
Hi jbbum
... Did a ping -I usb0 but no results.
I don't see an IP address included in that command.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 26, 2021, 11:40:42 AM
Did the ping to 8.8.8.8.  No results except over eth0
Title: Re: How to setup usbip for connection to cell phone
Post by: Rich on July 26, 2021, 11:53:39 AM
Hi jbbum
What happens if you try to ping a local address, like your router or another computer?
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 26, 2021, 12:26:12 PM
Hi Rich  Can't ping anything on local network because not connected except eth0.  usb0 is to tether to a cell phone and use that as access to the internet.  There is no wireless connection to local network.
Title: Re: How to setup usbip for connection to cell phone
Post by: curaga on July 26, 2021, 12:38:05 PM
With just an IP set, you can only ping the other end and stuff on that network. To connect to other networks via it, you also need to set up a route. (and DNS to use names).

Having two internet connections complicates things. Disable your eth0 first, then play with usb0. If your phone offers DHCP, you can do via cli what vinnie wrote above, udhcpc is the bundled dhcp client.
Title: Re: How to setup usbip for connection to cell phone
Post by: Rich on July 26, 2021, 12:41:11 PM
Hi jbbum
Maybe you need to add routing information. When setting up  eth0  you execute a command similar to:
Code: [Select]
route add default gw 192.168.1.1so that  eth0  knows how to reach the outside world. You may have to do something similar using the cell phones
IP address as a gateway.

5) select dhcp
Or maybe you need to do something with dhcp.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 26, 2021, 06:05:00 PM
Got that problem solved.  After the "ifconfig.............up" statement from previous to bring the usb0 interface up, doing "sudo dhclient usb0" allowed access.  Can now "ping -I usb0 8.8.8.8" and get a result.    In the process of trying to enable packet forwarding to bridge the wireless ap and usb0.
Title: Re: How to setup usbip for connection to cell phone
Post by: jbbum on July 26, 2021, 06:26:03 PM
I apologize.  The command is "sudo dhcpcd usb0" not dhclient.
Title: Re: How to setup usbip for connection to cell phone
Post by: honeydatax@sapo.pt on August 18, 2021, 03:19:18 AM
Use my depedency builder tree

https://github.com/honeydatax/tinycorelinux/blob/main/dep.bas
 To know all the files you need to install