Reply
Thread Tools
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#61
To establish usb host mode and correct speed detection is boost needed.

So host mode with charging first activate host mode with boost and then switch to charging mode.
 

The Following 5 Users Say Thank You to pali For This Useful Post:
Helmy's Avatar
Posts: 28 | Thanked: 24 times | Joined on Feb 2010
#62
Originally Posted by pali View Post
To establish usb host mode and correct speed detection is boost needed.

So host mode with charging first activate host mode with boost and then switch to charging mode.
Thanks Pail, that was exactly what i had thought, so how do we connect a USB device while charging the N900 at the same time?
i have drawn a diagram of how i think it would be connected,but i haven't tried it yet as i'm not sure what will happen with the n900 port giving out 5V while it is connected at the same time to a power source.
Attached Images
 
 

The Following 2 Users Say Thank You to Helmy For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#63
...which means You just use USB Y-cable (google for it) It's possible to buy such thing, but I would recommend DIY it.
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Helmy's Avatar
Posts: 28 | Thanked: 24 times | Joined on Feb 2010
#64
Originally Posted by Estel View Post
...which means You just use USB Y-cable (google for it) It's possible to buy such thing, but I would recommend DIY it.
I had drawn that diagram in my last post based on the connection of a USB y cable , my issue is not with the wire or how to connect it , it is with safety of the 5V going out of the port when it is set to "USB host mode(with charging)" and that 5V is supplying the same current like in boost mode(measured with a 500Ohms load resistor) ,
just as Pail said
host mode with charging first activate host mode with boost and then switch to charging mode.
this means the port starts with outputting 5V on the port, so with power connected to the port, the 5V-1200mA from the charger may not always be exactly the same as the 5V going out of the port and that will produce voltage difference, anyone who made battery packs knows how much current can come out of placing 2 cells with slightly different voltage in parallel,
anyway my concerns are with long term use, i don't think it would blow up the 2A fuse on the V+ of the n900 USB port, so have anyone tried it yet? i'd like to know who actually got or built a Y cable and is using this for a while with no issues.

also what happens when the power lines while in boost mode get shorted, say a bad USB flash drive with a broken shorted out connector was connected to the device, what will happen?
in a normal USB host like with a laptop if the USB power got shorted the USB controller cuts the power and in some computers the system will get a notification of the short
 

The Following 3 Users Say Thank You to Helmy For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#65
Nah, it is used with H-E-N for ages, exactly the same way, and work flawlessly. Never ever experienced any heat increase/problem when connecting 5V charger to Y-cable, where N900 already provides 5V. And my 5V PS isn't lab-accurate one, for sure

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following User Says Thank You to Estel For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#66
Pali, every time I edit PatternBoost to my liking, upon next start of usbmode, it forces mceledpattern to comment *out* PatternBoost, and add it again, with default settings set by You. It's very irritating, had to delete whole led-editing part of code from usbmode.sh (and check for it, 2 lines later).

Also, there is already PatternVboost, doing same thing, introduced by H-E-N since improved booston script by joerg (=since last update in -devel). This one was needed to be introduced manually, but many hostmode users have it already.

wouldn't it be good idea to check for PatternVboost (like now, script checks for PatternBoost), and if it is here, leave it alone and use - otherwise, adding PatternVboost, that will work with both USB Mode and H-E-N?

Thanks a lot in any case,

/Estel

// Edit

Pali, as for "pure" hostmode working, it's great - "automatically" enumerated my USB Hard-Drive on first try. although, when tracing dmesg output, at the same time when device is enumerated, I see "Forced hostmode error: High-speed device connected, but no high-speed mode selected".

My HD works in both full-speed and high-speed mode (most pendrives too, I think). Of course, during hostmode start, it wasn't enumerated on low-speed, and got enumerated (+blinked) only on full-speed test. Then, hostmode immediately decided "job done", and haven't started enumeration again (no more blinks on HD).

