OpenWrt Forum Archive

Topic: [TP-Link 150M TL-MR10U][solved] add USB port to extend disk space

The content of this topic has been archived on 1 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

at first I would like to thank you all for your work !

I have installed OpenWrt on a TL-MR10U this week.

I have plugged an Arduino on the available USB port:

It works, I can see serial output, so happy :-)

I would like to add a web interface in order to display a water level,
put some html forms elements to be able to switch on/off some relays
managed by Arduino.

I seems that TL-MR10U miss some disk space, so I wonder if it could
be possible to add another USB port (first is used by Arduino) in order
to plug a USB stick ?
(and add extra disk space like some other hardware mods)

(Last edited by Jodaille on 28 Jun 2014, 11:27)

Jodaille wrote:

I seems that TL-MR10U miss some disk space, so I wonder if it could be possible to add another USB port

Sure, that's called an "USB hub" ;-)


Jodaille wrote:

(first is used by Arduino) in order to plug a USB stick ?
(and add extra disk space like some other hardware mods)

see http://wiki.openwrt.org/doc/howto/extroot about how to increase storage space via USB stick.

Hello tmo26,

thank you for the tip and thank you for the link :-)

Hello,

I have found an USB hub, well detected and works with Arduino plugged in it.

I have also plugged two differents USB sticks, they are detected (cf: dmesg output "new device ..."),
but kernel does not see them as mass storage devices nor partitions detected.

This sticks works on my Linux desktop.

I have followed your link about extroot and http://wiki.openwrt.org/doc/howto/usb.storage
but no chance.

Is there another step I have missed ?

Post the output of

dmesg | grep -E 'usb|scsi|SCSI|sd |sda|sdb|-fs'

and

opkg list-installed kmod-fs*

and

uci show fstab

and

block info
or alternatively: block detect
or alternatively: blkid

(Last edited by tmo26 on 26 Jun 2014, 17:40)

Hello tmo26 and thank you,

root@JoduinoOpenWrt:~# dmesg | grep -E 'usb|scsi|SCSI|sd |sda|sdb|-fs'
[    3.990000] usbcore: registered new interface driver usbfs
[    4.000000] usbcore: registered new interface driver hub
[    4.000000] usbcore: registered new device driver usb
[    4.510000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    4.960000] usb 1-1.1: new full-speed USB device number 3 using ehci-platform
[    5.120000] usb 1-1.1: new high-speed USB device number 4 using ehci-platform
[   10.200000] usbcore: registered new interface driver cdc_acm
[   10.270000] usbcore: registered new interface driver usbserial
[   10.280000] usbcore: registered new interface driver usbserial_generic
[   10.280000] usbserial: USB Serial support registered for generic
[   10.410000] usbcore: registered new interface driver ftdi_sio
[   10.430000] usbserial: USB Serial support registered for FTDI USB Serial Device
[   27.840000] usb 1-1.3: new full-speed USB device number 5 using ehci-platform
[   28.370000] usb 1-1.3: Detected FT232RL
[   28.370000] usb 1-1.3: Number of endpoints 2
[   28.380000] usb 1-1.3: Endpoint 1 MaxPacketSize 16384
[   28.380000] usb 1-1.3: Endpoint 2 MaxPacketSize 16384
[   28.390000] usb 1-1.3: Setting MaxPacketSize 64
[   28.400000] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
root@JoduinoOpenWrt:~# opkg list-installed kmod-fs*

(no results)

root@JoduinoOpenWrt:~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap=0
fstab.@global[0].anon_mount=0
fstab.@global[0].auto_swap=1
fstab.@global[0].auto_mount=1
fstab.@global[0].delay_root=5
fstab.@global[0].check_fs=0
root@JoduinoOpenWrt:~# block info
/dev/mtdblock2: UUID="bb509645-ada24903-62d4f345-aa484640" VERSION="4.0" TYPE="squashfs"
/dev/mtdblock3: TYPE="jffs2"
root@JoduinoOpenWrt:~# block detect
config 'global'
        option  anon_swap       '0'
        option  anon_mount      '0'
        option  auto_swap       '1'
        option  auto_mount      '1'
        option  delay_root      '5'
        option  check_fs        '0'
root@JoduinoOpenWrt:~# blkid
-ash: blkid: not found

I have no fs modules trying vfat :

opkg install kmod-fs-vfat
Installing kmod-fs-vfat (3.10.36-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/kmod-fs-vfat_3.10.36-1_ar71xx.ipk.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-vfat:
 *      kernel (= 3.10.36-1-427233cd53f4a891ecf66f4299844a5a) * 
 * opkg_install_cmd: Cannot install package kmod-fs-vfat.

I have play a lot with and maybe too much : need to make some clean.

nice to be able to switch on and off the arduino :-)

echo 0 >  /sys/class/gpio/gpio18/value
echo 1 >  /sys/class/gpio/gpio18/value
 

