maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [Announce] USB hostmode beta release (https://talk.maemo.org/showthread.php?t=65232)

WhiteWolf 2011-09-15 14:18

Re: [Announce] USB hostmode beta release
 
I located the script "mount.sh"

The code is very clean and elegant. It works great.

I found that what does not is to run the script when you press the button to "Hen" to mount unit.

Any suggestions?

joerg_rw 2011-09-15 14:32

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by WhiteWolf (Post 1088919)
I located the script "mount.sh"

The code is very clean and elegant. It works great.

I found that what does not is to run the script when you press the button to "Hen" to mount unit.

Any suggestions?

Try disabling "start filemanager on mounting" option in h-e-n GUI. I seem to recall there's been a bug that did exactly that, it failed to call the mount script when this option been enabled - thought it got squished some releases ago.

cheers
jOERG

WhiteWolf 2011-09-15 14:40

Re: [Announce] USB hostmode beta release
 
Things turned out just as I indicastes.

Thank you.

Try to see if I can modify the script to run it to open the file browser to mount the partition.

mrsellout 2011-09-19 23:38

Re: [Announce] USB hostmode beta release
 
This was posted in the n9 thread by jalyst, and I thought you guys should see it too. Look at what they've managed to do with USB hostmode!
http://www.newscientist.com/article/...nner.html?=mnb
Absolutely amazing, and impossible without your work! :)

Estel 2011-09-20 06:54

Re: [Announce] USB hostmode beta release
 
By the way, since I started to use (properly) new, improved joerg_rw's booston, I have yet to see *any* (well, in fact, I hope to *not* see it ;P ) problem with enabling hostmode. It just work all the time, at first attempt, no matter what I connect.

I don't know if it's due to booston, or I just become skilled at timing while connecting - or both ;) - but I think it's worth reporting, anyway.

sicelo 2011-09-20 07:18

Re: [Announce] USB hostmode beta release
 
i'm suspecting booston, because i have the same situation: all works fine without any effort.

OVK 2011-09-20 12:40

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by mrsellout (Post 1092126)
This was posted in the n9 thread by jalyst, and I thought you guys should see it too. Look at what they've managed to do with USB hostmode!
http://www.newscientist.com/article/...nner.html?=mnb
Absolutely amazing, and impossible without your work! :)

I wonder how happy these scientist are when the usb port of their N900 drops out and they are offered to take a E7 as a replacement because N900 can't be fixed and they can't get a replacement N900 because these are not manufactured anymore :confused:

Temporal 2011-09-20 14:37

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by OVK (Post 1092494)
I wonder how happy these scientist are when the usb port of their N900 drops out and they are offered to take a E7 as a replacement because N900 can't be fixed and they can't get a replacement N900 because these are not manufactured anymore :confused:

WOOOOOOOOOOW... so cool!!!

joerg_rw 2011-09-30 12:28

Re: [Announce] USB hostmode beta release
 
some pointer to current activity/debate about jrbme
see [edit2] in post #806 http://talk.maemo.org/showthread.php...16#post1006716

just to let you know
/j

Estel 2011-09-30 17:11

Re: [Announce] USB hostmode beta release
 
Thanks joerg, I'm keeping my thumbs for this. As side note, I would encourage you to re-consider Your opinion about BFS kernel - it is not some "new" project, popped out yesterday, but respected, long-term effort. You know I'm not coder, but I'm sure iDont got serious reasons for keeping it as separate project (while many BFS patches were already implemented in kernel-power, in meantime). You can check it here (pre-official-release discussion):

http://talk.maemo.org/showthread.php?t=58780

// Edit

...and here (announcement, brilliantly written by iDont):

http://talk.maemo.org/showthread.php?t=78110

pali 2011-09-30 19:54

Re: [Announce] USB hostmode beta release
 
@joerg_rw

Some questions about jrbme in kernel:

