My device is battery powered. The battery supplies a 5V regulator and the output from that is connected via the black/red wires in a hacked USB cable to the USB port on the Arduino and also to the external components in the device. That works fine.
Now I want to add the facility to communicate with the device from a PC over USB while the device is running on battery. Simple I thought. Just connect D+ and D- on a USB socket to the green/white wires in the aforementioned hacked cable and connect the computer to the socket with a standard USB cable.
Doesn't work, the computer and Arduino behave as if neither exist.
Clearly I have to do something with VBUS and GND on the device's USB socket to get this to work. Anyone know what? I want to keep my device and it's external components running from the battery while talking to the computer if at all possible.