Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9868 Discussions

Intel Edison USB host mode

VSchr2
New Contributor I
6,574 Views

Hi,

I'm using the Intel Edison for a project and need to make the Intel Edison a USB host.

Following scenario: Edison on a mini-breakout board is connected as a host to an USB-Hub with external power supply.

Attached to this hub is a flash drive.

I want to access and mount the flash drive but it doesn't show up as a "sda" nor lsusb works ( error -99).

I would really appreciate your help in setting that up. If it detects the flash drive as sda or something else I'm able to mount it on my own.

Thanks,

1 Solution
VSchr2
New Contributor I
1,264 Views

Okay I applied 12V to that input now and have it working.

Thank you very much for your help guys!

View solution in original post

36 Replies
Matthias_H_Intel
Employee
1,091 Views

probably doesn't make much sense if nothing is shown in lsusb - otherwise I'd have suggested to run "udevadm monitor" and check whether anything gets triggered when you plug in the flash drive

VSchr2
New Contributor I
1,091 Views

Nothing shows up.

Do you have to switch on something. In linux or change a jumper on the mini-breakout board?

At least I've heard that on the other extension board for Arduino one has to switch a jumper to a different position. Although I couldn't find anything within the hardware guide.

MMied
New Contributor III
1,091 Views

I disabled in /etc/network/interfaces the usb iface used for ethernet (192.168.2.15) because i don't need it. Could it be a reason for your problem (i'm not sure) ?

VSchr2
New Contributor I
1,091 Views

For some reason I don't have the network directory within etc.

Did you install any external packages??

Matthias_H_Intel
Employee
1,091 Views

I guess @mmi is talking about the Debian flavor. On the default Yocto image you'd find a service file somewhere in /usr/lib/systemd/system which would set the USB to 192.168.2.15 (don't have my Edison up and running right now so can't check the exact details)

VSchr2
New Contributor I
1,091 Views

Thanks @mhahn

Unfortunately there is no service file in that directory.

Do i need to install any usb driver to make the Edison a host? Because usually it acts as a slave when I plug it into my desktop pc.

Thanks,

Matthias_H_Intel
Employee
1,091 Views

so it's probably /lib/systemd/system

VSchr2
New Contributor I
1,091 Views

okay i followed your instructions but it didn't change anything.. Im still not able to detect a flash drive!

Here's a screenshot of my /dev section. Maybe I'm just blind and can't find the drive.

Thanks,

mweal1
New Contributor III
1,091 Views

It looks like you have a bad USB micro adapter (I assume you have one of these between the edison and your flash drive) that does not ground the USB ID pin. I've seen a lot of these in the past.

The mini-breakout board breakout board uses the ID pin to select between host and device where the extension board for Arduino uses a switch.

When you get a good cable you should also see usbmon1 and usbmon2 in the dev directory.

I suppose as a hack you could just short the ID pin to ground at the USB micro connector.

