Results 1 to 7 of 7

Thread: Terminal (shell) command for USB port

  1. #1
    Join Date
    Apr 2009
    Beans
    21
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Terminal (shell) command for USB port

    Shalom and Hi to everybody,

    I'm looking for an Ubuntu-Terminal (shell) command that would turn off ONE of the USB ports in my PC, and another command that would revive it (turn it back on).
    Anything that shuts the power down in the socket (in one port only) would be great.

    Thanks in advance.

  2. #2
    Join Date
    Jul 2006
    Location
    Here
    Beans
    9,973

    Re: Terminal (shell) command for USB port

    i don't think you can do just 1 port, it's all 1 system "usbcore".
    what device is at the end of that port that you want to restart?

    anyways it's> sudo rmmod usbcore <to remove
    or
    sudo modprobe -r usbcore

    to restart it> sudo modprobe usbcore

    it's better to do the device if you can, usbcore will take out all usb's.
    i use it when i suspend, cause it won't suspend with my usb wifi connected.

  3. #3
    Join Date
    Apr 2009
    Beans
    21
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Terminal (shell) command for USB port

    trying "sudo modprobe -r usbcore" I got:

    FATAL: Module usbcore is in use.

    and trying "sudo rmmod usbcore" I got:

    ERROR: Module usbcore is in use by rt73usb,rt2x00usb,xpad,usbhid,uhci_hcd,ehci_hcd

    am I supposed to kill some proccess before rmmmoding the usbcore?

  4. #4
    Join Date
    Jul 2006
    Location
    Here
    Beans
    9,973

    Re: Terminal (shell) command for USB port

    what are you trying to do? why do you need to mess with the usb at all?

  5. #5
    Join Date
    Apr 2009
    Beans
    21
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Terminal (shell) command for USB port

    My wifi connection drops once a day or so,
    and it won't re-connect unless I unplug+replug the usb dongle (wifi adapter).

    I would like to make the computer think I've unplugged+replugged it, by shell command (and run it periodically by cron, when the connection drops).



    so, what else do I need to do before "sudo modprobe -r usbcore" to make it work?
    (so it won't say "ERROR: Module usbcore is in use by rt73usb,rt2x00usb,xpad,usbhid,uhci_hcd,ehci_hcd").

  6. #6
    Join Date
    Jul 2006
    Location
    Here
    Beans
    9,973

    Re: Terminal (shell) command for USB port

    then you only need to do the wifi drivers.

    sudo modprobe -r rt73usb rt2x00usb
    sudo modprobe rt73usb rt2x00usb

    or
    you could try restarting it:
    sudo ifconfig ra0 down
    sudo ifconfig ra0 up

    or
    try changing your router beacon period most are set to 60 to 100 secs, but the connection times out around 30. i set mine to 25 and don't have dropped connections anymore.
    also look at what other connections are on and use a different channel than every 1 else.
    i use wicd so it's easy for me, you can use "sudo iwlist ra0 scan".
    Last edited by kerry_s; April 30th, 2009 at 01:30 AM.

  7. #7

    Re: Terminal (shell) command for USB port

    Hey, I have the same problem with my external hard drive, do these commands do all the ports at once? or is there a way to detect which port my hard drive is plugged in, I have to un-plug it and plug it back in every time I restart my computer. I think it has something to do with it not seeing the hard drive turn on if it is already on it just does not notice it there? or something like that haha im still a little new..

    Next thing I am wondering is if I can put these into a Perl script for start up or is there an easier way to do this??

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •