Get USB device name

Hey,

for a bigger project I have a double-USB-A plug in my housing. This is connected to 5V and GND and I can charge my mobile with it and stuff.
But there are also those Data pins. Is there a way of retrieving data from it via Arduino?
Nothing "special" but I just want to gather the device's name it sends to the computer. For example “Hewlett-Packard DeskJet 6980 Series” or “Realtec Semiconductor Corp. Mass Storage Device” as you can read it in lsusb.
Is this possible? Is there a library for that?

Greetings

Addition: So I found this in the Playground Arduino Playground - UsbMemory
Interfacing with an USB Memory Stick.
But what is a VDIP? And I don't see a command where he gathers device information.

Addition2: Okay, it seems you need that USB controller thingie in order to do anything with the USB device. Sad :frowning: So then I'll stick with just charging my device and hopefully I get it at least to recognize that there is something plugged in.

In order to pull information, the Arduino would need to be a host device. It is not. It is a slave device. It's role is to obey commands, not issue them.

But what is a VDIP?

http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/List/1/ProductID/434/Default.aspx?txtSearch=usb+datalogger&SortField=ProductName%2CProductName

hopefully I get it at least to recognize that there is something plugged in.
You should be able to do that by monitoring the voltage level on a data pin.

So, I should connect a analog input to the data pin (and with a resistor to ground) and handle it like a switch and then when there is something recognize that there is something? Or via interrupt on a digital pin? And how do I recognize if it is gone?

Hm or is it better that I monitor the GND that comes from the USB and add an analog input sensor cable there? (and wired to GND via a resistor) or would that decrase the current too strongly?

or is it better that I monitor the GND

No that is a very bad idea.

Your first guess was right.

And how do I recognize if it is gone?

You see nothing again on the input.

Okay, got it. So the one signal pin is GNDed when there is something plugged in, and the other one is +5V. So I can just monitor one of them and see if it is either noisy or constantly like > 1000.
Thanks for the ideas. I'll implement this :slight_smile:

if it is either noisy

If you have a pull down resistor it won't be noisy it will be zero.