I have also seen it where the mini-breakout board breakout board does not detect the ID pin properly after a soft reset. Try powering the Edison up with the device connected, or unplug and plug the microusb connector after the Edison has rebooted (I cant' remember the specifics of this problem).

Hope this helps.

PMart13
Valued Contributor II
1,091 Views

I know that David_J_Hunt has accomplished an otg usb connection using the Mini Breakout board.

Perhaps his project can provide some insights

http://www.davidhunt.ie/first-intel-edison-project-dslr-camera-controller/ First Intel® Edison project – DSLR Camera Controller

VSchr2
New Contributor I
1,091 Views

Thanks for your answers.

I took a look at my USB adapter and the ID pin is indeed not grounded.

So I'll give that a try tomorrow and will report back.

And I already took a look at project. He doesn't describe to way he connected the camera via USB.

But I also couldn't get his way of powering the Edison to work. He applied 5V at an input which is suppose to work with 7-12V.

PMart13
Valued Contributor II
1,091 Views

From David's project page:

The USB OTG cable was needed for the connection to the camera, but the usual ones had a large usb connector on the end, into which you can plug another cable. That was too bulky ( and not very nice looking) for what I needed, so I split apart a couple of regular USB cables and made my own OTG cable by shorting pins 1 and 2 together. Much neater than an off-the-shelf solution.

from David's paragraph above the previous one:

For this initial prototype, I have a DC-DC converter in there to convert from the LiPo's 3.7 v to 5V, so that I can feed in the power to the 'external' power input on the Edison board. The breakout board can take a battery directly, but then the USB port will not work in host mode, which I needed for connecting the DSLR. The DC-DC converter allows me to get around this limitation, and it still all fit into the small box.

His method was to short pins 1 and 2 together on a regular cable to create his custom cable, and he used to DC-DC converter so it would give enough power to power his OTG. Answering both points.

DHunt5
Valued Contributor I
1,091 Views

The Edison will show -99 for 'lsusb' when the host mode is disabled. This may be one of a couple of reasons:

  1. External power is not being used, i.e. you're using battery power. The board needs 5V or greater for usb host mode, so power via the 5v USB (but you want to use that for the camera, so no go there), or the 7-15v supply.
  2. You're not using a USB-OTG cable. i.e. one with pins 1 and 2 shorted. There's a gotcha here, in that I found some cables that looked like OTG cables, but were not, they were simply adapters without those pins shorted. Once I purchased a cable that said OTG on the packaging, the error -99 went away, as I was able to see my camera. I then made up a custom cable with the correct connectors on each end for my camera project to make things all nice and neat.

So once you're using external power and a USB-OTG cable, you should be able to see external devices with lsusb.

Rgds,

Dav.e

VSchr2
New Contributor I
360 Views

To which input of the breakout board did you connect the 5V supply?

DHunt5
Valued Contributor I
360 Views

I connected it to the external power supply, (7-24v, I think). I know the minimum is supposed to be 7, but I only had a 3.7-5v boost converter available to me at the time. It would be better to use a 3.7 to a higher voltage, one more suitable for the external input. I did see a few crashes when using the 5V on the external input, and it was probably the low voltage in. But it worked pretty well for Maker Faire Rome

Dave.

VSchr2
New Contributor I
1,091 Views

Okay I just connected the ID-pin to ground.

But error -99 is still showing up. Although my USB-hub now recognizes the Edison as a host.

Do I have to activate the host mode somewhere within Linux as well?

I'm very new to developing with Linux so please excuse these questions.

Thanks,

MPapi
New Contributor I
360 Views

I had similar issues when debugging my board, i.e. lsusb reports -99 (no USB device attached). My solution was to use the PSW signal to be my power enable to the USB. My suspicion is that the uvc camera (this was my case, but i would bet it's similar for all usb slaves) goes into "sleep" if no one replies within 300 ms of power-up (reference eludes me at the moment). Pin out of otg connector etc. you seem to be OK, so this would be my only suggestion.

I haven't had a chance to understand exactly what was happening since for now it "works" and if it ain't broke ... too many other things are currently broken.

Hope this helps.

VSchr2
New Contributor I
1,091 Views

Oh and I'm not using a 3,7V battery. I power the Edison with 5V from an usb adapter.

DHunt5
Valued Contributor I
1,091 Views

Which USB port do you have the usb-hub inserted into?

mweal1
New Contributor III
1,091 Views

valentin8251, this does not make a lot of sense to me.... I assume you have one micro usb for your serial console, the other the USB OTG to be used for the host port, so there should be no port left for micro-usb power on the mini-breakout board.

Anyhow to use host mode you need to supply +7V to 12V power to the Edison mini-breakout board via either connector J21, Pin 4 of J17 or J22 (J22 is the four smd pads on the back of board and is not populated or labeled. You would need to populated the barrel connector to use this). Just for clarification the USB OTG cable should be connected to J16 and your serial host (to PC) should be connected to J3.

Reply