Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[webcam support] USB Host support that YOU can try (now in nightlies)

OP verygreen

1st June 2011, 09:22 AM   |  #1  
OP Recognized Contributor
TN
Thanks Meter: 2,603
 
1,292 posts
Join Date:Joined: Feb 2011
Donate to Me
USB support and usb audio support were recently picked up by mainstream, so starting from nightly 135 you get all of the below (except for the webcam support). I am leaving the old information for history preservation purposes. The usb mode utility is replaced by Nook Tweaks

IMPORTANT! READ TO THE VERY END FIRST!

Ok, so I know some people want to try the usbhost mode and I am releasing this trial package to gather feedback and see how it works in the wild.
I am not responsible if you fry your nook (see below).

First, you need some hardware, namely microUSB to USB Female adapter. Something like this one. (There are cheaper ones on ebay, but delivery time is about 3 weeks, I got mine for $1.43).
Also an USB gender changer will work.

Then you need a kernel with usbhost enabled. I made a package that you can install onto emmc with CWM, or the same package could be installed on SD card if you use my installer. This package is only for CM7 users that already converted to .32 kernel. If you still run 2.6.29 kernel (ie CM7.0.3) - you need to upgrade to a fresh nightly like -87 or wait longer.

You can get the kernel here: http://nook.handhelds.ru/usbhost/upd...ost-2-emmc.zip

As you probably know, the Nook Color comes a little bit crippled in a sense that id pin on the OTG controller is not connected and so we cannot rely on it to properly choose mode. Instead I wrote an app to achieve the switching.
The app is ugly as hell, sorry, it's my first attempt at writing an Android app, bear with me, it would become better (I accept free Android programming lessons too! ).
You can get the app here: http://nook.handhelds.ru/usbhost/Noo...stSwitcher.apk
The app requires root, so make sure to allow it once asked and make it to remember the setting.