* Should be jrbme written against upstream kernel or maemo? Or both?
* Should be jrbme upstreamed?
* If it should go to upstream, what about split code into more separated modules and use standard linux interfaces (instead all in one sysfs entry)? One for watchdog which use standard linux watchdog interface, one for bq27200 chip which use power_supply interface (that already exists), one for bq bq24150 chip (use power_supply to?), maybe one for twl-madc (BSI) and last for usb host mode + glue to work all together...
* How is usb host mode working on old Nokia N8x0 tablets? Is for swithing between host mode and pheripheral mode any standard linux sysfs interface?

* Full jrbme should be BME replecament. Do somebody know what all is BME doing and what from BME can we implement?

I think that kernel module(s) should be written for upstreaming, but backported into maemo kernel too. And I think module(s) should use standard linux interface (watchog, power_supply, ...) if it is possible.

joerg_rw 2011-10-01 18:11

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by pali (Post 1099875)
@joerg_rw

Some questions about jrbme in kernel:

* Should be jrbme written against upstream kernel or maemo? Or both?
* Should be jrbme upstreamed?

Well, I wrote that "spec" without upstream in mind, but hoped to implement a clean platform agnostic interface that just deals with bq24150


Quote:

Originally Posted by pali (Post 1099875)
* If it should go to upstream, what about split code into more separated modules and use standard linux interfaces (instead all in one sysfs entry)? One for watchdog which use standard linux watchdog interface,

basically that sounds OK, but see following comments:
The watchdog is in no way a watchdog like the ones known from standard linux and also found on maemo, I.E. it won't trigger a reboot of system. So I don't think it should get implemented with a similar semantics to those, rather my idea was to mostly hide away the wd details and let kernel handle the wd-tickling usually (set wd to "auto", after config of the other parameters been done).


Quote:

Originally Posted by pali (Post 1099875)
one for bq27200 chip which use power_supply interface (that already exists),

bq27200 isn't included at all in this concept, it for sure should get its own "domain" (and already has, though the implementation is really problematic, see http://mg.pov.lt/maemo-irclog/%23mae...09-30T22:19:42 )


Quote:

Originally Posted by pali (Post 1099875)
one for bq bq24150 chip (use power_supply to?),

that's what my "spec" at http://maemo.cloud-7.de/bq24150-sysnode.spec.txt is all about. I will appreciate comments about how to improve this set of sysnodes, move it to other namespaces, whatever. It's just a 70% finished RFC (in genuine meaning of words) for now.


Quote:

Originally Posted by pali (Post 1099875)
maybe one for twl-madc (BSI)

I completely omitted that one, good point.


Quote:

Originally Posted by pali (Post 1099875)
and last for usb host mode + glue to work all together...

This would finally stay a userland task, though it had a way reduced set of duties compared to what bme does now. It however should care about BSI / twl-madc etc


Quote:

Originally Posted by pali (Post 1099875)
* How is usb host mode working on old Nokia N8x0 tablets? Is for swithing between host mode and pheripheral mode any standard linux sysfs interface?

it simply does "echo host >mode". Alas for N900 there are a *lot* of routines missing in kernel to make this work.


Quote:

Originally Posted by pali (Post 1099875)
* Full jrbme should be BME replecament. Do somebody know what all is BME doing and what from BME can we implement?

there's quite a number of obvious and not so obvious things bme does, I think I elaborated on that a bit in original "why jrbme is dead" post linked to in my first post of this subthread. Also speedevil and shadowjk will have some valuable info on that, please contact them on IRC. Main thing is the IPC that provides battery status info to hald-addon-bme, which can't go to kernel for obvious reasons. You'll either need to patch hald-addon-bme to directly read the sysnodes rather than do IPC chat to bme, or you implement that IPC into the userland part I mentioned above.


Quote:

