USB-C dock C13NANODOCKLANLP and power supply

As good as i understand USB, this is a just a regular procedure and not a particularity of this device. It is just, that the altered changing situation is re-negotiated with the devices.

If you go through a USB-C hub and plug each device separately and directly in to the hub, then it seems like each device should negotiate independently with the hub, to provide the needed power to each respective device. The L5 will probably be the biggest power draw, while a keyboard might draw very little current. When the load is higher (higher resistance), the voltage has to be turned up to force the intended voltage (5V to 6V in to the load) in to the L5 battery while also satisfying the load of the phone itself at the same time. If the keyboard were in that same circuit, it might see 20V under these conditions. That is why each device should be plugged directly in to the hub, in to a different port. So it’s probably about finding the right smart hub. The article where a laptop docking station is the power supply is best idea in my opinion. I didn’t think of that myself until I read the article. Laptop batteries require a lot of charging power. A USB-C with Thunderbolt 3 might be overkill for the Librem 5. But it will probably work. I have a USB-C with Thunderbolt 3 as a docking station for a Lenovo laptop. It is just a glorified power supply without the plastic shell to snap the laptop in to. The power supply / Thunderbolt 3 brick just sits on the table next to the laptop (could be phone).

If you want to, you could build yourself a USB-C input/output adaptor that would allow you to break in to the circuit to take a current measurement. Just be careful not to take a current measurement directly accross an unconnected load (except your connected current meter). I carelessly did that recently and was surprised that it only destroyed my power supply and left the meter un-damaged. I forgot to change the meter to measure voltage before making that connection.

@StevenR, i’ve seen elsewhere, that the L5 does not work with Thunderbolt. It is not clear to me yet, whether this is a restriction of the L5’s hardware or software. The other way round, if a dock supports Thunderbold does not necessarily mean, that it does not work with the L5.

You are probably correct. Maybe the Thunderbolt can not recognize the L5 and doesn’t know how to deal with it. I wonder if Purism was assigned a number to identify the device. A programmer at work that reports to me says that if you publish a new USB device driver, that you should register it somewhere so that anyone in the world who encounters your device, will know who you are and how to talk to your device. If you use unregistered numbers or someone else’s numbers, your device might only work for the hardware you got it working with in your own self-written driver. I don’t know the name of the organization that issues these numbers.

https://www.usb.org/getting-vendor-id

Not cheap though.

1 Like

The USB id comes with the device. With the firmware on it, to be more precise. So a driver will only look for the id but need not provide a new one. Only if one flashes a new firmware to the device with different abilities than the original one might run into needing a different id.

No wonder so many software suppliers (even some bigger ones) tell you to ignore Microsoft’s big red-type warnings that tell you that the drivers have not been tested and may not be safe. What a racket. I wonder if Purism registered. Someone in the open-source community should start a counterpart organization and charge only $10 for registration or free if you interface with a database to register it yourself. That might work in Linux anyway.

1 Like

So you are saying that you know (in advance), without reading Powersupply numbers or any further testing (by choosing some more accurate/adequate testing method, external measurement device that you put in between involved/testing devices, their ports and cables in particular) that the electricity power draw from any to it provided charger (for example original one) is always the same (and sufficient), with this i-tec docking station (therefore original Important note cited), whichever cable (source or end device) you connect first, in direction of the L5 (or from it)? I’m simply not an expert and therefore asking.

@Quarnero. Err, …, yes and no. If the drivers and devices behave as they should, you should be able to (un-)plug everything in any order.

Basically, what is normally happening, is that the USB (root-) hub (in the L5) initially provides enough power to a new device to power it up enough so that it can announce itself. After so knowing the power demands of the device, the hub provides the power the device want, if it can, and set the devices into another, more power-demanding state.

What we here, is i think USB-PD, where power is not only delivered from the PC downstream to the devices, but upstream. Again, this need to be negotiated in some way, which i conjecture might go wrong right now. The L5 would be responsible to collect the power needs and abilities and manage their power settings.

1 Like

I like your explanation, and openness, thank you! Now is clear to me what I supposed that you want to achieve … get answer/promise that problems, as you described those in your first post, should not happen (at this point of development) with the recommended docking station, that should be 100% compatible with the Librem 5 (don’t know, but agree and respect your evaluation, current state evaluation).

Now that a 5.11 kernel is released. i gave it a shot:

 # uname -a
 Linux pureos 5.11.0-1-librem5 #1 SMP PREEMPT Thu Feb 25 00:39:01 PST 2021 aarch64 GNU/Linux

The result is, that the dock now appears to behave as it should. Most particular, i do not spot any suspicious kernel messages any more, i do see the usb-id (2109:0102) of the dock in lsubs (which was not the case before) and the dock appears to be properly powering the L5.

I did not intensively test the dock yet, but i plugged in the monitor and it connected absolutely smooth, which was not the case earlier. I ran iperf on the LAN:

