YodaVonBeck
Posts: 38
Joined: Wed Mar 16, 2016 10:03 am

Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Sat Apr 11, 2020 11:03 pm

Just got one as my old 3 version will be built into a case with sensors.

I would like to be able to connect my RPi with my Windows PC when I am traveling, so is there a way, where I dont have to worry about setting up the RPi on a local LAN/Wifi - in other words run both the PC and RPi offline.

My laptop does not have a ethernet port, but it does have a USB C port.

Any ideas?

W. H. Heydt
Posts: 12416
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Sat Apr 11, 2020 11:11 pm

You could configure the Pi4B as a WiFi access point and then log into it from your laptop. I have a Pi0W set up that way.

User avatar
Botspot
Posts: 1240
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Sat Apr 11, 2020 11:15 pm

YodaVonBeck wrote:
Sat Apr 11, 2020 11:03 pm
Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?
Yes it is. It's a new feature of the Pi4 called OTG. See: viewtopic.php?t=243966
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

User avatar
HawaiianPi
Posts: 5703
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Sun Apr 12, 2020 12:12 am

Botspot wrote:
Sat Apr 11, 2020 11:15 pm
Yes it is. It's a new feature of the Pi4 called OTG. See: viewtopic.php?t=243966
The problem will be powering the Pi4 when it's connected to a PC USB port.

While the Pi Zero can easily be configured as a USB Gadget, it's power requirements are minimal and it can run off a PC USB port.

