Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Can't get Huawei 4g modem working

    Scheduled Pinned Locked Moved Hardware
    9 Posts 2 Posters 541 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      elexir
      last edited by

      Hi,

      I just installed a Huawei E398 modem on my pfsense box but I can't get it working. I'm a bit new on this and would appreciate any help to get it up and running!

      I'm currently on version 2.4.5-RELEASE-p1 (amd64).

      The modem is listed as working on this page:
      this page.

      The problem is from what I understand that the modems presents it self as a storage unit instead of a modem.

      [2.4.5-RELEASE][root@fw01.xxxx]/root: usbconfig -d 0.2 dump_device_desc
      ugen0.2: <Huawei Technologies HUAWEI Mobile> at usbus0, cfg=255 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
      
        bLength = 0x0012
        bDescriptorType = 0x0001
        bcdUSB = 0x0200
        bDeviceClass = 0x0000  <Probed by interface class>
        bDeviceSubClass = 0x0000
        bDeviceProtocol = 0x0000
        bMaxPacketSize0 = 0x0040
        idVendor = 0x12d1
        idProduct = 0x1446
        bcdDevice = 0x0000
        iManufacturer = 0x0003  <Huawei Technologies>
        iProduct = 0x0002  <HUAWEI Mobile>
        iSerialNumber = 0x0000  <no string>
        bNumConfigurations = 0x0001
      
      

      Tried to eject the media unit as the page with known working modems says but it doesn't work:

      [2.4.5-RELEASE][root@fw01.xxxxxxxx]/root: camcontrol eject cd0
      camcontrol: cam_lookup_pass: CAMGETPASSTHRU ioctl failed
      cam_lookup_pass: No such file or directory
      cam_lookup_pass: either the pass driver isn't in your kernel
      cam_lookup_pass: or cd0 doesn't exist
      [2.4.5-RELEASE][root@fw01.xxxxxxxxxx]/root: camcontrol devlist
      <Hoodisk SSD SBFM01.3>             at scbus0 target 0 lun 0 (pass0,ada0)
      
      

      When I try following this instruction with usb_modeswitch I get the following error:

      [2.4.5-RELEASE][root@fw01.xxxxxxxx]/root: usb_modeswitch  -v 12d1 -p 1446 -V 12d1 -P 140c -M "55534243123456780000000000000011060000000000000000000000000000" -s 10
      Look for target devices ...
       No devices in target mode or class found
      Look for default devices ...
       Found devices in default mode (1)
      Access device 002 on bus 000
      Get the current device configuration ...
       Determining the active configuration failed (error -5). Abort
      
      

      Any tips on what I should try next?

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        Try usbconfig -d 0.2 dump_all_config_desc see if it has more than one config index and what interfaces they present.

        Steve

        E 1 Reply Last reply Reply Quote 0
        • E
          elexir @stephenw10
          last edited by

          Thanks for the reply @stephenw10 !

          If I understand the output correct, there is only one config index there (Configuration index 0):

          [2.4.5-RELEASE][root@fw01.xxxxxxxx]/root: usbconfig -d 0.2 dump_all_config_desc
          ugen0.2: <Huawei Technologies HUAWEI Mobile> at usbus0, cfg=255 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
          
          
           Configuration index 0
          
              bLength = 0x0009
              bDescriptorType = 0x0002
              wTotalLength = 0x0020
              bNumInterfaces = 0x0001
              bConfigurationValue = 0x0001
              iConfiguration = 0x0001  <Huawei Configuration>
              bmAttributes = 0x00c0
              bMaxPower = 0x00fa
          
              Interface 0
                bLength = 0x0009
                bDescriptorType = 0x0004
                bInterfaceNumber = 0x0000
                bAlternateSetting = 0x0000
                bNumEndpoints = 0x0002
                bInterfaceClass = 0x0008  <Mass storage>
                bInterfaceSubClass = 0x0006
                bInterfaceProtocol = 0x0050
                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
          
          
          
          
          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Yes, and with only one interface, the mass storage device. It will need to be switched to modem mode somehow. Sometimes that can be done permanently in Windows using the supplied utility. Sometimes it can be done by changing the firmware. Other time it requires usbmodeswitch with the right incantation.

            Steve

            E 1 Reply Last reply Reply Quote 0
            • E
              elexir @stephenw10
              last edited by

              @stephenw10 said in Can't get Huawei 4g modem working:

              Yes, and with only one interface, the mass storage device. It will need to be switched to modem mode somehow. Sometimes that can be done permanently in Windows using the supplied utility. Sometimes it can be done by changing the firmware. Other time it requires usbmodeswitch with the right incantation.

              Steve

              Tried with installing the windows utility from the modem, could not find an upgrade option or config option in there. Got the latest version of the windows app from Huawei but couldn't find anything on upgrading/configuring the device there either.

              Tested to change mode from Windows by sending AT commands to the modem but it's still listed as a storage unit in pfsense :(

              Any suggestions on how I should run usb_modeswitch differently?

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                Not really. What you were doing there looks good. ๐Ÿ˜•

                Looks similar to this issue:
                https://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=2710&start=15

                Steve

                1 Reply Last reply Reply Quote 0
                • E
                  elexir
                  last edited by

                  Things are now looking much brighter! ๐Ÿ‘

                  I'm now able to get the interface up and get an IP address from the ISP. In case someone else have the same problem in the future, this is what I did.

                  First I ran the following AT command on the modem:

                  AT^SETPORT="1,2;1,2,3,7,A2"
                  

                  After that I did the following in pfsense:

                  [2.4.5-RELEASE][root@fw01.xxxxx]/root: usbconfig -d 0.2 reset
                  [2.4.5-RELEASE][root@fw01.xxxxx]/root: usbconfig -d 0.2 dump_all_config_desc
                  ugen0.2: <Huawei Technologies HUAWEI Mobile> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
                  
                  
                   Configuration index 0
                  
                      bLength = 0x0009
                      bDescriptorType = 0x0002
                      wTotalLength = 0x00a1
                      bNumInterfaces = 0x0006
                      bConfigurationValue = 0x0001
                      iConfiguration = 0x0001  <Huawei Configuration>
                      bmAttributes = 0x00c0
                      bMaxPower = 0x00fa
                  
                      Interface 0
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0000
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0003
                        bInterfaceClass = 0x00ff  <Vendor specific>
                        bInterfaceSubClass = 0x00ff
                        bInterfaceProtocol = 0x00ff
                        iInterface = 0x0000  <no string>
                  
                       Endpoint 0
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0081  <IN>
                          bmAttributes = 0x0003  <INTERRUPT>
                          wMaxPacketSize = 0x0040
                          bInterval = 0x0005
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 1
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0082  <IN>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 2
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0001  <OUT>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                  
                      Interface 1
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0001
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0003
                        bInterfaceClass = 0x00ff  <Vendor specific>
                        bInterfaceSubClass = 0x00ff
                        bInterfaceProtocol = 0x00ff
                        iInterface = 0x0000  <no string>
                  
                       Endpoint 0
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0083  <IN>
                          bmAttributes = 0x0003  <INTERRUPT>
                          wMaxPacketSize = 0x0040
                          bInterval = 0x0005
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 1
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0084  <IN>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 2
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0002  <OUT>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                  
                      Interface 2
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0002
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0002
                        bInterfaceClass = 0x00ff  <Vendor specific>
                        bInterfaceSubClass = 0x00ff
                        bInterfaceProtocol = 0x00ff
                        iInterface = 0x0000  <no string>
                  
                       Endpoint 0
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0085  <IN>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 1
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0003  <OUT>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                  
                      Interface 3
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0003
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0002
                        bInterfaceClass = 0x00ff  <Vendor specific>
                        bInterfaceSubClass = 0x00ff
                        bInterfaceProtocol = 0x00ff
                        iInterface = 0x0000  <no string>
                  
                       Endpoint 0
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0086  <IN>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 1
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0004  <OUT>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0020
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                  
                      Interface 4
                        bLength = 0x0009
                        bDescriptorType = 0x0004
                        bInterfaceNumber = 0x0004
                        bAlternateSetting = 0x0000
                        bNumEndpoints = 0x0002
                        bInterfaceClass = 0x0008  <Mass storage>
                        bInterfaceSubClass = 0x0006
                        bInterfaceProtocol = 0x0050
                        iInterface = 0x0000  <no string>
                  
                       Endpoint 0
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0087  <IN>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0000
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 1
                          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 = 0x0000  <no string>
                  
                       Endpoint 0
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0006  <OUT>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0000
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                       Endpoint 1
                          bLength = 0x0007
                          bDescriptorType = 0x0005
                          bEndpointAddress = 0x0088  <IN>
                          bmAttributes = 0x0002  <BULK>
                          wMaxPacketSize = 0x0200
                          bInterval = 0x0000
                          bRefresh = 0x0000
                          bSynchAddress = 0x0000
                  
                  
                  
                  [2.4.5-RELEASE][root@fw01.xxxxx]/root: ls /dev/cuaU*
                  /dev/cuaU0.0      /dev/cuaU0.1      /dev/cuaU0.2      /dev/cuaU0.3
                  /dev/cuaU0.0.init /dev/cuaU0.1.init /dev/cuaU0.2.init /dev/cuaU0.3.init
                  /dev/cuaU0.0.lock /dev/cuaU0.1.lock /dev/cuaU0.2.lock /dev/cuaU0.3.lock
                  
                  

                  @stephenw10 Thanks for the help!

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    Ah, nice!

                    So you ran at AT command in Windows/Linux?

                    Steve

                    E 1 Reply Last reply Reply Quote 0
                    • E
                      elexir @stephenw10
                      last edited by

                      @stephenw10 said in Can't get Huawei 4g modem working:

                      Ah, nice!

                      So you ran at AT command in Windows/Linux?

                      Steve

                      I ran the AT command on a Windows box and then moved the modem over to the pfsense box.

                      1 Reply Last reply Reply Quote 1
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.