Originally Posted by pali (Post 1099875)
I think that kernel module(s) should be written for upstreaming, but backported into maemo kernel too. And I think module(s) should use standard linux interface (watchog, power_supply, ...) if it is possible.

well, I hope I was clear enough about it in above comments, so you know I basically agree or don't care, except where noted otherwise (watchdog) :-)

Many thanks for picking this topic up and caring about it.

cheers
jOERG

adelalgomai 2011-10-25 18:27

Re: [Announce] USB hostmode beta release
 
1 Attachment(s)
Quote:

Originally Posted by joerg_rw (Post 883503)
please take a big stone and adjust backside of N900

what the hell are u ??
don't be so proud ,, if u have some information about something, that doesn't mean u are the best or u are better than others who don't know those information. the good man and who have real knowledge always serve others and provide them his knowledge with no proud , so if u really know something about this issue and h-e-n come and brighten us , or just shut up and watch like others ..

sorry but i had to say that cause I really felt angry ....:o
and I actually have the same problem and I cannot solve it ..:D:D

joerg_rw 2011-10-25 18:51

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by adelalgomai (Post 1113560)
what the hell are u ??
don't be so proud ,, if u have some information about something, that doesn't mean u are the best or u are better than others who don't know those information. the good man and who have real knowledge always serve others and provide them his knowledge with no proud , so if u really know something about this issue and h-e-n come and brighten us , or just shut up and watch like others ..

sorry but i had to say that cause I really felt angry ....:o
and I actually have the same problem and I cannot solve it ..:D:D

baby, I just have to post a link to answer: http://talk.maemo.org/showpost.php?p...&postcount=465

EDIT:
post number ONE in this very thread:
Quote:

To install:
Install hostmode-gui from -devel, the package depends on kernel-feature-usbhost, so it should be compatible with any kernel that provides this (in debian/control), kernel-power provides this, and therefore, if no other kernel that does provide it is supported, it will be installed.

The GUI now checks for API version instead of kernel version, with the latest API being 20101110, also in kernel-power.
Post #9 this very thread:
Quote:

Until Mohammad updates the info in #1: We are not shipping a dedicated hostmode kernel anymore with h-e-n GUI. You are supposed to install kernel-power v45 (or newer), which has hostmode patches integrated. Installing h-e-n won't do that for you. Please refer to kernel-power howto and readme and FAQ, for details on how to install and how to remove this non-stock kernel.
Though I doubt it will be any more visible when I quote it here than it was on the original posts :-S

K9999 2011-10-25 18:57

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by adelalgomai (Post 1113560)
what the hell are u ??
don't be so proud ,, if u have some information about something, that doesn't mean u are the best or u are better than others who don't know those information. the good man and who have real knowledge always serve others and provide them his knowledge with no proud , so if u really know something about this issue and h-e-n come and brighten us , or just shut up and watch like others ..

sorry but i had to say that cause I really felt angry ....:o
and I actually have the same problem and I cannot solve it ..:D:D

have u upgraded ur power kernel mate? sorry I can't read all posts to trace ur problem. what is it u haven't done? :)

blue_led 2011-10-25 19:40

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by adelalgomai (Post 1113560)
what the hell are u ??
..............
so if u really know something about this issue and h-e-n come and brighten us , or just shut up and watch like others ..

sorry but i had to say that cause I really felt angry ....:o

shame on you.
writing that is like howl to steve jobs because you are unable to search and understand how to install an iphone application.
joerg is h-e-n admin and spent a lot of his time pushing this project to a final solution and he is tired and saturated saying " search first "

ban yourself.

adelalgomai 2011-10-28 18:54

Re: [Announce] USB hostmode beta release
 
Sorry juys if my words were rough and impolite .. I just was in a bad situation and by chance I saw the reply of mr Joerg , so I just posted my reply .. I really feel sorry and I hope that mr Joerg and all juys accept my apologies ..I'm a new member here , so I don't want to start with fighting .
:)

WhiteWolf 2011-11-23 13:10

Re: [Announce] USB hostmode beta release
 
There was a way to feed a USB device without consuming battery N900. Can you tell me how or a link to the explanation?

Thank you.

joerg_rw 2011-11-23 15:17

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by WhiteWolf (Post 1127830)
There was a way to feed a USB device without consuming battery N900. Can you tell me how or a link to the explanation?

Thank you.

http://talk.maemo.org/showthread.php...203#post921203
btw I hope I've not missed to link to it in post #9 :-)

ultra-terse howto: get charge.sh from ShadowJK, install so you can execute it.
do:
start H_E_N, select speed
only *now* apply external VBUS
*now* immediately click vboost in H_E_N
enum, mount, etc
now do boostoff; charge.sh

to end: kill charge.sh, then close H_E_N



cheers
/j

blue_led 2011-11-23 16:54

Re: [Announce] USB hostmode beta release
 
work in progress: hostmode script "click and use" with :
-no gui
-automatic speed
-status area icon
-automatic mount for removable media( hdd, sticks, cdrom )
-a lot of transition notifications

to do
automatic host-charging mode

bug
when active flashlight don't work

stay tuned !

freemangordon 2011-11-23 17:11

Re: [Announce] USB hostmode beta release
 
@blue_led, joerg_rw and other h-e-n developers -

could you please take a look at usbhostmode.diff and confirm (or not) that
Code:

+                if (machine_is_nokia_rx51()) {
+                        musb_platform_resume(musb);
+                        musb_set_vbus(musb, 0);
+
+                        devctl &= ~MUSB_DEVCTL_SESSION;
+                        musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
+
+                        musb_writeb(musb->mregs, MUSB_TESTMODE, 0);
+                }

is missing a call to musb_platform_suspend(musb); at the end of the block

WhiteWolf 2011-11-23 19:15

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by joerg_rw (Post 1127888)
http://talk.maemo.org/showthread.php...203#post921203
btw I hope I've not missed to link to it in post #9 :-)

ultra-terse howto: get charge.sh from ShadowJK, install so you can execute it.
do:
start H_E_N, select speed
only *now* apply external VBUS
*now* immediately click vboost in H_E_N
enum, mount, etc
now do boostoff; charge.sh

to end: kill charge.sh, then close H_E_N



cheers
/j

Thanks, I'll read it and try it in stride.

I'm just using an external power supply and the battery continues to fall alarmingly.

Thank you again.

WhiteWolf 2011-11-23 19:21

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by blue_led (Post 1127936)
work in progress: hostmode script "click and use" with :
-no gui
-automatic speed
-status area icon
-automatic mount for removable media( hdd, sticks, cdrom )
-a lot of transition notifications

to do
automatic host-charging mode

bug
when active flashlight don't work

stay tuned !

Great! I am waiting.

WhiteWolf 2011-11-23 19:28

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by joerg_rw (Post 1127888)
http://talk.maemo.org/showthread.php...203#post921203
btw I hope I've not missed to link to it in post #9 :-)

ultra-terse howto: get charge.sh from ShadowJK, install so you can execute it.
do:
start H_E_N, select speed
only *now* apply external VBUS
*now* immediately click vboost in H_E_N
enum, mount, etc
now do boostoff; charge.sh

to end: kill charge.sh, then close H_E_N



cheers
/j

it does not work for me the link to download charger.sh

joerg_rw 2011-11-24 03:30

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by freemangordon (Post 1127954)
@blue_led, joerg_rw and other h-e-n developers -

could you please take a look at usbhostmode.diff and confirm (or not) that
Code:

+                if (machine_is_nokia_rx51()) {
+                        musb_platform_resume(musb);
+                        musb_set_vbus(musb, 0);
+
+                        devctl &= ~MUSB_DEVCTL_SESSION;
+                        musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
+
+                        musb_writeb(musb->mregs, MUSB_TESTMODE, 0);
+                }

