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

    Huawei k5160 4g usb mobile broadband

    Scheduled Pinned Locked Moved Hardware
    53 Posts 6 Posters 16.7k 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.
    • R
      rajbps
      last edited by

      Here is a usbconfig

      ugen1.1: <ehci root="" hub="" intel="">at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=S                                                                                                AVE (0mA)
      ugen0.1: <xhci root="" hub="" 0x8086="">at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr                                                                                                =SAVE (0mA)
      ugen2.1: <ehci root="" hub="" intel="">at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=S                                                                                                AVE (0mA)
      ugen1.2: <product 0x0024="" vendor="" 0x8087="">at usbus1, cfg=0 md=HOST spd=HIGH (480Mb                                                                                                ps) pwr=SAVE (0mA)
      ugen2.2: <product 0x0024="" vendor="" 0x8087="">at usbus2, cfg=0 md=HOST spd=HIGH (480Mb                                                                                                ps) pwr=SAVE (0mA)
      ugen0.2: <vodafone mobile="" broadband="" huawei="" vodafone="" group="">at usbus0, cfg

      usbconfig -d ugen0.2 dump_device_desc

      ugen0.2: <vodafone mobile="" broadband="" huawei="" vodafone="" group="">at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

      bLength = 0x0012
        bDescriptorType = 0x0001
        bcdUSB = 0x0200
        bDeviceClass = 0x0000
        bDeviceSubClass = 0x0000
        bDeviceProtocol = 0x0000
        bMaxPacketSize0 = 0x0040
        idVendor = 0x12d1
        idProduct = 0x1582
        bcdDevice = 0x0102
        iManufacturer = 0x0002  <vodafone group="" (huawei)="">iProduct = 0x0001  <vodafone mobile="" broadband="" (huawei)="">iSerialNumber = 0x0000  <no string="">bNumConfigurations = 0x0001

      and the modem is a Vodafone R215 4G Mobile Broadband WiFi WLAN which is a Huawei E5372

      Hope this helps

      Regards,

      Raj</no></vodafone></vodafone></vodafone></vodafone></product></product></ehci></xhci></ehci>

      1 Reply Last reply Reply Quote 0
      • A
        AndrewZ
        last edited by

        I will reply to the issue with E5372 here and will probably move this later to a separate topic dedicated to Huawei modems.

        In short - the main issue is with "idProduct = 0x1582". This modem does not have a "4G MODEM" in it's composition (check with AT^SETPORT=?), so the only option is to use it as a network card (NCM), but it seems that pfSense will not detect "cdce0" on the modem with unknown PID.

        But first I will post a WARNING:
        At some point a new interface ue0 will be created. If for some reasons the router will reboot while the modem is off or disconnected you will be trapped with the following message during boot:

        Warning: Configuration references interfaces that do not exist: ue0
        Network interface mismatch – Running interface assignment option.

        Have your console ready!

        Now the process:
        1. Flash the modem with the generic software like 21.290.21.00.00 (this is what I use)
        I cannot tell this is a mandatory, but most likely this is very important. Check the corresponding forums before flashing your modem if you don't need a brick :)
        You may need a flash code which is generated from IMEI.

        2. make sure the modem has the right composition, you should have a proper one after flashing. Checking from any terminal:

        Send:AT^SETPORT?
        
        Recieve: ^SETPORT:A1,A2;12,16,A1,A2
        Recieve: OK
        
        

        Setting the values if necessary:

        Send:AT^SETPORT="A1,A2;12,16,A1,A2"
        Recieve: OK
        
        

        3. Now it's time to plug it into the router. Checking with dmesg:

        ugen1.2: <huawei technology="">at usbus1
        u3g0: <huawei 0="" 2="" technology="" huawei="" mobile,="" class="" 0,="" rev="" 2.00="" 1.02,="" addr="">on usbus1
        u3g0: Found 1 port.
         followed by a lot of garbage about SCSI</huawei></huawei> 
        

        We can have CD-ROM component disabled, this will remove the garbage but will give as wrong "idProduct".

        4. checking "idProduct="

        /root: usbconfig -d ugen1.2 dump_device_desc
        ugen1.2: <huawei mobile="" huawei="" technology="">at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
        
          bLength = 0x0012 
          bDescriptorType = 0x0001 
          bcdUSB = 0x0200 
          bDeviceClass = 0x0000 
          bDeviceSubClass = 0x0000 
          bDeviceProtocol = 0x0000 
          bMaxPacketSize0 = 0x0040 
          idVendor = 0x12d1 
          idProduct = 0x1c1e 
          bcdDevice = 0x0102 
          iManufacturer = 0x0002  <huawei technology="">iProduct = 0x0001  <huawei mobile="">iSerialNumber = 0x0000  <no string="">bNumConfigurations = 0x0001</no></huawei></huawei></huawei> 
        

        5. pfSense 'knows' about "idProduct = 0x1c1e" and now we should have ue0 interface created. Checking:

        dmesg
        ue0: <usb ethernet=""> on cdce0
        
        ifconfig 
         ...
          ue0: flags=8843 <up,broadcast,running,simplex,multicast>metric 0 mtu 1500
         ...</up,broadcast,running,simplex,multicast></usb>
        

        6. From the browser: Interfaces - (assign) - add new (OPT2) or take an existing and choose ue0 from dropdown.
        7. Enable OPT2 and set it to DHCP
        8. System - Gateways - set the new one as Default and check:

        /root: netstat -r
        Routing tables
        
        Internet:
        Destination        Gateway            Flags      Netif Expire
        default            192.168.8.1        UGS         ue0
        
        

        The modem will assign an IP to OPT2, in this example 192.168.8.1 is a LAN address of the modem.
        Modem will connect to the Internet automatically if configured on the modem.

        9. Navigate to NAT - Outbound - pick the rule for LAN subnet and configure the Interface (==gateway)

        10. make sure everything works

        1 Reply Last reply Reply Quote 0
        • R
          rajbps
          last edited by

          Hi AndrewZ

          Thanks for the guide.

          Still have a few questions, sorry if they are silly but never done it before.

          "In short - the main issue is with "idProduct = 0x1582". This modem does not have a "4G MODEM" in it's composition (check with AT^SETPORT=?), so the only option is to use it as a network card (NCM), but it seems that pfSense will not detect "cdce0" on the modem with unknown PID."

          I do get a 4G signal with this modem

          "But first I will post a WARNING:
          At some point a new interface ue0 will be created. If for some reasons the router will reboot while the modem is off or disconnected you will be trapped with the following message during boot:
          Quote

          Warning: Configuration references interfaces that do not exist: ue0
              Network interface mismatch – Running interface assignment option.

          Have your console ready!"

          is there a way to avoid this, I think no but had to ask

          "Now the process:
          1. Flash the modem with the generic software like 21.290.21.00.00 (this is what I use)
          I cannot tell this is a mandatory, but most likely this is very important. Check the corresponding forums before flashing your modem if you don't need a brick :)
          You may need a flash code which is generated from IMEI."

          where can i get the firmware, this is a vodaphone one and if I go on the website of huawei, there is no firmware for this model

          Also as its usb connected and its going via productID, if i connect it to a different port, it should not be a problem should it. I think no again had to ask

          Regards,

          Raj

          1 Reply Last reply Reply Quote 0
          • A
            AndrewZ
            last edited by

            The whole story has no relation to the radio part (3G, 4G, signal level, etc).

            To avoid boot issues I suggest to always use the same USB port and keep the modem on. Alternatively you can have a backup configuration file with or without ue0 and load it then necessary.
            idProduct or PID depends on the modem itself, on it's branding and composition (CD-ROM + Network card). You should see the same PID regardless of port your modem is plugged in.

            I can send you some links to firmware files as well as a flash code. Please PM me with IMEI of the modem. Please be careful with upgrade - I heard that some people had issues loading generic/unbranded firmware on Vodafone branded 5372. Just search what people say.

            Few other possibilities to complete the picture:

            • on some modems it is possible to change a PID directly, never tried on 5372
            • having support for the modern PIDs in the kernel will significantly simplify our lifes; at the moment people are patching/recompiling a kernel to their needs
            1 Reply Last reply Reply Quote 0
            • R
              rajbps
              last edited by

              Hi AndrewZ,

              Just send you a PM with the IMEI as requested.

              Regards,

              Raj

              1 Reply Last reply Reply Quote 0
              • I
                igloox
                last edited by

                Hello

                i would like to plug my Huawei E5372 to my virtual pfsense build on my esxi. But Esxi don't recognize it. (Generic firmware upgrade OK)

                The AT commands  AT^SETPORT? returns:

                ^SETPORT:A1,A2;12,16,A1,A2
                

                Do you know the AT commands to resolve my problems?

                Regards

                1 Reply Last reply Reply Quote 0
                • A
                  AndrewZ
                  last edited by

                  Hi igloox, just noticed your question

                  Please correct me if I'm wrong - you have an operator branded modem and you already loaded universal/generic firmware?
                  Could you please show the result of AT^NVRD=50071

                  Prior to that you need to unlock some commands with AT^DATALOCK="v201 code"
                  If you don't have the code - please PM me your IMEI.

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

                    Post 5, step 5, USB is seen by pfSense 2.4.4, however the interface ue0 does not appear?

                    1 Reply Last reply Reply Quote 0
                    • GiaNNG
                      GiaNN
                      last edited by GiaNN

                      Is there any news about the K5160? Now on FreeBSD14 it's still recognized as an usb mass device and not as an LTE mode. I think before buying a new LTE modem it's worth a shot.
                      In the system log i find this:

                      Sep 16 23:56:05 	ppp 	40698 	[opt1_link0] LCP: Down event
                      Sep 16 23:56:05 	ppp 	40698 	[opt1_link0] Link: DOWN event
                      Sep 16 23:56:05 	ppp 	40698 	[opt1_link0] MODEM: chat script failed
                      Sep 16 23:56:05 	ppp 	40698 	[opt1_link0] CHAT: The modem is not responding to "AT" at ModemCmd: label.
                      Sep 16 23:55:52 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 5
                      Sep 16 23:55:49 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 5 in 3 seconds
                      Sep 16 23:55:49 	ppp 	40698 	[opt1_link0] LCP: Down event
                      Sep 16 23:55:49 	ppp 	40698 	[opt1_link0] Link: DOWN event
                      Sep 16 23:55:49 	ppp 	40698 	[opt1_link0] MODEM: chat script failed
                      Sep 16 23:55:49 	ppp 	40698 	[opt1_link0] CHAT: The modem is not responding to "AT" at ModemCmd: label.
                      Sep 16 23:55:36 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 4
                      Sep 16 23:55:33 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 4 in 3 seconds
                      Sep 16 23:55:33 	ppp 	40698 	[opt1_link0] LCP: Down event
                      Sep 16 23:55:33 	ppp 	40698 	[opt1_link0] Link: DOWN event
                      Sep 16 23:55:33 	ppp 	40698 	[opt1_link0] MODEM: chat script failed
                      Sep 16 23:55:33 	ppp 	40698 	[opt1_link0] CHAT: The modem is not responding to "AT" at ModemCmd: label.
                      Sep 16 23:55:18 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 3
                      Sep 16 23:55:16 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 3 in 2 seconds
                      Sep 16 23:55:16 	ppp 	40698 	[opt1_link0] LCP: Down event
                      Sep 16 23:55:16 	ppp 	40698 	[opt1_link0] Link: DOWN event
                      Sep 16 23:55:16 	ppp 	40698 	[opt1_link0] MODEM: chat script failed
                      Sep 16 23:55:16 	ppp 	40698 	[opt1_link0] CHAT: The modem is not responding to "AT" at ModemCmd: label.
                      Sep 16 23:55:01 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 2
                      Sep 16 23:55:00 	ppp 	40698 	[opt1_link0] Link: reconnection attempt 2 in 1 seconds
                      Sep 16 23:55:00 	ppp 	40698 	[opt1_link0] LCP: Down event
                      Sep 16 23:55:00 	ppp 	40698 	[opt1_link0] Link: DOWN event
                      Sep 16 23:55:00 	ppp 	40698 	[opt1_link0] MODEM: chat script failed 
                      
                      GiaNNG 1 Reply Last reply Reply Quote 0
                      • GiaNNG
                        GiaNN @GiaNN
                        last edited by

                        I also add that if i create a PPP the Huawei LED starts blinking until it reaches purple which should mean that it's connected but you should check the connection if it's active

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

                          @GiaNN said in Huawei k5160 4g usb mobile broadband:

                          if i create a PPP the Huawei LED starts blinking

                          Create it how?

                          There's a good chance there are multiple versions of that modem and that they behave differently, Many modems do.

                          Steve

                          GiaNNG 1 Reply Last reply Reply Quote 0
                          • stephenw10S stephenw10 moved this topic from Problems Installing or Upgrading pfSense Software on
                          • GiaNNG
                            GiaNN @stephenw10
                            last edited by GiaNN

                            @stephenw10 through the interfaces GUI, in the section PPP.
                            Then if i enable the interface the LED starts blinking but it cannot properly start PPP

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

                              So you see USB serial ports created? Like cuaU0-3?

                              GiaNNG 1 Reply Last reply Reply Quote 0
                              • GiaNNG
                                GiaNN @stephenw10
                                last edited by

                                @stephenw10 i don't remember, where i see that?
                                I used as device the /dev/cuau0 and then it started blinking if enabled.

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

                                  /dev/cuau0 is one of the on-board com ports not the modem. The ports created by a modem are shown with an uppercase 'U' to indicate they are USB connected.

                                  Plug in the modem and then check the system log. If it's recognised you will see log entries showing the new ports created.

                                  GiaNNG 1 Reply Last reply Reply Quote 0
                                  • GiaNNG
                                    GiaNN @stephenw10
                                    last edited by

                                    @stephenw10 in dmesg shows this:

                                    ugen2.2: <Vodafone (Huawei) Vodafone (Huawei)> at usbus2
                                    umass0 on uhub0
                                    umass0: <Mass Storage> on usbus2
                                    cd0 at umass-sim0 bus 0 scbus2 target 0 lun 0
                                    cd0: <HUAWEI Mass Storage 2.31> Removable CD-ROM SCSI-2 device
                                    cd0: Serial Number 0123456789ABCDEF
                                    cd0: 40.000MB/s transfers
                                    cd0: Attempt to query device size failed: NOT READY, Medium not present
                                    cd0: quirks=0x10<10_BYTE_ONLY>
                                    da0 at umass-sim0 bus 0 scbus2 target 0 lun 1
                                    da0: <HUAWEI TF CARD Storage 2.31> Removable Direct Access SCSI-2 device
                                    da0: Serial Number 0123456789ABCDEF
                                    da0: 40.000MB/s transfers
                                    da0: Attempt to query device size failed: NOT READY, Medium not present
                                    da0: quirks=0x2<NO_6_BYTE>
                                    
                                    
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • stephenw10S
                                      stephenw10 Netgate Administrator
                                      last edited by stephenw10

                                      Ok, so u3g doesn't recognise it. You should see something like:

                                      uhub0: 8 ports with 8 removable, self powered
                                      ugen0.2: <Huawei Technologies Co., Ltd. HUAWEI Mobile> at usbus0
                                      u3g0 on uhub0
                                      u3g0: <Huawei Mobile Connect - Modem> on usbus0
                                      u3g0: Found 5 ports.
                                      

                                      If it can work at all it probably needs to be modeswitched. Or reflashed with different firmware.

                                      Note that the OP here never got this modem working, they switched to a different device. And I don't see an entry for it in u3g:
                                      https://github.com/pfsense/FreeBSD-src/blob/devel-main/sys/dev/usb/serial/u3g.c#L339

                                      Steve

                                      GiaNNG 1 Reply Last reply Reply Quote 1
                                      • GiaNNG
                                        GiaNN @stephenw10
                                        last edited by

                                        @stephenw10 said in Huawei k5160 4g usb mobile broadband:

                                        If it can work at all it probably needs to be modeswitched. Or reflashed with different firmware.

                                        How? i'll make the last try. Then maybe i'll get a different model o try maybe with an OpenWRT VM or something linux based (i tried on Debian and there it's plug & play)

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

                                          Ok, first thing is to get the USB IDs it's presenting as currently using the usbconfig command:

                                          usbconfig -d ugen2.2 dump_all_desc
                                          
                                          GiaNNG 1 Reply Last reply Reply Quote 0
                                          • GiaNNG
                                            GiaNN @stephenw10
                                            last edited by GiaNN

                                            @stephenw10 i'm putting it on pastebin because it gets flagged as spam idk why. If there a way to post it without getting it flagged i'll do it.

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