1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Cannot mount SD card on USB 4G modem

Discussion in 'Asuswrt-Merlin' started by GeeM, Mar 20, 2019.

  1. GeeM

    GeeM New Around Here

    Joined:
    Mar 20, 2019
    Messages:
    2
    Dear SNB community,

    I recently discovered the power of AsusWRT Merlin and I want to benefit from some extended features such as Diversion.

    I tried to install it with a simple USB thumb drive and it worked perfectly. However, with my USB 4G modem (configured in failover mode in case my main broadband goes down), that means both of my USB ports are used. I would like to keep one USB port available for a USB printer.

    I found there is a SD card reader built-in my USB 4G modem (Huawei E3276) which would, in theory, make it ideal for me as I can have my USB 4G modem and an external storage all in one USB port. I inserted a 4GB micro-SD card into the 4G modem but it shows as "Unmounted".

    When I connect to the admin interface, it seems both devices (4G modem and SD card) are recognized:[​IMG]

    Although I am very beginner in Linux commands, I found some commands on the internet and and it seems my devices are correctly recognized:
    Code:
    Every 2s: dmesg | tail -20                                 
    
    sd 3:0:0:0: [sda] Assuming drive cache: write through
    sd 3:0:0:0: [sda] Attached SCSI removable disk
    usbcore: registered new interface driver usbserial
    USB Serial support registered for generic
    usbcore: registered new interface driver usbserial_generic
    usbserial: USB Serial Driver core
    USB Serial support registered for GSM modem (1-port)
    option 1-2:1.0: GSM modem (1-port) converter detected
    usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
    option 1-2:1.1: GSM modem (1-port) converter detected
    usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1
    option 1-2:1.2: GSM modem (1-port) converter detected
    usb 1-2: GSM modem (1-port) converter now attached to ttyUSB2
    usbcore: registered new interface driver option
    option: v0.7.2:USB Driver for GSM modems
    
    gro disabled
    
    gro disabled
    br0: received packet on eth1 with own address as source address

    Any idea how to get my SD card mounted and use both the SD card AND the 4G modem together (ie.: Diversion on the SD card and the 4G modem as a backup WAN connection)?

    Thank you for your help :)
     
  2. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    29,848
    Location:
    Canada
    Make sure the card is formatted in FAT32, NTFS or ext3/ext4. exFAT is not supported.
     
  3. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    8,595
    This looks like an interesting project!

    I would install amtm to the jffs partition and see if you can format the SD card using the built-in amtm option.

    https://diversion.ch/amtm.html

    I would recommend using Ext4 with journalling enabled. After that is successfully created and the router has rebooted, enable the disk checking utility.

    Finally, create a swap file (I always use the maximum 2GB option). Your router and SD card should be ready to use for all available scripts. :)
     
  4. GeeM

    GeeM New Around Here

    Joined:
    Mar 20, 2019
    Messages:
    2
    The SD card was formatted in ext4 using minitool partition. Interestingly, I managed to get it working and install Diversion on it once after disabling the 4G modem. But now that swtiched back to the 4G modem, the SD card still seems to be detected but cannot be mounted for some reasons...


    Thanks for your advice, I will have to learn how to do that :D I will check it out and let you know ;)
     
    L&LD likes this.
  5. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    29,848
    Location:
    Canada
    Possible that this kind of device is simply not compatible.
     
  6. sfx2000

    sfx2000 Part of the Furniture

    Joined:
    Aug 11, 2011
    Messages:
    13,944
    Location:
    San Diego, CA
    That's what I was thinking - Huawei modems fall broadly into two categories - "normal" and HiLink... the way to tell is HiLink has a webserver in the modem, where when plugged into Windows, you go to the modem webpage to configure, and they are pretty problematic with Linux in general...

    (I try to avoid Huawei modems for linux because of these odd behaviors - that being said, they're good modems for Windows, and available at a very good price)

    Huawei first starts up as a USB Mass Storage Device, which is flash on the modem, with windows connectivity software installer,

    modeswitch should flip it over into USB Modem mode (usually three endpoints - ttyusb0 for diag, ttyusb1 for the AT command interface, and then a cdc-wdm0 which is the binary driver level data interface (either QMI for qualcomm chipsets, or mbim for other chips).

    modeswitch can disable the other storage endpoint (the card reader), really depends on the Huawei firmware there.

    I've been doing a fair amount of integration work lately on OpenWRT working on Telit and uBlox (Lara) modems, which are modules, not USB stick type modems - and it's been an interesting learning experience.
     
  7. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    29,848
    Location:
    Canada
    Asus's compatibility list has a fairly long list of Huawei devices (which makes sense since Asus is Taiwanese), however I don't think they focus on the added functions such as card readers, probably only on the modem side of things.
     
  8. sfx2000

    sfx2000 Part of the Furniture

    Joined:
    Aug 11, 2011
    Messages:
    13,944
    Location:
    San Diego, CA
    Yes...

    Modem support isn't easy stuff - and some vendors do a better job than others - Asus does better than most here...

    It's getting a bit easier these days with modern kernels - QMI and MBIM solve a lot of problems, and the USB forum's work on CDC-WDM have standardized support at the driver level - still, there's implementation details, and some gaps that need to be covered...

    https://github.com/torvalds/linux/blob/master/drivers/usb/class/cdc-wdm.c

    ModemManager is pretty darn slick, but it's a bit large for embedded linux, as it also needs to pull in some dependencies that can make things tight for small flash platforms. I was able to squeeze it down to fit into a 16 meg NOR flash with 4.9 kernel, but not much room for anything else..