Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,806,969 Members 37,998 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] USB Host

Tip us?
 
nerd65536
Old
#11  
Junior Member - OP
Thanks Meter 16
Posts: 14
Join Date: Jun 2009
Quote:
Originally Posted by setzer715 View Post
So I have been playing with this for a bit. I can get it to mount my old 4GB USB 2.0 flash drive but not my new 32GB USB3.0 flash drive. Do you think it's a 32GB thing or a USB3 thing? I would like to order a new drive for this but not sure which to eliminate.

I would prefer to use a 32GB drive if it's just a USB3 thing but if it's the size of the drive I don't want to deal with returns.

Any ideas?

Also it will not mount my SDCard reader with 16GB card in it.
I'm able to use a 32GB MicroSDHC card in a MicroSDHC-USB adapter.
In principle, a USB 3.0 device should be backwards-compatible, but I don't have any to test with.

Troubleshooting:

Do you get a specific error when using the "mount" command? If so, please paste the error message here.

Run
Code:
ls /dev/block/
to see whether the device "/dev/block/sda" is detected. How many numbered "sda*" entries are listed?

Does the phone charge while everything is plugged in?
 
setzer715
Old
#12  
setzer715's Avatar
Senior Member
Thanks Meter 207
Posts: 1,218
Join Date: Jan 2009
Location: North Phoenix
Quote:
Originally Posted by nerd65536 View Post
I'm able to use a 32GB MicroSDHC card in a MicroSDHC-USB adapter.
In principle, a USB 3.0 device should be backwards-compatible, but I don't have any to test with.

Troubleshooting:

Do you get a specific error when using the "mount" command? If so, please paste the error message here.

Run
Code:
ls /dev/block/
to see whether the device "/dev/block/sda" is detected. How many numbered "sda*" entries are listed?

Does the phone charge while everything is plugged in?
The error I get is "No such file or directory". It happens on this and my sdcard reader.

I ran ls /dev/block. With the 16gb flash drive I see sda and sda1. With my 32GB I only see sda.

My 32GB flash drive is a high speed Lexor. I tried my wifes flash drive, her's is a Lexor 32GB USB3 but a slower rated one and I can see her's.

Further testing with my SDCard reader. I have a Transcend 8GB Class 6, A-Data 16GB Class 6 and Patriot 32GB Class 10 SDCards. I can see the 8GB and 32GB but not the 16GB.

Seems maybe a compatibility issue maybe? The card's/drives I couldn't read I tried formatting again, everything is FAT32. Who knows. At least I know most things work.
1+1 - Running CM11
LG G3 - Returned, JUNK!
LG G2 - Son has it.
Nexus 5 - Sold
Nexus 10 - PurityROM
Nexus 4 - Sold
TMO SGSIII - CM10.1
HTC One S - Sold
TMO SGSII - Sold
Sensation 4G - Sold
MT4G - Got a new one! Stock 2.3.5 with root.
Nexus One - CM9!
Vibrant - Let in-law use it. Just wasn't cutting it for me.
MyTouch3G Slide - Returned
MyTouch 3G - Sold
G1 - Sold
 
nerd65536
Old
(Last edited by nerd65536; 5th June 2012 at 03:13 AM.) Reason: grammar
#13  
Junior Member - OP
Thanks Meter 16
Posts: 14
Join Date: Jun 2009
Quote:
Originally Posted by setzer715 View Post
I ran ls /dev/block. With the 16gb flash drive I see sda and sda1. With my 32GB I only see sda.
The drive is detected by the phone, but the lack of a "sda1" entry means that the drive does not have a standard partition table. In that case, it should work if you specify "/dev/block/sda" instead of "/dev/block/sda1" in the mount command.

(The ideal solution would be to partition and format the drive so that it would behave like the others.)
 
setzer715
Old
#14  
setzer715's Avatar
Senior Member
Thanks Meter 207
Posts: 1,218
Join Date: Jan 2009
Location: North Phoenix
Quote:
Originally Posted by nerd65536 View Post
The drive is detected by the phone, but the lack of a "sda1" entry means that the drive does not have a standard partition table. In that case, it should work if you specify "/dev/block/sda" instead of "/dev/block/sda1" in the mount command.

(The ideal solution would be to partition and format the drive so that it would behave like the others.)
Thanks but what do you mean "partition and format" with a flash drive? Are you saying there should be more than one partition and there isn't? I've formatted the flash drive a few time in windows always as fat32. Is there another way I should do it?

I have an Ubuntu Live CD if you think I should do it in Linux but I'm VERY new to Linux and have no clue as to what commands to use to accomplish this.
1+1 - Running CM11
LG G3 - Returned, JUNK!
LG G2 - Son has it.
Nexus 5 - Sold
Nexus 10 - PurityROM
Nexus 4 - Sold
TMO SGSIII - CM10.1
HTC One S - Sold
TMO SGSII - Sold
Sensation 4G - Sold
MT4G - Got a new one! Stock 2.3.5 with root.
Nexus One - CM9!
Vibrant - Let in-law use it. Just wasn't cutting it for me.
MyTouch3G Slide - Returned
MyTouch 3G - Sold
G1 - Sold
 