Have it changed to high-speed during-runtime, without another enumeration, or is it working in full-speed only? How can I check that, what should I search for in dmesg? How USB Mode handles devices that can work in *both* full-speed and high-speed (but, obviously, high-speed is preferable)?

Sorry for long description, but I think it's necessary to properly understand why I'm asking, and what I'm asking about

// edit 2

And another question - when it's already in hostmode and ke-recv mounted external USB disk, upon switching to peripheral, does umount automatically, or one should do it by hand, before activating periph. mode?

If it doesn't (umount automatically), maybe it would be good idea?
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!

Last edited by Estel; 2012-07-31 at 05:06.
 
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#67
Originally Posted by Estel View Post
Pali, every time I edit PatternBoost to my liking, upon next start of usbmode, it forces mceledpattern to comment *out* PatternBoost, and add it again, with default settings set by You. It's very irritating, had to delete whole led-editing part of code from usbmode.sh (and check for it, 2 lines later).
Ok, I will try to fix this bug.

Originally Posted by Estel View Post
Also, there is already PatternVboost, doing same thing, introduced by H-E-N since improved booston script by joerg (=since last update in -devel). This one was needed to be introduced manually, but many hostmode users have it already.

wouldn't it be good idea to check for PatternVboost (like now, script checks for PatternBoost), and if it is here, leave it alone and use - otherwise, adding PatternVboost, that will work with both USB Mode and H-E-N?

Thanks a lot in any case,

/Estel
I did not know about it. But changing pattern again is not good idea...

Originally Posted by Estel View Post
// Edit

Pali, as for "pure" hostmode working, it's great - "automatically" enumerated my USB Hard-Drive on first try. although, when tracing dmesg output, at the same time when device is enumerated, I see "Forced hostmode error: High-speed device connected, but no high-speed mode selected".
First speed is always low, because there is no way to detect if usb device is low speed. So some error messages in dmesg are OK.

Originally Posted by Estel View Post
My HD works in both full-speed and high-speed mode (most pendrives too, I think). Of course, during hostmode start, it wasn't enumerated on low-speed, and got enumerated (+blinked) only on full-speed test. Then, hostmode immediately decided "job done", and haven't started enumeration again (no more blinks on HD).

Have it changed to high-speed during-runtime, without another enumeration, or is it working in full-speed only? How can I check that, what should I search for in dmesg? How USB Mode handles devices that can work in *both* full-speed and high-speed (but, obviously, high-speed is preferable)?
New kernel export sysfs entry /sys/devices/platform/musb_hdrc/hostdevice with speed of usb device. usbmode.sh script first try low speed. it read "supported" speed from that file and try them until usb device will not be visible in lsusb. if there are more supported speeds script continue to try next.

Originally Posted by Estel View Post
Sorry for long description, but I think it's necessary to properly understand why I'm asking, and what I'm asking about

// edit 2

And another question - when it's already in hostmode and ke-recv mounted external USB disk, upon switching to peripheral, does umount automatically, or one should do it by hand, before activating periph. mode?

If it doesn't (umount automatically), maybe it would be good idea?
Unmounting in ke-recv is very very bad. ke-recv umount SD cards & usb disk but after they disappear from system (too late). When you remove back cover GPIO switch immediately power down SD card (no sync, no umount). Ke-recv will get this switch signal after 1s and then it call umount (but fs sync cannot be done because card is already disconnected). And same it is with usb disks. Ke-recv will get signal that host mode is deactivated and then it call umount (again too late...)