is missing a call to musb_platform_suspend(musb); at the end of the block

why do you think so? aah wait, seems this is a code snippet called when disabling hostmode? then probably yes, should (maybe) fix the annoying increased-power-consumption problem after ending hostmode.

I still grin about musb_set_vbus(musb, 0); as it's a completely empty function - alas

freemangordon 2011-11-24 06:10

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by joerg_rw (Post 1128208)
why do you think so? aah wait, seems this is a code snippet called when disabling hostmode? then probably yes, should (maybe) fix the annoying increased-power-consumption problem after ending hostmode.

And should fix annoying KP bug when device reboots instead of shutdown when a charger is connected. And annoying bug when you cannot power-up the device with charger connected. etc.

I've already sent a patch to Pali for inclusion in next KP as it seems like correct fix for the above bugs. But don't expect me to be able to grok in a day or two a patch that was produced in 6 months as a result of combined work of 6-7 developers. That is why I need someone who is familiar with code to confirm.

Quote:

I still grin about musb_set_vbus(musb, 0); as it's a completely empty function - alas
And what that should mean (I know what empty function is)

praveenchand 2011-11-24 06:18

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by blue_led (Post 1127936)
work in progress: hostmode script "click and use" with :
-no gui
-automatic speed
-status area icon
-automatic mount for removable media( hdd, sticks, cdrom )
-a lot of transition notifications

to do
automatic host-charging mode

bug
when active flashlight don't work

stay tuned !

simply awesome!!!

NiQ 2011-11-24 12:34

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by blue_led (Post 1127936)
bug
when active flashlight don't work

Shouldn't mind it too much since using both USB host mode and flashlight together is probably the best way to drain your battery within minutes. :P

pali 2011-11-25 20:38

Re: [Announce] USB hostmode beta release
 
Now I started writing kernel driver for battery charging (kernel module for chip bq2415x).

demolition 2011-11-25 21:23

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by freemangordon (Post 1128237)
And should fix annoying KP bug when device reboots instead of shutdown when a charger is connected.

Do you mean this or the other way round? My experience is that the reboot command causes poweroff (only); also (as you say), the device doesn't power up when charging.
- when using Kernel-Power.

ryu1 2011-11-28 19:41

Re: [Announce] USB hostmode beta release
 
Where can i download charger.sh, the download link seems dead.

sicelo 2011-11-28 19:47

Re: [Announce] USB hostmode beta release
 
Latest charger.sh is here
http://enivax.net/jk/n900/charge21.sh.txt
just remove the .txt

5spdvl 2011-11-30 23:09

Re: [Announce] USB hostmode beta release
 
I've been trying the charger.sh script, however whenever I execute it, the mounted media is unmounted, and cannot be accessed unless I close h-e-n/xterm and start again.

Steps:
  • connect standard nokia micro USB data cable to N900, three-way cable to this, then flash drive to one prong, charger UNPLUGGED to the other
  • open h-en, mount flash drive as high speed (successfully, Sandisk 16Gb)
  • open xterm, as root run "sh charger.sh"
  • plug in ac adaptor
  • code runs, phone starts charging as per xterm output (which mathces with Conky's details, not sure if Conky's readout is inaccurate during h-e-n)

After charger.sh is executed, the media is unmounted. Any ideas?

joerg_rw 2011-12-01 05:08

Re: [Announce] USB hostmode beta release
 
Quote:

Originally Posted by 5spdvl (Post 1131340)
I've been trying the charger.sh script, however whenever I execute it, the mounted media is unmounted, and cannot be accessed unless I close h-e-n/xterm and start again.

Steps:
  • connect standard nokia micro USB data cable to N900, three-way cable to this, then flash drive to one prong, charger UNPLUGGED to the other
  • open h-en, mount flash drive as high speed (successfully, Sandisk 16Gb)
  • open xterm, as root run "sh charger.sh"
  • plug in ac adaptor
  • code runs, phone starts charging as per xterm output (which mathces with Conky's details, not sure if Conky's readout is inaccurate during h-e-n)