nerd65536
Old
(Last edited by nerd65536; 6th June 2012 at 07:20 AM.) Reason: Clarity
#15  
Junior Member - OP
Thanks Meter 16
Posts: 14
Join Date: Jun 2009
Quote:
Originally Posted by setzer715 View Post
Thanks but what do you mean "partition and format" with a flash drive? Are you saying there should be more than one partition and there isn't? I've formatted the flash drive a few time in windows always as fat32. Is there another way I should do it?

I have an Ubuntu Live CD if you think I should do it in Linux but I'm VERY new to Linux and have no clue as to what commands to use to accomplish this.
It is possible to skip the partition table altogether and just start with the FAT32 data instead. This is what the manufacturer of the drive has done. (The drive doesn't have any partitions, so there is no first partition to be named "/dev/block/sda1")
You should be able to use the drive if you mount "sda" instead of "sda1". You can follow these instructions below to make it behave like the other drives:

If you have an Ubuntu LiveCD, boot from it, and open GParted (Partition Editor):
Choose your flash drive from the drop-down at the top right. Make absolutely sure you select the correct device (the size of the drive is listed), as all data on it will be erased.
In the menu: Device --> Create Partition Table... --> Apply.
Click on the "unallocated" space, to select it.
Next, menu: Partition --> New --> File system: FAT32 --> Add.
Finally, menu: Edit --> Apply All Operations

(When finished, close GParted and shutdown the liveCD)

The drive should now show up with the expected /dev/block/sda1 partition.
The Following User Says Thank You to nerd65536 For This Useful Post: [ Click to Expand ]
 
setzer715
Old
#16  
setzer715's Avatar
Senior Member
Thanks Meter 207
Posts: 1,218
Join Date: Jan 2009
Location: North Phoenix
I just mounted it as you previously described on sda instead of sda1 and it worked fine. I don't want to repartition it as I don't know if that will mess with the speeds. Who knows what Lexor did to make this thing so amazing fast but I want to keep it that way. It's nice to through 8gigs of movies on it in 1-2 minutes.

I'm sure partitioning has nothing to do with it and it's all based on hardware but you never know!
1+1 - Running CM11
LG G3 - Returned, JUNK!
LG G2 - Son has it.
Nexus 5 - Sold
Nexus 10 - PurityROM
Nexus 4 - Sold
TMO SGSIII - CM10.1
HTC One S - Sold
TMO SGSII - Sold
Sensation 4G - Sold
MT4G - Got a new one! Stock 2.3.5 with root.
Nexus One - CM9!
Vibrant - Let in-law use it. Just wasn't cutting it for me.
MyTouch3G Slide - Returned
MyTouch 3G - Sold
G1 - Sold
 
UnkzDomain
Old
#17  
UnkzDomain's Avatar
Senior Member
Thanks Meter 4
Posts: 409
Join Date: Nov 2008
Location: Louisville
Would this work using a simple 5-pin male micro-USB to female USB adapter connected to a powered USB hub?
 
markwalker84
Old
#18  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: May 2010
Just ordered an HTC One S. YAY!


I'm a little scared about potentially frying my new toy by using the wrong cables...


Would an all in one cable do the job?
(ebay search for "Micro USB Host OTG Cable With USB power")


Seems to be the same as the DIY setup mentioned in the OP just all wrapped up in a single cable.


Thanks,

Mark
 
arses
Old
#19  
arses's Avatar
Senior Member
Thanks Meter 143
Posts: 404
Join Date: Mar 2010
I'm think if we buy an extended battery which have a micro usb cable (I forget the brand) exist on amazon.
We can solder a female to the cable and use battery as power source for phone and host.
What u think???

Sent from my One Sinderella using Tapatalk 2
 
cryingfreeman86
Old
#20  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Aug 2012
Location: Graz
Hi everybody,

First of all sorry for my englisch. I have a big problem with the USB otg function. An USB mouse works well but USB drives don't work. I have copied the text from terminal emulator:

app_162@android:/ $ export PATH=/data/local/bin:$PATH
app_162@android:/ $ su
app_162@android:/ # mkdir /mnt/sdcard/usb
mkdir: can't create directory '/mnt/sdcard/usb': File exists
2 /dev/block/sda1 /mnt/sdcard/usb <
mount: mounting /dev/block/sda1 on /mnt/sdcard/usb failed: No such file or directory
255|app_162@android:/ #

I also tried sda instead of sda1. No difference.
Please could anybody help me.

Tags
usb, usb host
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes