Pages: [1]   Go Down
Author Topic: Get USB device name  (Read 979 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-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.
« Last Edit: December 01, 2010, 09:20:29 am by BajK » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 45982
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31337
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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

http://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.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31337
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31337
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if it is either noisy
If you have a pull down resistor it won't be noisy it will be zero.
Logged

Pages: [1]   Go Up
Jump to: