I have a project that I need to complete for work. We have been working on this project for a while, however I have come to a bit of a road block. I'll first lay out the important points.
- We have a Raspberry Pi & a USB Hub with Charge Only cables plugged into it.
- We want to be able to turn the power from the USB Hub to the device on/off depending on certain conditions.
- The USB Hub, we want to detect if a device (e.g. Smart Phone or Portal Battery Charger) has been plugged into one of the charge cables. We have charge cables currently, they plug and receive charge straight away.
- I'm currently using uhubctl to turn on/off ports.
- Using Linux, I need to detect a device being plugged in/unplugged
Problem: When I use Data & Charge cables, I fall into 2 issues.
iPhone require their users to "trust" the device first before it will accept charge.
It opens a vulnerability in terms of juice jacking which I'd like to avoid.
Solution: Don't use Data & Charge cables, use charge only. Problem with this approach is I cannot detect a device being plugged in.
With that information, I have hit a bit of a roadblock in terms of available hardware to achieve our goal.
So, my question boils down to this:
Is the approach and I'm taking correct. What I mean is: Using the USB Hub & Charge Only cables.
Is there any available solutions out there in the market that you could suggest I investigate?
Is there another potential approach I have not considered that you could suggest?
I don't need any data, so charge cables are a perfect solution if possible (not mandatory though). But, I need to be able to detect if a device has plugged into the USB Hub (or other device that is capable of doing so).