After charger.sh is executed, the media is unmounted. Any ideas?

yeah, please follow advice in the relevant post in this thread ( http://talk.maemo.org/showthread.php...203#post921203 )

When charger.sh runs and no charger is providing power - where is power from then? -> hostmode terminated

/j

5spdvl 2011-12-01 05:49

Re: [Announce] USB hostmode beta release
 
Ahh - I misinterpreted when to plug in the ac adaptor. Cheers joerg_rw.

Edit: just confirming that this now works.
  • connect all cables, excluding ac adaptor
  • mount media
  • connect ac adaptor to cables
  • as root, sh charger.sh
  • enjoy

Estel 2011-12-01 18:36

Re: [Announce] USB hostmode beta release
 
Not mean to be "picky", but boostoff (before executing charge.sh) would be also useful ;) Sure, it (probably) also works without doing so, but there is no point in keeping it, if You want power-saving, or charging as quickly as possible.

5spdvl 2011-12-02 09:49

Re: [Announce] USB hostmode beta release
 
Managed to mount a 500Gb passport HDD today, that formerly wouldn't mount (insufficient power from the N900). Rather than use a powered hub to power the drive, and then a separate AC adaptor to charge my N900, I modified the AC adaptor to have three USB ports: original port, that will charge my N900 over the Y cable, and a pair of ports that act like a female-female adaptor for joining two male ends together. These pair of ports take +ve/-ve from the AC adaptor, so in one port you plug your media/peripheral to be powered, and the other port takes the data cable that goes to your N900 (the other part of the Y cable). See picture. Probably not the safest thing going, but I will be tidying it up.

http://i234.photobucket.com/albums/e...PoweredHub.jpg

5spdvl 2011-12-03 05:58

Re: [Announce] USB hostmode beta release
 
Completed.

http://i234.photobucket.com/albums/e...111203_002.jpg

blue_led 2011-12-03 13:19

@ hostmode script ( worklog )
 
until now ...
status area icon - ok . it is a stock icon, blue.
it is activated when an valid device is connected. tap on status area will show an text saying "Host mode active".
More informations and actions will be added later after the moment when the script is stable

switching ( guessing ) speed work almost well. it is based on dmesg output
there is multiple ways doing this but not all are reliable. after 300 tests...
first method
first starting as high speed then low then full.
reason :
most connected devices are usb sticks, on second place mouses or keyboards
for this method there is a problem for sensing low speed devices in high speed mode.
khubd daemon interfere with driver and is hard to put whole system in a stable state.
second method
started as full speed and watching dmesg messages switch the speed accordingly. the fastest method, only 2 steps
reason :
if an full speed device is connected it will work "instantly". high speed devices are detected also in full speed mode and dmesg output is useful
but there is a problem with low speed device in full speed mode and khubd go crazy. this will add 20 s for a stable state. more tests are needed in this mode
third method
start as low speed then full then high. the most stable method
reason:
low speed devices are detected "instantly"
high or full speed devices are detected well. so continuing as full speed, the "full"devices will work and "high" devices are properly signalized

khubd and g_file_storage make a lot of problems.
for khubd there is an workaround flushing all configs but add 20 s for each khubd error.
g_file_storage need a patch because in high speed mode when a low speed device is attached it will trigger "mass storage" "Pc suite" selection. this can be ignored but is annoying.

a preference can be set in the script for first tested speed

later or tomorrow an alpha variant will be posted

pali 2011-12-03 14:09

Re: [Announce] USB hostmode beta release
 
@blue_led:
why is problem with autodetection usb speed? and it is possible to check if host usb device or charger is connected?


All times are GMT. The time now is 15:34.

vBulletin® Version 3.8.8