The Pi 4B, on the other hand, is a lot more power hungry and may draw significantly more power than a typical PC USB port can deliver. Even PC USB ports configured for high current fast charging usually have to negotiate with the connected device to enable it (which the Pi won't do).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
thagrol
Posts: 2955
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Sun Apr 12, 2020 2:16 pm

Botspot wrote:
Sat Apr 11, 2020 11:15 pm
YodaVonBeck wrote:
Sat Apr 11, 2020 11:03 pm
Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?
Yes it is. It's a new feature of the Pi4 called OTG. See: viewtopic.php?t=243966
It's not a new feature. It's been around on some models since shortly after the zero launched.

The 4B is, however the first B model to support it.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

User avatar
thagrol
Posts: 2955
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Sun Apr 12, 2020 2:19 pm

HawaiianPi wrote:
Sun Apr 12, 2020 12:12 am
The problem will be powering the Pi4 when it's connected to a PC USB port.
That isn't really a problem. I can think of at least three ways to do it:
  1. Via the GPIO header
  2. Via the test points on the board (don't ask me which ones though)
  3. Use a "Y" cable to inject power via the USB C port.
In all the above cases you'd want to cut the 5v wire between the host PC and the 4B though.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

YodaVonBeck
Posts: 38
Joined: Wed Mar 16, 2016 10:03 am

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Sun Apr 12, 2020 11:12 pm

W. H. Heydt wrote:
Sat Apr 11, 2020 11:11 pm
You could configure the Pi4B as a WiFi access point and then log into it from your laptop. I have a Pi0W set up that way.
Didnt think of that. Would it enable me to connect to the RPi using f.ex. VNC?
An other option is to use my mobile phone as a hotspot for both the RPi and laptop.

W. H. Heydt
Posts: 12416
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Mon Apr 13, 2020 12:30 am

YodaVonBeck wrote:
Sun Apr 12, 2020 11:12 pm
W. H. Heydt wrote:
Sat Apr 11, 2020 11:11 pm
You could configure the Pi4B as a WiFi access point and then log into it from your laptop. I have a Pi0W set up that way.
Didnt think of that. Would it enable me to connect to the RPi using f.ex. VNC?
I've never tried that, but I can't see why it wouldn't work.
An other option is to use my mobile phone as a hotspot for both the RPi and laptop.
Or any other shared access point, either wireless or wired.

ejolson
Posts: 5165
Joined: Tue Mar 18, 2014 11:47 am

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Mon Apr 13, 2020 3:33 am

My understanding is if your laptop has a USB-C port on it that supports power delivery and you have one of the new Pi 4B that is compatible with the same, then you should be able to power the Pi and transfer data all through the same USB-C to USB-C cable. I have not tried this myself, due to lacking both a new enough Pi 4B and a suitable laptop, but if you have both, I'd be very interested to know if the laptop will at least power the Pi sufficiently. After that, running Ethernet through the USB cable should be easy.

User avatar
HawaiianPi
Posts: 5703
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Mon Apr 13, 2020 10:16 am

ejolson wrote:
Mon Apr 13, 2020 3:33 am
My understanding is if your laptop has a USB-C port on it that supports power delivery and you have one of the new Pi 4B ...
Oh yea, forgot about that. With the older Pi 4B (v1.1) you might not get any power at all from a PD USB-C port. Of course, that's also fixable.

What are you going to be doing with your Pi 4B when you travel with your laptop? Would a Pi Zero (or 0W) suffice? Much less power hungry, simpler to configure, and easier to pack.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
thagrol
Posts: 2955
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Mon Apr 13, 2020 12:11 pm

ejolson wrote:
Mon Apr 13, 2020 3:33 am
My understanding is if your laptop has a USB-C port on it that supports power delivery and you have one of the new Pi 4B that is compatible with the same, then you should be able to power the Pi and transfer data all through the same USB-C to USB-C cable. I have not tried this myself, due to lacking both a new enough Pi 4B and a suitable laptop, but if you have both, I'd be very interested to know if the laptop will at least power the Pi sufficiently. After that, running Ethernet through the USB cable should be easy.
Unless there has been a major change in the new revision of the 4B it doesn't support power delivery. The resistor problem that stopped smart cables from working has apparently been fixed but that's all.

At least that's my understanding of things.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

User avatar
dickon
Posts: 1436
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Mon Apr 13, 2020 1:33 pm

Mine, too. All the resistor fix does is state that the thing isn't a pair of headphones, so it wouldn't mind being fed some power, please. What I can't seem to fathom from the Wikipedia page is what the default power supply from a suitable device actually is: 5V@500mA, 900mA, 3A, or 5A. And how much logic is needed to request higher values, if you can't rely on being able to draw what you want.

PiGraham
Posts: 3929
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Mon Apr 13, 2020 1:46 pm

HawaiianPi wrote:
Sun Apr 12, 2020 12:12 am
Botspot wrote:
Sat Apr 11, 2020 11:15 pm
Yes it is. It's a new feature of the Pi4 called OTG. See: viewtopic.php?t=243966
The problem will be powering the Pi4 when it's connected to a PC USB port.

While the Pi Zero can easily be configured as a USB Gadget, it's power requirements are minimal and it can run off a PC USB port.

The Pi 4B, on the other hand, is a lot more power hungry and may draw significantly more power than a typical PC USB port can deliver. Even PC USB ports configured for high current fast charging usually have to negotiate with the connected device to enable it (which the Pi won't do).
I had no problem powering a Pi4B 4GB from my desktop USB3.0 port. The Pi was acting as an OTG HID keyboard.

That is a minimal load, no USB peripherals connected, low CPU loading. I expect that trying do serious processing would fail with this setup.

hippy
Posts: 7440
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Is it possible to connect to a PC using the USB-C port on Raspberry Pi 4?

Mon Apr 13, 2020 2:43 pm

dickon wrote:
Mon Apr 13, 2020 1:33 pm
All the resistor fix does is state that the thing isn't a pair of headphones, so it wouldn't mind being fed some power, please. What I can't seem to fathom from the Wikipedia page is what the default power supply from a suitable device actually is: 5V@500mA, 900mA, 3A, or 5A. And how much logic is needed to request higher values, if you can't rely on being able to draw what you want.
According to the USB-C spec I have, which I won't pretend to fully comprehend, the Rp/Rd and/or Rp/Ra resistor values determine what is desired or supplied depending on the voltages they present on the CCx pins when connected ( or not ).

AFAICT the default for a USB 3.2 connection is to supply 5V @ 900mA. But appropriate Rp/Rd and/or Rp/Ra resistor selections can request 5V @ 1.5A or 3A.

Presumably the 4B is configured to request 3A.

In addition, which resistors are fitted to the CCx lines and how indicates what type of device it is to the other side. This is what the original Pi USB-C design flaw was; the joined connection advertised the Pi as something other than it was. This was resolved in the later revision.

There were other potential issues with the original relating to VCONN connections over CCx pins which I would hope have also been resolved. I can't check because only the partial schematic for the first revision has been published and don't have datasheets for all components used.

Return to “General discussion”