2013-03-31

Olinuxino Disable USB device

I've found that the onboard wifi on my Olinuxino adapter wasn't working very well so I decided to shut it off and use an external adapter.

To do this you can use the following steps:
  1. List the usb devices
  2. root@debian:~# lsusb 
    Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
    Bus 002 Device 005: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
    Bus 002 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
    
    
    
  3. Find your device
  4. root@debian:~# cat /sys/bus/usb/devices/2-1.4/idProduct 
    8176
    
    
    
  5. Turn off the network interface
  6. root@debian:~# ifconfig wlan6 down
    
    
    
  7. Disable the usb wifi adapter
  8. root@debian:~# echo 1> /sys/bus/usb/devices/2-1.4/remove
    
    
    
  9. Check if it disappears
  10. root@debian:~# lsusb 
    Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
    Bus 002 Device 005: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
    
    
  11. Check kernel messages:
  12. root@debian:~# dmesg | tail -n 2
    [ 4229.480000] usb 2-1.4: reset high speed USB device number 4 using sw-ehci
    [ 4229.600000] usb 2-1.4: USB disconnect, device number 4
    

*** UPDATE ***
Fast way to find and remove the device:
root@debian:~# find /sys/ | grep wlan6 | grep dev_id | cut -d'/' -f -8
/sys/devices/platform/sw-ehci.1/usb2/2-1/2-1.4
root@debian:~# echo "1" > /sys/devices/platform/sw-ehci.1/usb2/2-1/2-1.4/remove


Olinuxino A13 Memory Benchmark

Small test of Internal NAND memory and external micro SD Card for Olinuxino A13:

  • External microSD Memory:
  • System:
    • root@debian:~# uname -a
      Linux debian 3.0.42+ #1 PREEMPT Fri Nov 9 02:04:58 EST 2012 armv7l GNU/Linux
      
  • Results:
    • root@debian:~# dd if=/dev/mmcblk0 of=/dev/null bs=2M count=100
      100+0 records in
      100+0 records out
      209715200 bytes (210 MB) copied, 10.2158 s, 20.5 MB/s
      root@debian:~# dd if=/dev/nandi of=/dev/null bs=2M count=100
      100+0 records in
      100+0 records out
      209715200 bytes (210 MB) copied, 41.9207 s, 5.0 MB/s