USB‑C Raspberry Pi to Tablet Setup
Key Points
- The author demonstrates how a USB‑C cable can simultaneously provide Ethernet networking and power from an iPad Pro (or any USB‑C iPad) to a Raspberry Pi 4, creating a portable Linux workstation.
- To also keep the iPad charged, two options are shown: using an Apple Magic Keyboard for an extra USB‑C port (a clean but pricey solution) or a budget‑friendly USB‑C hub that supplies power to both devices.
- The video expands the basic setup to support Lightning‑based iPhones/older iPads, Android USB‑tethering, and even older Pi models (e.g., Pi 3) by adding appropriate adapters and power‑management tricks.
- As a universal fallback, a pure Ethernet‑over‑USB or wired Ethernet configuration is covered for situations where USB‑C or Lightning connections aren’t viable, ensuring compatibility with a wide range of single‑board computers.
Full Transcript
# USB‑C Raspberry Pi to Tablet Setup **Source:** [https://www.youtube.com/watch?v=cD3JN8BHosI](https://www.youtube.com/watch?v=cD3JN8BHosI) **Duration:** 00:13:29 ## Summary - The author demonstrates how a USB‑C cable can simultaneously provide Ethernet networking and power from an iPad Pro (or any USB‑C iPad) to a Raspberry Pi 4, creating a portable Linux workstation. - To also keep the iPad charged, two options are shown: using an Apple Magic Keyboard for an extra USB‑C port (a clean but pricey solution) or a budget‑friendly USB‑C hub that supplies power to both devices. - The video expands the basic setup to support Lightning‑based iPhones/older iPads, Android USB‑tethering, and even older Pi models (e.g., Pi 3) by adding appropriate adapters and power‑management tricks. - As a universal fallback, a pure Ethernet‑over‑USB or wired Ethernet configuration is covered for situations where USB‑C or Lightning connections aren’t viable, ensuring compatibility with a wide range of single‑board computers. ## Sections - [00:00:00](https://www.youtube.com/watch?v=cD3JN8BHosI&t=0s) **Pi‑Tablet USB‑C Connection Guide** - The video walks through various methods for linking a Raspberry Pi (Pi 4 and older models) to iPads, iPhones, and Android devices via USB‑C, Lightning, and USB tethering, covering power delivery, networking, and setup options. ## Full Transcript
in today's video i'll walk you through a
bunch of different setups for connecting
your raspberry pi with your tablet or
your smartphone i've been using my ipad
pro together with the raspberry pi 4 as
a mobile computing setup for around
about two years now in my setup the pi
and ipad are connected using a single
usb-c cable allowing them to talk to
each other and providing the pi with
power from the ipad if you'd like to see
more about that setup and what i use it
for i have a video going into detail on
that here
now this is a great setup for ios users
in particular because it allows you to
carry a fully fledged linux setup with
you alleviating the need to rely on
connectivity back to your home office or
to the cloud
if you already have a tablet i also
think this is a great way to start
learning about linux and about the
raspberry pi without having to invest in
a ton of new hardware we're going to
look at a bunch of different
configurations in today's videos and
i've put timestamps in the description
for each of these sections we'll start
with a simple one cable setup for the pi
4 that works with usbc ipads and we'll
expand that solution adding various
options for powering those two devices
we'll expand even further to look at
lightning based devices like the iphone
and older ipads and then we'll go a step
further to look at a really nice usb
tethering solution that works on android
that works on some ios devices and that
supports older pies like the pi 3. and
then finally we'll look at a pure
ethernet based solution that is a great
fallback for other single board
computers when none of these setups will
work for you and your devices let's get
started with the simplest possible wired
setup a single usbc cable connecting a
usbc ipad and the raspberry pi 4. i'm
using the gen 5 ipad air here but as of
the time of filming this setup works
with any of the usb-c capable ipads
connectivity between the ipad and the pi
is ethernet over the usbc cable and
power is also delivered from the ipad
to the pi on that same usbc cable
and this is where the first limitation
of this setup arises there's no way to
power the ipad at the same time as
powering the pi
one way of addressing this is to
introduce the apple magic keyboard
with the magic keyboard in the mix you
get an extra usbc port for powering the
ipad and the pi at the same time and you
can still use the ipad's primary port
for connectivity between the two devices
now this is the setup that i use and i
do think it's the cleanest setup but it
is expensive the price of the magic
keyboard always discomforts me and if i
didn't use it so often
i would absolutely look for a cheaper
option for this setup the best of which
is to use a usbc hub pretty much any
usbc hub that accepts power input will
do here i bought this anchor seven in
one hub with my own money not sponsored
which has usbc power in and a usbc data
port the hub gets plugged into the ipad
power gets plugged into the hub and then
the pi is plugged into the hub's usbc
data port
if you're working with a setup like this
and you're having issues make sure that
you're plugging the hub's captive cable
into the ipad and not into the pi
usbc hubs or usb hubs are directional
and one port is designated for the host
with the rest being for downstream
peripherals or power input
if your usbc hub doesn't have a captive
cable it will likely have a port
explicitly labeled for the host this is
a nice setup to avoid having to buy a
magic keyboard and you get the added
benefits of all the ports on the hub if
you already have a usbc hub but it's one
without a usbc data port don't worry you
can use a usba to usbc cable on your
hub's usba ports to connect the pi
without any problems at all it's worth
taking a minute just to understand how
this setup is working by default both
the ipad and the raspberry pi want to be
usb hosts that is that they want to have
usb peripherals like hard drives and
webcams plugged into them
in this setup though the ipad remains as
a usb host but the pi is configured to
act as a usb peripheral specifically
it's configured to act as a usb ethernet
adapter
this is enabled by a technology called
usb otg or usb on the go the pi 4 only
supports otg on each usb c port which is
quite handy because we can then get
connectivity and power through that
single port as we'll see though all the
single board computers like the
raspberry pi 3
don't support otg at all and will need a
different solution you do need a little
extra configuration in your os to enable
otg on the pi 4. i'm not going to
discuss that here because i have a bunch
of videos and guides on my website
discussing the various configuration
options for the various different linux
distributions and i've linked all those
below as we've seen it's easy to connect
a usbc ipad to the pi 4 and we have
plenty of options for power but what
about ipads with lightning ports what
about the iphone
although it's not possible to get by
with just a lightning to usbc cable it
is possible to connect the pi 4 and the
lightning based ios device with just a
few pieces of equipment first up you
will need a lightning usb to otg adapter
apple has a few first party options
often referred to as being a camera kit
or a camera adapter for example i have
this official apple usb 3 camera adapter
that works really well and i've also had
some success with cheaper third-party
adapters and i'll link a few in the
description below lightning devices
don't provide enough power for the pi 4
so you'll also need a powered hub which
can be either usb-a-hub or a usb-c hub
start by connecting the otg adapter to
your lightning device i'm using my
iphone here next up plug your hub into
the otg adapter remembering to power the
hub from there connect the usbc port
from the pi to the hub it's absolutely
fine to use a usbc to usb a cable here
if your hub only has usb ports
if you're looking for a hub for this
setup i picked up this cheap you green
hub for testing purposes and it works
just fine even if it does feel a little
bit plasticky most of the lightning otg
adapters i've seen take usb a input not
usbc input
so if you have a usbc hub with a captive
host cable you'll need an adapter and i
picked up this cheap adapter on amazon
that has worked well for me so this
setup is a little messy than the one for
the usbc ios devices but it does work
just as well and it's much cheaper than
upgrading to a usbc ipad just to try
this out i want to note at this point
that the pi doesn't share the internet
connection from the ios device in any of
the setups that we've seen so far you'll
need to connect the pi to wi-fi
separately this can be the hotspot on
your cell phone or on your cellular ipad
if you have one but this does not happen
automatically this video is brought to
you by the techcraft patreon all patrons
get access to the private techcraft
discord exclusive behind the scenes
content early access to every video and
input on future videos patrons on the
channel championship got access to a
monthly video hangout and an exclusive
monthly deep dive tutorial
this month's tutorial is a step-by-step
guide to automatically building your own
raspberry pi images link to the patreon
in the description below let's now turn
our attention to android devices and i
want to start with two disclaimers first
up android devices are way more varied
than ios devices so i can only provide
broad guidance to what should work
second i only have one android device
myself and i've only had it a few months
so it's possible there are other
connection options here and if you know
of any such options please do share them
in the comments below i'm using a
samsung galaxy tab sa ultra for my setup
and this device powers the pi 4 just
fine from the usb c port but i've had
limited success
getting the single cable usb otg setup
to work my essay seems to get confused
about which device is the host which is
the peripheral
i don't want to say that this
definitively doesn't work um but i can't
get it to work reliably
that's okay though because there's
another solution for android one that i
think is particularly attractive
in this solution we're going to flip the
usb rolls around we'll make the pi the
host and have the android device be the
peripheral to do this you'll want to run
your pi with the stock os configuration
and not with the otg peripheral
configuration needed by the previous
setups power up the pi and then connect
any of the usb a ports not the usb c
port this time to your android device
the sa ultra has a usbc port so i'm
going to use a usba to usb c connector
then in your android device enable usb
tethering
after a second or two your android will
configure itself to act as a virtual
ethernet adapter and you're free to
connect to the pi
however
you don't yet know the ip address of the
pi and you can't use the pi's host name
because most android systems don't
support zero comp networking out of the
box
not to worry though we can solve this
using the excellent termix app
in turmoix which you will probably need
to install using f droid these days
install the nmap package with pkg
install nmap
and then let's do a port scan like we're
in mr robot
to find out what to scan let's first
find out the address of the android
device itself using the ifconfig command
and for my usb 0 interface you can see
that i have an address starting with 192
168 175
so
i'll run nmap with dash p22 to scan port
22
dash dash open to look for open ports
and then 192.168.175.0.24
to scan all of the addresses between
192.168.1.751
and one nine two one six eight one seven
five two five five so basically try to
find what address has been assigned to
the pi after a few seconds you'll see
the results complete with the ip address
of your pi and then you're free to log
in over ssh
now the best part of this setup is that
the pi can share the internet connection
from the android device so if we disable
the wi-fi connection on the pi we can
use sudo ifconfig wlan zero down to
disable wlan zero adapter we can still
access the internet from the pi
another benefit of using usb tethering
this way is that it also works on the pi
3 and probably works on older pies too i
just don't have any working devices that
i can test on
this setup may even work well on non-pi
single board computers the only downside
of this setup is that the pi is now
powering the android device over its
basic usb a port and for a tablet like
the sa ultra this is just simply not
enough power and i found that my s8
seems to slowly discharge over time in
this setup but you can always experiment
with putting a powered hub in line if
you want to get more power
although i will say i've had mixed
results with this setup the same usb
tethering solution that works so well on
android also works on the iphone and on
cellular ipads
sadly there's no usb tethering support
on wi-fi only ipads
i've no idea why
only three steps are needed firstly you
need to install the usb mux-d package on
your raspberry pi which you can do with
sudo apt-install usb mux-d on the
standard raspberry pi os
next connect the usb-a port on your
raspberry pi to your ios device and this
time you can use a standard usb to
lightning cable you don't need any
special otg adapters here when you
connect you'll be prompted to trust the
device so click yes to trust and then
finally in ios settings
make sure that you enable your personal
hotspot
now you're free to connect to the pi
from your ios device and as with the
android setup we can disable the wi-fi
on the pi and share the cellular
connection from the ipad or the iphone i
think that the tethering solution is the
best approach for older pies and also
the best approach for cell phones since
the pi can satisfy their power draw and
can share the internet connection
obviously for tablets you won't be able
to satisfy the power draw so you might
want to look to the solutions at the
start of the video
if none of the solutions so far fit your
phone fit your tablet fit your single
board computer then you can likely fall
back on using a standard ethernet cable
to connect the devices for this setup
you'll need some kind of usb ethernet
adapter for your tablet or your
smartphone this can be a dedicated
adapter it can be a usb hub with a
dedicated adapter or it can be a usb hub
that has ethernet built in already
so for example i've got my ipad air here
and i've connected my wife's usb c hub
which is a three or four year old
hyperdrive model that does happen to
have an ethernet port built in
i can connect this port to the ethernet
on my pi using a standard ethernet cable
here and then power the pi using a usb
cable from one of the hub's usb ports
straight out of the box with stock
raspberry pi os the pi is accessible
over ssh there's no changes needed so
you don't need the otg configuration
here
there's nothing special about this setup
there's nothing specific to the pi so it
works with the pi 4 as well and it
should also work with pretty much any
single computer that runs linux and has
an ethernet adapter
you may need some configuration though
to get things like hostname resolution
working in summary then we've seen a
bunch of different solutions for
connecting tablets and smartphones with
single board computers like the
raspberry pi i'm sure at least one of
the solutions shown in this video will
work for you and for your devices and i
hope that you enjoyed trying them out i
also hope that you found this video
useful and maybe even a little
entertaining if so please hit like
please hit subscribe and maybe hit the
bell as well so you don't miss out on
any future content thanks so much for
watching and i'll see you in the next
video