D-Link DWM-222 USB LTE Dongle



  • I have a D-Link DWM-222 USB 4G LTE dongle that has been running perfectly on a Linux machine, and now im looking to use it as a backup WAN interface on pfSense 2.4.3.

    The problem is that the dongle dosent appear as a modem/network device and is similar to this thread.

    I have installed usb_modeswitch and the USB dongle seems to be in the correct mode (0x7e35 is the same mode that works in Linux) but when checking dmesg the system references a storage device. When the device was setup for Linux i had to run echo "2001 7e35" > /sys/bus/usb-serial/drivers/option1/new_id before any devices appeared under /dev. Is there a pfSense/BSD counterpart?

    The thread i linked to mentioned recompiling the pfSense kernel with the latest version of u3g, but its a 2 year old thread so i imagine that that particular version of u3g is now included.

    Any tips/ideas?

    usbconfig -d ugen2.2 dump_device_desc
    ugen2.2: <Mobile Connect Mobile Connect> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
    
      bLength = 0x0012
      bDescriptorType = 0x0001
      bcdUSB = 0x0201
      bDeviceClass = 0x0000  <Probed by interface class>
      bDeviceSubClass = 0x0000
      bDeviceProtocol = 0x0000
      bMaxPacketSize0 = 0x0040
      idVendor = 0x2001
      idProduct = 0x7e35
      bcdDevice = 0x0228
      iManufacturer = 0x0001  <Mobile Connect>
      iProduct = 0x0002  <Mobile Connect>
      iSerialNumber = 0x0003  <0123456789ABCDEF>
      bNumConfigurations = 0x0001
    
    ugen2.2: <Mobile Connect Mobile Connect> at usbus2
    umass0 on uhub5
    umass0: <Mass Storage> on usbus2
    da1 at umass-sim0 bus 0 scbus4 target 0 lun 0
    da1: < SD Storage 0000> Removable Direct Access SCSI-2 device
    da1: 40.000MB/s transfers
    da1: Attempt to query device size failed: ILLEGAL REQUEST, Invalid command operation
    da1: quirks=0x2<NO_6_BYTE>
    

  • Netgate Administrator

    What does this show?: usbconfog -d ugen2.2 dump_all_config_desc

    That appears to be the correct mode at least.

    Steve



  • Hi @stephenw10

    Here is the output you requested:

    usbconfig -d ugen2.2 dump_all_config_desc
    ugen2.2: <Mobile Connect Mobile Connect> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
    
    
     Configuration index 0
    
        bLength = 0x0009
        bDescriptorType = 0x0002
        wTotalLength = 0x00e8
        bNumInterfaces = 0x0006
        bConfigurationValue = 0x0001
        iConfiguration = 0x0000  <no string>
        bmAttributes = 0x0080
        bMaxPower = 0x00fa
    
        Interface 0
          bLength = 0x0009
          bDescriptorType = 0x0004
          bInterfaceNumber = 0x0000
          bAlternateSetting = 0x0000
          bNumEndpoints = 0x0002
          bInterfaceClass = 0x00ff  <Vendor specific>
          bInterfaceSubClass = 0x00ff
          bInterfaceProtocol = 0x00ff
          iInterface = 0x0000  <no string>
    
         Endpoint 0
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0081  <IN>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 1
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0001  <OUT>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
    
        Interface 1
          bLength = 0x0009
          bDescriptorType = 0x0004
          bInterfaceNumber = 0x0001
          bAlternateSetting = 0x0000
          bNumEndpoints = 0x0003
          bInterfaceClass = 0x00ff  <Vendor specific>
          bInterfaceSubClass = 0x0000
          bInterfaceProtocol = 0x0000
          iInterface = 0x0000  <no string>
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x00
           RAW dump:
           0x00 | 0x05, 0x24, 0x00, 0x10, 0x01
    
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x01
           RAW dump:
           0x00 | 0x05, 0x24, 0x01, 0x00, 0x00
    
    
          Additional Descriptor
    
          bLength = 0x04
          bDescriptorType = 0x24
          bDescriptorSubType = 0x02
           RAW dump:
           0x00 | 0x04, 0x24, 0x02, 0x02
    
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x06
           RAW dump:
           0x00 | 0x05, 0x24, 0x06, 0x00, 0x00
    
    
         Endpoint 0
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0083  <IN>
            bmAttributes = 0x0003  <INTERRUPT>
            wMaxPacketSize = 0x000a
            bInterval = 0x0009
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 1
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0082  <IN>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 2
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0002  <OUT>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
    
        Interface 2
          bLength = 0x0009
          bDescriptorType = 0x0004
          bInterfaceNumber = 0x0002
          bAlternateSetting = 0x0000
          bNumEndpoints = 0x0003
          bInterfaceClass = 0x00ff  <Vendor specific>
          bInterfaceSubClass = 0x0000
          bInterfaceProtocol = 0x0000
          iInterface = 0x0000  <no string>
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x00
           RAW dump:
           0x00 | 0x05, 0x24, 0x00, 0x10, 0x01
    
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x01
           RAW dump:
           0x00 | 0x05, 0x24, 0x01, 0x00, 0x00
    
    
          Additional Descriptor
    
          bLength = 0x04
          bDescriptorType = 0x24
          bDescriptorSubType = 0x02
           RAW dump:
           0x00 | 0x04, 0x24, 0x02, 0x02
    
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x06
           RAW dump:
           0x00 | 0x05, 0x24, 0x06, 0x00, 0x00
    
    
         Endpoint 0
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0085  <IN>
            bmAttributes = 0x0003  <INTERRUPT>
            wMaxPacketSize = 0x000a
            bInterval = 0x0009
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 1
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0084  <IN>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 2
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0003  <OUT>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
    
        Interface 3
          bLength = 0x0009
          bDescriptorType = 0x0004
          bInterfaceNumber = 0x0003
          bAlternateSetting = 0x0000
          bNumEndpoints = 0x0003
          bInterfaceClass = 0x00ff  <Vendor specific>
          bInterfaceSubClass = 0x0000
          bInterfaceProtocol = 0x0000
          iInterface = 0x0000  <no string>
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x00
           RAW dump:
           0x00 | 0x05, 0x24, 0x00, 0x10, 0x01
    
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x01
           RAW dump:
           0x00 | 0x05, 0x24, 0x01, 0x00, 0x00
    
    
          Additional Descriptor
    
          bLength = 0x04
          bDescriptorType = 0x24
          bDescriptorSubType = 0x02
           RAW dump:
           0x00 | 0x04, 0x24, 0x02, 0x02
    
    
          Additional Descriptor
    
          bLength = 0x05
          bDescriptorType = 0x24
          bDescriptorSubType = 0x06
           RAW dump:
           0x00 | 0x05, 0x24, 0x06, 0x00, 0x00
    
    
         Endpoint 0
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0087  <IN>
            bmAttributes = 0x0003  <INTERRUPT>
            wMaxPacketSize = 0x000a
            bInterval = 0x0009
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 1
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0086  <IN>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 2
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0004  <OUT>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
    
        Interface 4
          bLength = 0x0009
          bDescriptorType = 0x0004
          bInterfaceNumber = 0x0004
          bAlternateSetting = 0x0000
          bNumEndpoints = 0x0003
          bInterfaceClass = 0x00ff  <Vendor specific>
          bInterfaceSubClass = 0x00ff
          bInterfaceProtocol = 0x00ff
          iInterface = 0x0000  <no string>
    
         Endpoint 0
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0089  <IN>
            bmAttributes = 0x0003  <INTERRUPT>
            wMaxPacketSize = 0x0008
            bInterval = 0x0009
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 1
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0088  <IN>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 2
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0005  <OUT>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
    
        Interface 5
          bLength = 0x0009
          bDescriptorType = 0x0004
          bInterfaceNumber = 0x0005
          bAlternateSetting = 0x0000
          bNumEndpoints = 0x0002
          bInterfaceClass = 0x0008  <Mass storage>
          bInterfaceSubClass = 0x0006
          bInterfaceProtocol = 0x0050
          iInterface = 0x0004  <Mass Storage>
    
         Endpoint 0
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x008a  <IN>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0000
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    
         Endpoint 1
            bLength = 0x0007
            bDescriptorType = 0x0005
            bEndpointAddress = 0x0006  <OUT>
            bmAttributes = 0x0002  <BULK>
            wMaxPacketSize = 0x0200
            bInterval = 0x0001
            bRefresh = 0x0000
            bSynchAddress = 0x0000
    

  • Netgate Administrator

    Hmm, I was hoping there might have been more than one config index.
    It's unclear if that can be attached directly as a serial device or if it only operates in QMI mode. FreeBSD/pfSense has no support for QMI so the latter would be nothing we could do anything about.
    This seems to imply at has a direct AT interface though:
    http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?p=17090&sid=c42d79fffb93e20cc475b6402655039b#p17090

    It is shown in current FreeBSD dev lists though:
    https://github.com/freebsd/freebsd/blob/9e7534ea78acf644eb328d5ba27aca2cab72c915/sys/dev/usb/usbdevs#L1722

    ...and in u3g so it probably would work with FreeBSD 12:
    https://github.com/freebsd/freebsd/blob/9e7534ea78acf644eb328d5ba27aca2cab72c915/sys/dev/usb/serial/u3g.c#L241

    It was not in 11.2 though so will not be supported by pfSense 2.4.4 without back-porting that change to u3g.

    Steve



  • @stephenw10 when i was using the dongle in Linux i belive it was being used as a serial device so id like to give that a try. Any thoughts on how i can attach it directly as a serial device in BSD/pfSense? I also attempted to do some testing on FreeBSD 11.1, but no success.


  • Netgate Administrator

    First thing would be to try a FreeBSD 12 snapshot to confirm it is recognised and working there. No point wasting time otherwise. https://download.freebsd.org/ftp/snapshots/ISO-IMAGES/12.0/

    Recompiling to get that into 2.4.4 is non-trival though.

    Steve


 

© Copyright 2002 - 2018 Rubicon Communications, LLC | Privacy Policy