maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   n770 host mode question!!! (https://talk.maemo.org/showthread.php?t=5843)

Hedgecore 2007-04-16 17:08

Re: n770 host mode question!!!
 
Heh, everyone's new at some point. You should've seen the colossal screwups I'd make when I was playing with Slackware Linux years ago. Personally I didn't have a problem enabling R&D mode or USBHostMode... but I'm not everyone. I'd still say odds are better that you won't brick your 770. Also, once in hostmode, you have to flash back to slavemode which is a major pain... but if you install the CIFS module, you can just xfer files over wireless from your network.

There's lots of pros and cons for each way, but about the only method I could really help you with is with building your own USB power injector.

Also, once you finally *do* get hostmode working, mounting external storage, memory cards, etc is a bit too much of a pain to do it all the time. My injector's been sitting unused for a while now.

convulted 2007-04-16 17:09

Re: n770 host mode question!!!
 
fanoush: Interesting! Was this said anywhere else? I must have missed it completely :)
In my case, I prefer having host mode enabled as default, but that's just me I guess.

fanoush 2007-04-16 17:56

Re: n770 host mode question!!!
 
Quote:

Originally Posted by macken (Post 44536)
Sorry, I dont mean to ignore your suggestion. I am pretty new to Linux system and I dont have any idea how to check those things and set them up in 770 without detail instruction :( (yes I know I should learn more linux skill)

From your first post it looked like you can run dmesg command and gain root so I guessed you are up to this task. Well as I said I haven't this tested I only know what system does on boot. linuxrc file contains this
Code:

FS_MODULES="ext2 jbd mbcache ext3"
USB_HOST_MODULES="ohci-hcd usbhid usbnet usbserial scsi_mod sd_mod \
                  usb-storage pl2303 net1080 cdc_ether asix"
MODULE_PATH=/lib/modules/current

Code:

load_usb_host_modules()
{
        for mod in $USB_HOST_MODULES $FS_MODULES ; do
                if [ -f $MODULE_PATH/$mod.ko ]; then
                        insmod $MODULE_PATH/$mod.ko
                fi
        done
}

Code:

usb_host_mode=$(cal-tool --get-usb-host-mode 2> /dev/null)
if [ "$usb_host_mode" = "enabled" ]; then
        echo "USB host mode enabled"
        load_usb_host_modules
        echo host > /sys/devices/platform/tahvo-usb/otg_mode
else
        echo peripheral > /sys/devices/platform/tahvo-usb/otg_mode
fi

this means you need to do the same thing as this script which may mean inserting those modules in shell by hand by running something like this as root (should be enough for usb disk)

Code:

insmod /mnt/initfs/lib/modules/current/ohci-hcd.ko
insmod /mnt/initfs/lib/modules/current/scsi_mod.ko
insmod /mnt/initfs/lib/modules/current/sd_mod.ko
insmod /mnt/initfs/lib/modules/current/usb-storage.ko

or writing similar script and running it.

And then enabling the host mode via echo command.

But as you said you want to attach camera and don't have driver, it may be a bit pointless anyway :-)

Luna 2007-04-16 18:25

Re: n770 host mode question!!!
 
I do something just like this. On script to mount and one to unmount

macken 2007-04-16 18:52

Re: n770 host mode question!!!
 
Quote:

Originally Posted by fanoush (Post 44550)
From your first post it looked like you can run dmesg command and gain root so I guessed you are up to this task. Well as I said I haven't this tested I only know what system does on boot. linuxrc file contains this
Code:

FS_MODULES="ext2 jbd mbcache ext3"
USB_HOST_MODULES="ohci-hcd usbhid usbnet usbserial scsi_mod sd_mod \
                  usb-storage pl2303 net1080 cdc_ether asix"
MODULE_PATH=/lib/modules/current

Code:

load_usb_host_modules()
{
        for mod in $USB_HOST_MODULES $FS_MODULES ; do
                if [ -f $MODULE_PATH/$mod.ko ]; then
                        insmod $MODULE_PATH/$mod.ko
                fi
        done
}

Code:

usb_host_mode=$(cal-tool --get-usb-host-mode 2> /dev/null)
if [ "$usb_host_mode" = "enabled" ]; then
        echo "USB host mode enabled"
        load_usb_host_modules
        echo host > /sys/devices/platform/tahvo-usb/otg_mode
else
        echo peripheral > /sys/devices/platform/tahvo-usb/otg_mode
fi

this means you need to do the same thing as this script which may mean inserting those modules in shell by hand by running something like this as root (should be enough for usb disk)

Code:

insmod /mnt/initfs/lib/modules/current/ohci-hcd.ko
insmod /mnt/initfs/lib/modules/current/scsi_mod.ko
insmod /mnt/initfs/lib/modules/current/sd_mod.ko
insmod /mnt/initfs/lib/modules/current/usb-storage.ko

or writing similar script and running it.

And then enabling the host mode via echo command.

But as you said you want to attach camera and don't have driver, it may be a bit pointless anyway :-)


Thank you so much, its very kind of you giving me this information.
Currently I really dont have the camera driver yet but I will have one soon. At the moment I only want the n770 detect the usb hub first.

fanoush 2007-04-16 19:08

Re: n770 host mode question!!!
 
Quote:

Originally Posted by macken (Post 44556)
Thank you so much, its very kind of you giving me this information.

No problem :-)
Quote:

