Pages: [1]   Go Down
Author Topic: USB Host Shield 2.0  (Read 5856 times)
0 Members and 1 Guest are viewing this topic.
Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.circuitsathome.com/store/usb-host-shield-2-0-released

The old forum thread about this shield is here -> http://arduino.cc/forum/index.php/topic,38137.0.html

The new shield is compatible with Megas and easier to use; I'm working on the next big revision of the library with hub support.

Enjoy!

Logged

/felis

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I recently got this USB shield. I've downloaded the USB libraries from https://github.com/felis/USB_Host_Shield_2.0
I intend to use it to interface with a sensor which has a USB interface and use the Arduino to send the data over USB to an Android phone.
 
I'm a bit of a newbie when it comes to building in new libraries for the Arduino.
Could you point me to anything on how to integrate the required software for the USB shield ?

Best Regards,
Richard
Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

USB hubs have been supported for quite some time so it is possible to plug both your sensor and Android phone to the shield via a hub. Android phone (ADK) is supported in he code; it is also possible to connect a phone via Bluetooth using cheap BT dongle. Check this category for more info ->  https://www.circuitsathome.com/category/mcu/arduino/usb-shield
Logged

/felis

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you point me to any basic sketch example - I have the USB shield plugged into my Arduino as shown in the first figure. A sensor is plugged into the USB port from the shield - how do I address the USB port on the shield ?

I dropped the USB_Host_Shield libraries into my arduino\libraries directory (...\arduino-1.0.1-windows\arduino-1.0.1\libraries\USB_Host_Shield).



Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't need to worry about addressing. This sketch can be used to check if everything is put together correctly-> https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/USB_desc
Logged

/felis

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When I run the USB_Desc sketch I get:

"OSC did not start"

See the following photos


* ArduinoShield1.jpg (1466.54 KB, 2592x1944 - viewed 60 times.)

* ArduinoShield2.jpg (1905.7 KB, 2592x1944 - viewed 63 times.)
Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino board you're using is Mega ADK, you can't use this shield with it. The board has USB host built in and I heard it's possible to use it with my code. Check the USB Host 2.0 forks on gitHub.
Logged

/felis

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like you integrated this into the main branch ? (saw this in pull request 6:  https://github.com/felis/USB_Host_Shield_2.0/pull/6)


--Rick
Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could be - I'm not paying much attention to this particular board.
Logged

/felis

Ottawa, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Right, I'm using USB Host Shield with Arduino Uno. I'm very new with Arduino - please forgive me in advance for silly questions.

The shield is connected and red power LED is ON.
1) When I plug in a USB device, e.g. IPOD or USB memory stick nothing happens. I connected a 9 V external power supply - still nothing happens when USB devices are connected.

2) I installed the USB Host Shield 2.0 library and tried to compile example USB_desc.pde. I get error compiling with the following,
Code:
In file included from /data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.cpp:18:0:
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.h:109:22: error: '__FlashStringHelper' does not name a type
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.h:109:42: error: ISO C++ forbids declaration of 'parameter' with no type
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.h:115:24: error: '__FlashStringHelper' does not name a type
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.h:115:44: error: ISO C++ forbids declaration of 'parameter' with no type
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.cpp:725:23: error: '__FlashStringHelper' does not name a type
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.cpp:725:44: error: ISO C++ forbids declaration of 'ifsh' with no type
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.cpp:762:25: error: '__FlashStringHelper' does not name a type
/data/tinkering/Arduino/sketchbook/libraries/USB_Host_Shield/SPP.cpp:762:46: error: ISO C++ forbids declaration of 'ifsh' with no type

I am attaching my ~/.arduino/preferences.txt    What else can I do?

* preferences.txt (2.58 KB - downloaded 14 times.)
« Last Edit: October 25, 2012, 11:29:32 pm by DonQuixote » Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What version of Arduino IDE are you using?
Logged

/felis

Ottawa, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Aha! of course the version from ubuntu repos is horribly outdated. I have upgraded to Arduino IDE 1.0.1 and verification is successful.

FYI I am using this USB host shield http://www.robotshop.com/ca/productinfo.aspx?pc=RB-Dfr-104&lang=en-US

I suceeded to query a usb device using [install dir]/sketchbook/libraries/USB_Host_Shield/examples/USB_desc/USB_desc.pde
and query a USB hub and attached devices using [install dir]/sketchbook/libraries/USB_Host_Shield/examples/hub_demo/hub_demo.pde

The typical workflow is: verify sketch --> upload sketch --> open serial monitor --> attach USB device --> (it sends device data)

Probably this is obvious, but it wasn't when I was starting out.

Thanks so much for your great contribution!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I am trying to connect a Arduino to a Android mobile app using a USB Host shield.
I am using a Arduino Uno and a Sparkfun Host Shield.
This setup is working:

When I processess the usb_des sketch example in Arduino I got this printout:
####################
Start


01
--

Device descriptor:
Descriptor Length:   12
Descriptor type:   01
USB version:      0200
Device class:      00
Device Subclass:   00
Device Protocol:   00
Max.packet size:   40
Vendor  ID:      0FCE
Product ID:      5167
Revision ID:      0226
Mfg.string index:   01
Prod.string index:   02
Serial number index:   03
Number of conf.:   01

Configuration descriptor:
Total length:      0043
Num.intf:      02
Conf.value:      01
Conf.string:      00
Attr.:         80
Max.pwr:      FA
Unknown descriptor:
Length:      05
Type:      09
Contents:   0300020904

Interface descriptor:
Intf.number:      00
Alt.:         00
Endpoints:      03
Intf. Class:      06
Intf. Subclass:      01
Intf. Protocol:      01
Intf.string:      00

Endpoint descriptor:
Endpoint address:   85
Attr.:         02
Max.pkt size:      0040
Polling interval:   00

Endpoint descriptor:
Endpoint address:   05
Attr.:         02
Max.pkt size:      0040
Polling interval:   00

Endpoint descriptor:
Endpoint address:   86
Attr.:         03
Max.pkt size:      0040
Polling interval:   05

Interface descriptor:
Intf.number:      01
Alt.:         00
Endpoints:      02
Intf. Class:      FF
Intf. Subclass:      42
Intf. Protocol:      01
Intf.string:      00

Endpoint descriptor:
Endpoint address:   87
Attr.:         02
Max.pkt size:      0040
Polling interval:   00

Endpoint descriptor:
Endpoint address:   06
Attr.:         02
Max.pkt size:      0040
Polling interval:   00


Addr:1(0.0.1)

I have problems connecting to the Android phone.
I have downloaded the ArduinoTerminalSrc into the Eclipse with Android SDK installed but I get compiling errors in Eclipse....
Logged

Pages: [1]   Go Up
Jump to: