I'm using a USB port on the Raspberry Pi 3 Model B to charge an accessory via a USB magnetic charging cable. I want to detect when the cable is plugged in and removed from the Pi.
I've been plugging in and removing this cable and looking for any traces of this being detected on Linux. So far, I've tried:
- monitoring udev events by
udevadm monitor
. - tailing the system logs in
/var/log
etc. - running an inotify watch on the
/dev
directory for new devices - looking around in
/sys/bus/usb/devices
for any clues
Is it possible to detect my simple charging cable being inserted/removed? By intuition I would think no (since the cable is purely for charging, and doesn't have drivers), however I observe that the RPI flashes its builtin LED red when I insert the cable.