Install the kernel, install the app.
Reboot into the new kernel.
Run the app and you'll see a big "ToggleButton". When it's in Off mode, that means your nook is in usb client mode.
When you press it for the first time it will change to On, that means usb host.
(you can connect your external accessory before or after you enable the host mode).
When you press it again, it will change to Off and switch back to the client mode.
I recommend that before switching the host mode off you first disconnect your accessory, otherwise the internal hub cannot switch off.
(note that in some configurations the host mode enabling did not work for me on the first try and I needed to turn it off and on several times before the device registered. I believe there is no such problem with this kernel, but keep in mind such a possibility)
Addition in v2:
A second button is now added that lets you to force "external" vbus source. When you make it to ON, the battery charger pump is opened and connected to vbus terminals. In this state it is safe to connect nook to a power source, usb host will work and the battery should be charging at the same time.
Even without external power if your battery has high enough voltage (usually when it's full for me), it still somewhat works.
Additionally if you try to enable HostMode and an external power source is connected already, the "external" power mode is enabled (not shown in the app, though). This is to avert a potential disaster from below and to save battery.
Now the important part: When the Nook is in host mode, it drives 5V vbus off the connector at all times. If you connect the nook to a PC in this state, the PC will try to drive it's own vbus. Last time I tried to do this, my usb port in the nook fried! You've been warned! But that was before I had the host mode working and it might have been caused by a number of other things I was doing at the time too. Anyway I am not very keen on repeating this experiment again. If you are curious and decide to try it anyway regardless of the warning, make a comment and tell me what happened

Supported devices (this is important, right?)
Note that only low power devices will work if you don't have an externally powered hub. Don't expect to be able to drive a cdrom or a hard drive out of just nook. 100mA is the current limit. (Current testing shows that if you use ISB hub, even unpowered, it hides this issue).
  • All keyboards should be supported. (the keymap in CM7 is a bit strange, though, you'll see it).
  • All mice should be supported too, though I have not tried.
  • I enabled Xbox and PS3 controllers support, but have not tried.
  • Usb camera support - I only enabled UVC-compliant cameras (Microsoft Live cameras are compliant for example, probably many others). You also need specially built nigthtly with videocam support (try Camera app).
  • USB storage - generic support enabled, so should work for you.
  • Serial port support - only generic support enabled (I guess GPS devices mostly work as serial ports)
  • USB audio support enabled - not sure if the Android has any idea how to support it.

The kernel is basically normal dalingrin's kernel with USB host support enabled and ipv6 disabled (to keep kernel size below 3M threshold).

Kernel source (for the curious and if you want to build your own kernel with some mode devices support): git://github.com/dalingrin/nook_kernel.git branch usbhost

Enjoy and share your experience.
Last edited by verygreen; 15th July 2011 at 06:56 PM. Reason: part of nightlies now
The Following 26 Users Say Thank You to verygreen For This Useful Post: [ View ]
1st June 2011, 10:27 AM   |  #2  
Senior Member
Thanks Meter: 31
 
109 posts
Join Date:Joined: Apr 2011
More
Just ordered the adapter for this. Thanks so much for your efforts!
1st June 2011, 12:43 PM   |  #3  
Arbelzapf's Avatar
Senior Member
Thanks Meter: 125
 
667 posts
Join Date:Joined: Oct 2010
So if anything goes wrong, we can revert by just flashing Dalingrin's kernel again, right?

Going to order an adapter now

Quick (and possibly stupid) question: Would gender changer plugs work in combination with a regular micro USB->USB cable?
Last edited by Arbelzapf; 1st June 2011 at 01:52 PM.
1st June 2011, 01:16 PM   |  #4  
Account currently disabled
Thanks Meter: 5
 
25 posts
Join Date:Joined: Jun 2010
this is incredible, thanks for all your hard work !!!
1st June 2011, 02:12 PM   |  #5  
Junior Member
Thanks Meter: 0
 
10 posts
Join Date:Joined: Feb 2010
Awesome news
Thanks for all your work on this. It just amazes me how much talent is here on XDA.

It also amazes me that Android tablets/phones struggle with something a 10+ year old Windows 98SE laptop can do with ease.

Ordered my cable and can't wait to try transferring pictures from my camera to the Nook!
1st June 2011, 02:19 PM   |  #6  
Senior Member
Thanks Meter: 633
 
1,747 posts
Join Date:Joined: Jan 2011
Donate to Me
Has anyone seen a netbook-style keyboard/case combo that would work with the nook? (Bluetooth and/or USB)

Great work man, can't wait to try this out!!
1st June 2011, 02:33 PM   |  #7  
Member
Thanks Meter: 16
 
83 posts
Join Date:Joined: Dec 2010
Just built cm7 from source as of 6AM and flashed your kernel, turned usb host on and attached my usb gender changer to my phone's micro usb cord and plugged in a mass storage device. dmesg in Terminal Emulator showed the device properly but apparently android has no idea what to do with it, the light didn't even come on. Encouraged by this minor sign of life, I plugged in a keyboard and it works (though of course the android keymap is close to full retard).

Good job! I think nullghost's idea of adding this to the CM7 pulldown menu is a good idea. Maybe also the power control?
1st June 2011, 04:13 PM   |  #8  
Senior Member
Thanks Meter: 172
 
274 posts
Join Date:Joined: Dec 2010
More
You will need to mount the USB storage yourself.
The Following User Says Thank You to hololight For This Useful Post: [ View ]
ace7196
1st June 2011, 04:50 PM   |  #9  
Guest
Thanks Meter: 0
 
n/a posts
Glad I though ahead and got an adapter

Working well so far. Will try more accessories at school!
1st June 2011, 04:59 PM   |  #10  
Divine_Madcat's Avatar
Forum Moderator
Flag USA
Thanks Meter: 2,341
 
2,678 posts
Join Date:Joined: Sep 2005
More
Any advice on what adapter to buy? I was looking at this one:
http://www.amazon.com/USB-Micro-Adap...6940268&sr=8-1

but not sure if it is what we are looking for since one review said it does not work for USB OTG.

Actually, thinking about it, is the USB host mode that is enabled here, different from the USB OTG that i am thinking of?


And since i dont mind being the first to ask a dumb question..
Quote:
Originally Posted by hololight

You will need to mount the USB storage yourself.

Would this be something done in the terminal, or through the settings UI (aka, it will show up on the same place that the SD card shows up)?
Last edited by Divine_Madcat; 1st June 2011 at 05:02 PM.

Post Reply Subscribe to Thread

Tags
nook color, usb host, usbhost
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes