Go Down

Topic: Get USB device name (Read 1 time) previous topic - next topic

BajK

Dec 01, 2010, 03:13 pm Last Edit: Dec 01, 2010, 03:20 pm by BajK Reason: 1
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 http://www.arduino.cc/playground/Main/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 :( 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.

PaulS

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.

Grumpy_Mike


BajK

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?

Grumpy_Mike

Quote
or is it better that I monitor the GND


No that is a very bad idea.

Your first guess was right.
Quote
And how do I recognize if it is gone?

You see nothing again on the input.

BajK

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 :)

Grumpy_Mike

Quote
if it is either noisy

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

Go Up