$ iperf -c 192.168.0.134
------------------------------------------------------------
Client connecting to 192.168.0.134, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.17 port 54176 connected with 192.168.0.134 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.0038 sec   405 MBytes   339 Mbits/sec

Well, not exactly gigabit lan, but much faster than my wlan connection.

$ iperf -c 192.168.0.129
------------------------------------------------------------
Client connecting to 192.168.0.129, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.17 port 58506 connected with 192.168.0.129 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3] 0.0000-10.3139 sec  4.25 MBytes  3.46 Mbits/sec

Keyboard and mouse (i.e. usb connectors) work well too, and so do the SD/TF card slots and the even the head phone adaptor in the dock. All thumbs up.

From that findings, my search for just any dock with a power supply and enough connections ends here, with a good outcome. The result is, that the newer kernel fixes the issues i’ve so far seen with it.

1 Like

Thanks for sharing (again)! Looks like that here related docking station of yours is based on VL102 controller. I’ve just read this description anyway.

Hmm, it is not obvious, how to open the device, so i cannot check this easily by looking at the chip.

Oh my goodness – these docks are such interface-ninjas. The equation L5+dock=RegularPc definitely holds.

As one can expect that such docks to become more common in the near future, one could find one at the customer for some spontaneous work, even when one has not carried a dock with the L5.

1 Like

ID 2109:0102 VIA Labs, Inc. chip should be inside, therefore my previous post.

Yes, this would fit both from vendor (2109) and product (0102) id. You are most probably right and it is good to know that this chip is likely to appear in other product. Unfortunately, it is very difficult to get any technical information about most technical products before one actually buys them. They are often re-branded and the product sheet typically shows few more but an all happy family, including the dog.

I was a bit reserved, because i could not find any document that directly links the usb-id to the chip. Additionally, the usb-id of such chips can often be set to any other value. Also, i-tec claims that the dock is Thunderbolt-3 compatible, while the brief of the chip does not mentions Thunderbolt at all. But again, i think your finding is right.

I’ll probe some other docks i have here with the newer kernel and chances are, that the outcome might also be much better.

2 Likes

That was basically my thought as well, thanks for emphasizing this! For example someone that I know recently received LLANO LIN-CC1007 6-in-1 docking station (closely related to Green Cell 7-in-one USB-C Hub from your initial post list) end every port within it worked out-of-the-box (5.10-sunxi64 kernel) with PinePhone. lsusb reads its chips like this:
ID 05e3:0749 Genesys Logic, Inc. SD Card Reader and Writer
ID 05e3:0610 Genesys Logic, Inc. Hub

Don’t know which chip it uses for HDMI output yet this docking station scales (to external monitor) resolution to 2560x1440 60Hz easily. This resolution works too:


And if someone interested (special feature), I like to confirm that it supports OTG function (uses phone’s battery, discharging mode), including read/write to USB 3.0 flash drives (works with monitor as well but probably not for long):

NOTE: For charging other device (Linux smartphone here) with this HUB please use 5V/2.4A charger and USB-A to USB-C cable only (this note is based on my short experiment as I forgot for a second that PinePhone doesn’t support PD charging)!

Hmm, meanwhile i tried another dock with negative results. From the logs, it was such a disaster including kernel oopses, that i reboot the phone. Thus 5.11 brings some improvements, but is not resistant enough, to cope well with every device. Additionally, the dock is clearly branded. I’ll plug it into my notebook next, and if only to get down to the usb-id.

That a dock works well with pine phone does not mean it would work with the L5. I had negative results with the dock sold with the pine phone. Chances are, that this might work now with the newer kernel, but i’ve not tested it yet.

Given, that there is such plethora of usb-c docks offered, it would be nice to have attribute at hand for a buyer to check. There’s none so far. It thought might help, to look at the particular driver, but there is only few hints i could make use of e.g. here or here. The last link at least gives some information about the user space. Unfortunately lsusb does not provide much help here, yet.

1 Like

I do not have Pine64 one so cannot follow how that docking station behaves. Anyway, Powersupply app (with currently using llano docking station in between) and /sys/class/typec/port0-partner supports_usb_power_delivery file states no (kernel and/or self/external devices in use related, as I’m just trying to understand this). Let me philosophically say that main device/kernel still have main word about this partnership, even if Linux drivers available (or when available), hope I understood your advice right. Of course I need to visit device folder too, but no time at the moment. Thanks for sharing link to port0-partner usable info! And, I’m sure that this link belongs here (to include page 9):


Let my paraphrase myself (yourself?): Linux kernel, main one, particular distro one, provides shaking hand to the external device (particular port chip) or it doesn’t, so simple is this (not to spend unnecessary time with the wrong external device, even when it carries sound price or most recent name). Further reading about “Alternate Mode device” …

Here is link (starting point only) where you/someone should be able to find further official and useful info: http://www.linux-usb.org/.

0x4c35445000000200, hmm, looks familiar, its a firmware version, which i’ve already checked there.