Detect cable being plugged but not powered #97
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
DuckDuckGo and Google search Linux check if a cable with no power is plugged.
I have read the Stack Overflow question 16443522 thread.
I have read the Electronics Stack Exchange answer 95578 and its question.
https://chat.mistral.ai/chat/2b817982-eb68-4279-bf23-34c01ecaee15
I am not much interested in Ethernet. My usage is whether I forgot to enable the Wikipedia: AC power plugs and sockets#Multisocket adaptors (135014307).
https://chatgpt.com/share/69e629d8-7a04-83eb-b248-38b01cf0c331
Output:
while my Linux Mint 22.3 Cinnamon Framework 13 is charging with USB-C.
Mistral:
On Linux Mint 22.3 Cinnamon (or any Linux distribution), detecting a USB-C cable that is physically plugged in but not delivering any power (i.e., no data or power negotiation) is generally not straightforward. Here’s what you need to know:
USB-C Physical Detection: The Linux kernel can detect the presence of a USB-C connector if it is part of a USB device (like a hub, storage, or other peripheral) and if the device is recognized by the system. However, if the cable is just a passive connection (no data lines connected, only the physical plug), the system may not register it at all, as there is no electrical or data signal to detect.
Power Delivery (PD) Negotiation: If the cable is supposed to support USB Power Delivery but is not delivering power, the system may still detect the connection if the cable or device is recognized as a USB device. You can check kernel logs (
dmesgorjournalctl -k) for messages related to USB-C or UCSI (USB Type-C Connector System Software Interface) events. For example, some systems log messages likeucsi_acpi USBC000:00: UCSI_GET_PDOS returned 0 byteswhen a USB-C device is plugged in, even if power delivery fails.No Power, No Data: If the cable is truly passive (no data lines, no power delivery, and no device on the other end), the system will not detect it, as there is no electrical signal to trigger a detection event.
Practical Steps to Check:
dmesg | grep -i usborjournalctl -k | grep -i usbafter plugging in the cable. Look for any new entries that might indicate the system noticed a connection.lsusbto see if a new USB device appears when the cable is plugged in.journalctl -k | grep -i ucsi.Summary:
If the USB-C cable is passive and not connected to a device or power source, Linux Mint (or any OS) will not detect it. If it is connected to a device (even if not delivering power), you may see logs or a new USB device entry, but this depends on the cable and device. For power delivery issues, kernel logs are your best bet for troubleshooting.
Would you like help interpreting your system logs for USB-C events?
Even with
sudo,dmesgdoes not return anything new if unplug or replug while the cable is charging.even with
sudo, it seems experimentally identical todmesg.lsusbdoes not change, even withsudo.