So I had idea to add umount button into file manager. But file manager is closed :-( Next I got idea for SD card: when kernel receive that gpio switch event it first sync & umount card and then it power down. But I do not have idea if we can call umount from kernel.

And for usb disks in host mode maybe it will be really good to call umount. But problem can be how to determinate disks names (in /dev) which some from usb device (which will report lsusb)...
 

The Following 4 Users Say Thank You to pali For This Useful Post:
Helmy's Avatar
Posts: 28 | Thanked: 24 times | Joined on Feb 2010
#68
Originally Posted by pali View Post
So I had idea to add umount button into file manager. But file manager is closed :-( Next I got idea for SD card: when kernel receive that gpio switch event it first sync & umount card and then it power down. But I do not have idea if we can call umount from kernel.
here is an idea, why not use filebox and have a setting somewhere that would allow to change the default application to be opened (stock file manager or filefox if it is installed) when a usb drive is mounted and an unmount button can be added to filebox as it is open source
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#69
Thanks a lot for Your answers, Pali. I'll check if HD is properly enabled as high-speed, using sysfs entry You've mentioned.

As for bug with mce.ini edition, it's strange, as I can't reproduce it now. Before, every attempt resulted in mceledpattern commenting out pattern (with comment, before, containing date when it was commented out), and immediately adding new one.

I tried to reproduce it now, to help with debugging, and I'm able to insert my own pattern, without triggering buggy behavior, or modifying usbmode.sh. WTF?

Originally Posted by pali View Post
And for usb disks in host mode maybe it will be really good to call umount. But problem can be how to determinate disks names (in /dev) which some from usb device (which will report lsusb)...
IIRC, dmesg message says it - for example, if it says (most likely) that device is sda1, it will be /media/usb/sda1.

Look for something like:
Code:
sda: sda1
in dmesg.

Also, isn't there a way to track what ke-recv mounted at given event (immediately, after usbmode finish with establishing USB connection as hostmode), and then, just umount it?

It require some smart scripting, as user may have few different USB devices connected (via HUB). It would be bad to umount all, forcibly, when one of them disconnects.

ENORMOUS thanks for providing properly-integrated and automatic hostmode, after so many years! It's great, that such essential thing have active maintainer, now.

/Estel

// Edit

Just small idea for future - despite automatic mode working reliably, it would be great to add some "advanced" button (or so), that would allow for choosing speed and moment of enabling boost manually. It would really make H-E-N obsolete, in favor of USB Mode (would also eliminate small glitch with duplicated PatternVBoost - USB Mode PatternBoost would become only one needed).

Why it may be better? For example, with my USB keyboard, I've observed strange behavior. Sometimes - like 20% - despite enumerating well (and being actually detected by extkbd, it is "too slow" for USB Mode, and USB mode try another speed, unnecessary. So, I must wait for it to check that higher speed (full-speed), then until it go back again to low-speed, and hope, that this time keyboard will enumerate quickly enough.

It's not a big deal, as it happens no more than during 1 out of 5 connecting attempt, but possibility of doing things manually would help, without need for keeping H-E-N as emergency solution.
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!

Last edited by Estel; 2012-07-31 at 22:00.
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#70
Pali, I've checked sysfs entry, and HD is properly enumerated as high spped device Great job! I've also tested wireless mouse (which is full-speed one), and USB keyboard mentioned earlier (which is low-speed, but works in high-speed also), and for both of them, sysfs entry report low/full - I suspect, that it's OK, and it's exported for both low and full speed? BTW, of course, keyboard is properly used as low-speed (judging by moment, when it's enumerated), so no unnecessary power wastes here (via higher speed mode), and everything works like a charm.

I have, hoever, discovered a glitch. I have USB high-speed hub, that works perfectly with H-E-N and manual enumeration, but fails on USB Mode. Judging by diodes, it *is* properly enumerated, but, just like keyboard I've mentioned earlier, it's "too slow" for USB Mode, and the latter already start changing speed, ignoring that device got properly enumerated in last moment.

But, unlike with keyboard, when it happened only during 20% of attempts, for HUB it fails 100% times. Could timeout *before changing speed* be extended, a little?

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 
Reply

Tags
usbmode


 
Forum Jump


All times are GMT. The time now is 14:16.