Originally Posted by macken (Post 44556)
Currently I really dont have the camera driver yet but I will have one soon. At the moment I only want the n770 detect the usb hub first.

Let us know how it went. I am also interested whether it helps or not. In theory it should. Even the first insmod with ohci-hcd should get rid of the
Code:

[426.703460] Selected HOST mode: no host controller, powering off.
message when enabling host mode via echo

convulted 2007-04-16 20:50

Re: n770 host mode question!!!
 
One other thing. I am not an expert in any IT or electronics related field, but from my own post-mortem of the WSOD I suffered I have come to the following conclusion: Windows XP + vmWare workstation 5 + Ubuntu + Flasher = bad idea. For some reason vmWare throws a blue screen of death (heh) on XP whenever Flasher is used. This may cause the Windows PC to send some sort of signal on the USB lines, interrupting the rebooting of the 770 and causing a WSOD. This info does not really belong here I guess, but I just wanted to warn others so that they may not go through the same experience...

macken 2007-04-16 21:09

Re: n770 host mode question!!!
 
Quote:

Originally Posted by convulted (Post 44576)
One other thing. I am not an expert in any IT or electronics related field, but from my own post-mortem of the WSOD I suffered I have come to the following conclusion: Windows XP + vmWare workstation 5 + Ubuntu + Flasher = bad idea. For some reason vmWare throws a blue screen of death (heh) on XP whenever Flasher is used. This may cause the Windows PC to send some sort of signal on the USB lines, interrupting the rebooting of the 770 and causing a WSOD. This info does not really belong here I guess, but I just wanted to warn others so that they may not go through the same experience...

O... heck, its a good call. Tahnks a lot. As I was going to do exactly what you said above tonight if fanoush's method doesnt work. -_- thanks for the warning.

convulted 2007-04-16 21:47

Re: n770 host mode question!!!
 
That was close :-)
Try using Damn Small Linux (~50 Mb download) as I said earlier. I have had some trouble getting it to read my USB stick, but if I start it up with the stick inside the USB port it seems to read it without any problems.
OTOH, some people used vmWare without any problems. Maybe it's version 5 that was the problem. I would not risk it though!

macken 2007-04-17 03:55

Re: n770 host mode question!!!
 
to all-

I tried the method "fanoush" suggested and load those drivers b4 using the echo commands and looks like it worked. I can detect the usb hub now!!! Thanks so much.

btw, do anybody has a driver file (.ko) for logitech quickcam express? (http://qce-ga.sourceforge.net/#download) I dont know why in my VMware Ubuntu I dont have the necessary tools to "make" the driver. I tried updating and it seems like there is no "gcc-3.4" command there (but my gcc should be version 3.4, so I am not too sure how to fix it).

All in all, thank you so much for all your supports.


All times are GMT. The time now is 03:37.

vBulletin® Version 3.8.8