OTG port possibly bust?


moxie

The voice of reason, sense and exasperation
Staff member
Joined
Aug 15, 2006
Messages
2,704
Age
52
Location
South of Sweden
Hiya all!

I recently got myself an OTG adapter to try to use a mouse that way. However, when I plugged that in, nothing happens at all. That in itself might have many causes - The adapter is cheap chinese crap, I'm incompetent, the mouse is broken and the cat ate the cable - but then I remembered that I've been puzzled lately by the fact that I apparently cannot charge the pandora through USB any longer. I had not thought much about that then, but now I think that those two together might mean that it is actually the OTG port that is broken? Before I start pondering that and what to do about it, I wonder: Is there anything in particular that I ought to try first? I.e.

 - Moxie, you stupid git, you got to "Enable OTG port" in the Odds-and-ends config screen!!!

 - The OTG driver is closed source, and must be installed from the codec pack.

 - You cannot charge through the OTG port, since it is to narrow to ride through on a normal-sized horse.

...or anything else that I ought to obviously check for?
 
Yes. I just did, and apparently I'm not only incompetent, but also senile - The pandora does start charging when I plug it to the computer, and when I activate SD-storage mode, everything works fine and dandy. So nothing appears to be wrong. Next thing i know, I will discover that the mouse thing works too, and I just dreamed the whole thing. *shakes head in disbelief over self*
 
*chuckles*  Well  at least that narrows it down somewhat.  :)

Never used the OTG port as host myself,  so keep in mind I have no experience in getting such a thing going.  I finally got around to ordering an OTG cable from DealExtreme, but they haven't got around to shipping it yet. :lol:

That being said, my understanding is that with a proper OTG cable it should detect the mode automatically and just work... 

If you confirm that the mouse itself works ok on a normal USB port but you still get nothing when plugging it into the OTG port the first two things I'd check are the dmesg output and:



Code:
cat /sys/devices/platform/musb-omap2430/musb-hdrc/mode

 

If it doesn't say host,  I'd try nudging it with:

 



Code:
sudo echo host> /sys/devices/platform/musb-omap2430/musb-hdrc/mode

and see if that has any effect.

Hope this helps. :)

- Neelix
 
It's usually enough to "sudo modprobe g_cdc" in the terminal, then plugging the OTG adapted with mouse connected to it, unplugigng adapter, then plugging again. This procedure is needed due to driver bugs mostly..
 
Last edited by a moderator:
If you confirm that the mouse itself works ok on a normal USB port but you still get nothing when plugging it into the OTG port the first two things I'd check are the dmesg output and:


cat /sys/devices/platform/musb-omap2430/musb-hdrc/mode
If it doesn't say host,  I'd try nudging it with:


sudo echo host> /sys/devices/platform/musb-omap2430/musb-hdrc/mode
and see if that has any effect.
Tried it. dmesg shows nothing happening at all (which I guess is consistent with notaz' proposal of a missing/crashed driver), the cat line gave "a-idle" (or something like that - I tried last night), and echoing "host" into it didn't make anything happen. I'll try a bit of notaz-inspired modprobing next :)
 
Are you sure that you got a mini a plug, not a mini b one?
 
I got the same kind of plug as the ones I use for accessing the SD-storage mode or for charging?
 
^sounds like mini-B - which is the wrong sort and requires extra fiddling to get to work.

If you didn't have  difficulty finding it, its the wrong type.

500px-Types-usb_th1.svg.png
 
Last edited by a moderator:
I do indeed have a mini-b, and having read up on how stuff is supposed to work, I understand that that is likely the main source of my problems. As I said, incompetent and senile :)

Interesting facts, though: Modprobing g_cdc with adapter connected produced a segfault. Modprobing g_cdc with adapter unconnected hangs. Not the machine, but the prompt never returns. Funny, this :)

Oh, well. Back to the usb adapter pages of ebay or amazon...
 
Hrm...

I actually think the shape of the plug used is largely irrelevant here, as the mode detection is based on the right pair of pins being shorted, not the actual shape of the plug. Also on all the USB OTG adapter cables I've been able to find online the pictured connector is the mini-b.

What I find interesting is that Moxie's mode line showed a_idle with the adapter connected, where mine shows b_idle.

I suspect this means that the system detected the shorted pins indicating an 'a' type connector.

@Moxie:

A few things come to mind:

  • When you did the modprobe line and it segfaulted did you have the mouse plugged into the adapter at the time or did you just have the adapter connected on its own?
  • Did you confirm the mouse itself works on a normal port?
  • If you didn't reboot between trying the line I specified and loading the driver, perhaps my suggestion interfered.
- Neelix
 
I found two different sellers on Amazon selling mini-b, with pictures of mini-b I bought one of them.

Although the mode is determined by the state (high or low) of the fifth pin, the pin wiring (almost) always matches the plug shape.
 
*shrugs* If a cable is sold as an OTG adapter cable, to allow connection of USB devices to an OTG host, I would expect it to be wired correctly regardless of the plug type used.

- Neelix
 
The second time i tried (that is, today), it did indeed show b_idle. And

* Yes, I tried the mouse in a normal computer

* Yes, when it segfaulted, it had the mouse and the adapter connected.

* A well rebooted pandora shows the same re: the loading of the driver.

At least that is what I find :)

Then again, there is fishy stuff going on galore. Hm. When I tell it to shutdown, it doesn't - It hangs on the splash screen with a full progress bar. Gah. All is strange.
 
In that case I'm out of ideas for the time being. :unsure:
Once I get the cable I ordered I'll try this for myself and see what happens.

- Neelix
 
If you get segfaults and hangs, you need to remove battery for a few minutes.

Are you on the latest firmware?

I recommend doing things in this order:

- boot from fresh battery-removed state

- modprobe g_cdc # if you get a hang/segfault here, something is fubared and there is no point to continue

- connect mouse to adaptor

- connect adaptor to pandora. If it works here, yay, if not, continue

- disconnect adaptor from pandora

- connect adaptor to pandora
 
Yes, I'm on latest firmware (or, well - I haven't run the "update OS" application for some time).  

I'll try the above later today. Thank you all :)
 
And whaddayaknow - After some un-batteried rest, I plug the adapter in and it just works?!? I did modprobe first, and then plugged in adapter and mouse, and everything works perfectly. Amazing.

Notaz: What would be the cause of something like this (i.e. what is it that gets fixed by taking out the battery, as compared to just rebooting)?
 
Back
Top