Reply
Thread Tools
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#21
Originally Posted by desiv View Post
If you enable USB hose mode, does the 770 no longer work as a USB client?
yes, until you switch back
Originally Posted by desiv View Post

I found this searching (see, I did search!)
(As root)
command to put it into host mode:
echo host > /sys/devices/platform/tahvo-usb/otg_mode
command to put it into peripheral mode:
echo peripheral > /sys/devices/platform/tahvo-usb/otg_mode
you also need
/etc/init.d/ke-recv stop before and start after to let maemo platform notice the change

here is my dirty and unfinished script, it adds just usb storage functionality, for other (hid,network,serial,..) add additional modules from beginning of /mnt/inifs/linuxrc. the script currently does not remove any modules (they need to be removed in reverse order)
Code:
#!/bin/sh
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
        exec sudo gainroot <<EOF
exec $0 $*
EOF
        exit $?
fi
# real script follows

HOST_MODULES="ohci-hcd scsi_mod sd_mod usb-storage"
MODULE_PATH=/mnt/initfs/lib/modules/current
insert_modules(){
        for mod in $* ; do
                if [ -f $MODULE_PATH/${mod}.ko ]; then
                        insmod $MODULE_PATH/${mod}.ko
                fi
        done
}
remove_modules(){
echo
}

OTG_MODE="/sys/devices/platform/tahvo-usb/otg_mode"

enable_host(){
insert_modules $HOST_MODULES
echo host >${OTG_MODE}
}
disable_host(){
echo peripheral >${OTG_MODE}
remove_modules
}

/etc/init.d/ke-recv stop
mode=$(cat $OTG_MODE)
case $mode in
        host)
                echo "switching host -> client"
                disable_host
                ;;
        peripheral)
                echo "switching client -> host"
                enable_host
                ;;
esac
/etc/init.d/ke-recv start
Originally Posted by desiv View Post
So, do I need to flash (--enable-usb-host-mode) it AND do this, or does the flashing just do that?
No, you don't need to set the flag. It is detected at boot time and linuxrc script just the same switch as above, no other magic involved.

Originally Posted by desiv View Post
Do I use to flasher to enable it so it will boot with support and load drivers and then I can toggle it off and on with the above?
If you want usb host mode as a default and don't want to mess with inserting modules the yes. Otherwise setting the host mode flag is not needed at all.
Originally Posted by desiv View Post
Can I just enable usb host without RD mode?
Yes.


BTW I tried USB host mode only recently when I got external USB enclosure for 2.5" disk. It comes with mini-USB cable with Y-power splitter i.e. one extra usb plug to provide additional power. This cable is enough to have usb host mode working on n770, no other hacking needed. You just need to insert the extra cable to something powered. I have 5V travel charger with usb female socket and it worked just fine. For mobile usage I plan to make pack of 4xAA rechargeables (4*1.2V=~4.8V) with usb female socket.
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.
 

The Following User Says Thank You to fanoush For This Useful Post:
Posts: 12 | Thanked: 0 times | Joined on Jul 2007
#22
So what cable exactly do you need if you want to connect a USB flash drive?
 
Hedgecore's Avatar
Posts: 1,361 | Thanked: 115 times | Joined on Oct 2005 @ Toronto, Ontario, Canada
#23
You need to build a power injector. While you can put the USB port on the 770 into host mode, it won't supply the 5 volts required.

Google "thoughtfix 770 USB hub" and you should find a link to Thoughtfix's plans for one. While it's dealing with electronic components, it's very easy and cheap to put together. Note that voltage regulators still draw power even if the device isn't on so you may want to put a switch in there. (My 9 volt died in a few days because of this).

*** note: I should mention that my 40GB mp3 player acts as a flash drive when plugged into a PC. I was able to mount it and play movies/mp3s off of it no problem.
 
Posts: 26 | Thanked: 0 times | Joined on Aug 2007
#24
Power injector...

I have a battery holder here that takes 4 AAs. I'm thinking about using it with (4 NiMH AAs == 4.8v) as a power injector. That tied to a (mini-B-M to A-F) cable would allow me to use a single USB device with my 770 without too much cabling and hubs and such.

Think the 4.8v will be sufficient?

Last edited by dewzenol; 2007-08-12 at 08:43. Reason: sub
 
Posts: 5 | Thanked: 0 times | Joined on Aug 2007
#25
Wait, so do battery powered mp3 players require powered USB ports? I'd assume no, but I'm always wrong with these things. My 3rd gen iPod cannot be charged through usb, so it wouldn't make sense if it required a powered USB port.
 
Posts: 5 | Thanked: 0 times | Joined on Aug 2007
#26
fanoush:

Would it then be possible to create a link from the desktop to your script? How would this be done? I want to use this in the car on the go. Thanks.
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:57.