(Last edited by Jodaille on 26 Jun 2014, 19:42)

Jodaille wrote:

Hello tmo26 and thank you,

root@JoduinoOpenWrt:~# opkg list-installed kmod-fs*

(no results)

You need to install some filesystem, but you already got that idea, as I can see below smile

I have no fs modules trying vfat :

opkg install kmod-fs-vfat
Installing kmod-fs-vfat (3.10.36-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/kmod-fs-vfat_3.10.36-1_ar71xx.ipk.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-vfat:
 *      kernel (= 3.10.36-1-427233cd53f4a891ecf66f4299844a5a) * 
 * opkg_install_cmd: Cannot install package kmod-fs-vfat.

The kernel changed in the meantime. Update your image.

Hello,
I have not kept the outputs but below are the commands I have done :

cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr10u-v1-squashfs-sysupgrade.bin
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/md5sums
md5sum -c md5sums 2> /dev/null | grep OK
sysupgrade -v openwrt-ar71xx-generic-tl-mr10u-v1-squashfs-sysupgrade.bin

After this, led was blinking, screen stopped on a message like "reboot" :
I switch it off then on.

Plenty of new free space now :-)
I only have to edit my /etc/resolv.conf to access internet then  :

   8 opkg update
   9 opkg install kmod-fs-vfat
  10 opkg list | grep kmod-fs
  11 opkg install kmod-fs-ext4
  31 opkg install kmod-usb-storage
  32 opkg install block-mount

Insmod of ext4 report me an error but after a reboot "tadam" \o/ :

root@JoduinoOpenWrt:~#  dmesg | grep -E 'usb|scsi|SCSI|sd |sda|sdb|-fs'
[    3.990000] usbcore: registered new interface driver usbfs
[    3.990000] usbcore: registered new interface driver hub
[    4.000000] usbcore: registered new device driver usb
[    4.430000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    4.870000] usb 1-1.1: new full-speed USB device number 3 using ehci-platform
[    5.030000] usb 1-1.1: new high-speed USB device number 4 using ehci-platform
[    5.220000] usb 1-1.2: new full-speed USB device number 5 using ehci-platform
[    5.410000] usb 1-1.3: new full-speed USB device number 6 using ehci-platform
[    8.720000] SCSI subsystem initialized
[    8.730000] usb-storage 1-1.1:1.0: USB Mass Storage device detected
[    8.740000] scsi0 : usb-storage 1-1.1:1.0
[    8.740000] usbcore: registered new interface driver usb-storage
[    9.740000] scsi 0:0:0:0: Direct-Access     General  USB Flash Disk   1.0  PQ: 0 ANSI: 2
[    9.750000] sd 0:0:0:0: [sda] 3913728 512-byte logical blocks: (2.00 GB/1.86 GiB)
[    9.760000] sd 0:0:0:0: [sda] Write Protect is off
[    9.760000] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[    9.760000] sd 0:0:0:0: [sda] No Caching mode page found
[    9.770000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.780000] sd 0:0:0:0: [sda] No Caching mode page found
[    9.780000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.800000]  sda: sda1
[    9.800000] sd 0:0:0:0: [sda] No Caching mode page found
[    9.810000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.810000] sd 0:0:0:0: [sda] Attached SCSI removable disk

Now we can see sda and its sda1 vfat partition  :

root@JoduinoOpenWrt:~# cat /proc/partitions 
major minor  #blocks  name

  31        0        128 mtdblock0
  31        1       1069 mtdblock1
  31        2       2834 mtdblock2
  31        3        960 mtdblock3
  31        4         64 mtdblock4
  31        5       3904 mtdblock5
   8        0    1956864 sda
   8        1    1956848 sda1

Thank you tmo26 ! :-)

Next extroot.

Glad I could help! smile

I have missed something in the doc http://wiki.openwrt.org/doc/howto/usb.storage

root@JoduinoOpenWrt:~# mkdir -p /mount/sda1
root@JoduinoOpenWrt:~# mount -t vfat /dev/sda1 /mount/sda1
mount: mounting /dev/sda1 on /mount/sda1 failed: Invalid argument

The piece is :

opkg install kmod-usb-storage block-mount block-hotplug kmod-fs-ext4 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1

It can mount vfat partition now.

Parition converted and format to ext4
extroot mode overlay works:

root@JoduinoOpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.8G      4.5M      1.7G   0% /
/dev/root                 2.0M      2.0M         0 100% /rom
tmpfs                    14.1M     60.0K     14.0M   0% /tmp
/dev/sda1                 1.8G      4.5M      1.7G   0% /overlay
overlayfs:/overlay        1.8G      4.5M      1.7G   0% /
tmpfs                   512.0K         0    512.0K   0% /dev

It seems to have only 2M for /rom, I have to read about mtd structure.

It now has 1.7G hourra ! :-)

The discussion might have continued from here.