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

Huawei k5160 4g usb mobile broadband

Hardware
6
53
16.3k
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.
  • G
    GiaNN @stephenw10
    last edited by GiaNN Sep 18, 2023, 2:06 PM Sep 18, 2023, 2:02 PM

    @stephenw10 if i replug it, there's still config index 1
    if i do cdcontrol eject nothing seems to happen

    Sep 18 15:57:41 	kernel 		(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
    Sep 18 15:57:41 	kernel 		(cd0:umass-sim0:0:0:0): Info: 0x59c1
    Sep 18 15:57:41 	kernel 		(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
    Sep 18 15:57:41 	kernel 		(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
    Sep 18 15:57:41 	kernel 		(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
    Sep 18 15:57:41 	kernel 		(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 59 c1 00 00 04 00
    Sep 18 15:57:35 	kernel 		da0: quirks=0x2<NO_6_BYTE>
    Sep 18 15:57:35 	kernel 		da0: Attempt to query device size failed: NOT READY, Medium not present
    Sep 18 15:57:35 	kernel 		da0: 40.000MB/s transfers
    Sep 18 15:57:35 	kernel 		da0: Serial Number 0123456789ABCDEF
    Sep 18 15:57:35 	kernel 		da0: <HUAWEI TF CARD Storage 2.31> Removable Direct Access SCSI-2 device
    Sep 18 15:57:35 	kernel 		da0 at umass-sim0 bus 0 scbus2 target 0 lun 1
    Sep 18 15:57:35 	kernel 		cd0: quirks=0x10<10_BYTE_ONLY>
    Sep 18 15:57:35 	kernel 		cd0: Attempt to query device size failed: NOT READY, Medium not present
    Sep 18 15:57:35 	kernel 		cd0: 40.000MB/s transfers
    Sep 18 15:57:35 	kernel 		cd0: Serial Number 0123456789ABCDEF
    Sep 18 15:57:35 	kernel 		cd0: <HUAWEI Mass Storage 2.31> Removable CD-ROM SCSI-2 device
    Sep 18 15:57:35 	kernel 		cd0 at umass-sim0 bus 0 scbus2 target 0 lun 0
    Sep 18 15:57:35 	kernel 		umass0: <Mass Storage> on usbus2
    Sep 18 15:57:35 	kernel 		umass0 on uhub0
    Sep 18 15:57:35 	kernel 		ugen2.2: <Vodafone (Huawei) Vodafone (Huawei)> at usbus2 
    

    If i want to try with usbmodeswitch how should i do?

    1 Reply Last reply Reply Quote 0
    • S
      stephenw10 Netgate Administrator
      last edited by Sep 18, 2023, 2:28 PM

      So it still showed it was using config index 1 after replugging? That's surprising.

      Yes, you can try usb_modeswitch. Install the pkg like:

      [23.05.1-RELEASE][admin@6100.stevew.lan]/root: pkg install usb_modeswitch
      Updating pfSense-core repository catalogue...
      pfSense-core repository is up to date.
      Updating pfSense repository catalogue...
      pfSense repository is up to date.
      All repositories are up to date.
      The following 1 package(s) will be affected (of 0 checked):
      
      New packages to be INSTALLED:
      	usb_modeswitch: 2.6.0 [pfSense]
      
      Number of packages to be installed: 1
      
      64 KiB to be downloaded.
      
      Proceed with this action? [y/N]: y
      [1/1] Fetching usb_modeswitch-2.6.0.pkg: 100%   64 KiB  65.8kB/s    00:01    
      Checking integrity... done (0 conflicting)
      [1/1] Installing usb_modeswitch-2.6.0...
      [1/1] Extracting usb_modeswitch-2.6.0: 100%
      [23.05.1-RELEASE][admin@6100.stevew.lan]/root: rehash
      

      https://man.freebsd.org/cgi/man.cgi?query=usb_modeswitch

      G 2 Replies Last reply Sep 18, 2023, 2:32 PM Reply Quote 0
      • G
        GiaNN @stephenw10
        last edited by Sep 18, 2023, 2:32 PM

        @stephenw10 i already had installed usb_modeswitch, i'll read the docs, maybe i'll understand more

        1 Reply Last reply Reply Quote 0
        • G
          GiaNN @stephenw10
          last edited by GiaNN Sep 18, 2023, 3:22 PM Sep 18, 2023, 3:20 PM

          @stephenw10 i changed the usb_modeswitch.conf file, and if i launch the command now says

          usb_modeswitch -c /usr/local/etc/usb_modeswitch.conf
          Look for target devices ...
           No devices in target mode or class found
          Look for default devices ...
           No devices in default mode found. Nothing to do. Bye!
          

          before i did

          Take all parameters from the command line
          
          
           * usb_modeswitch: handle USB devices with multiple modes
           * Version 2.6.0 (C) Josua Dietze 2017
           * Based on libusb1/libusbx
          
           ! PLEASE REPORT NEW CONFIGURATIONS !
          
          DefaultVendor=  0x12d1
          DefaultProduct= 0x1f1e
          HuaweiNewMode=1
          
          Look for default devices ...
            found USB ID 0000:0000
            found USB ID 0000:0000
            found USB ID 0000:0000
            found USB ID 0000:0000
            found USB ID 0000:0000
           No devices in default mode found. Nothing to do. Bye!
          
          

          Then rebooted but still doesn't show up

          1 Reply Last reply Reply Quote 0
          • S
            stephenw10 Netgate Administrator
            last edited by Sep 18, 2023, 3:32 PM

            Try just using cli switches directly first:
            usb_modeswitch -W -v 12d1 -p 1f1e -J

            G 1 Reply Last reply Sep 18, 2023, 4:02 PM Reply Quote 0
            • G
              GiaNN @stephenw10
              last edited by GiaNN Sep 18, 2023, 4:03 PM Sep 18, 2023, 4:02 PM

              @stephenw10 i reinserted the USB then

               usb_modeswitch -W -v 12d1 -p 1f1e -J
              Take all parameters from the command line
              
              
               * usb_modeswitch: handle USB devices with multiple modes
               * Version 2.6.0 (C) Josua Dietze 2017
               * Based on libusb1/libusbx
              
               ! PLEASE REPORT NEW CONFIGURATIONS !
              
              DefaultVendor=  0x12d1
              DefaultProduct= 0x1f1e
              HuaweiNewMode=1
              
              Look for default devices ...
                found USB ID 0000:0000
                found USB ID 0000:0000
                found USB ID 0000:0000
                found USB ID 0000:0000
                found USB ID 0000:0000
                found USB ID 12d1:1f1e
                 vendor ID matched
                 product ID matched
               Found devices in default mode (1)
              Access device 002 on bus 002
              Get the current device configuration ...
              Current configuration number is 2
              Use interface number 0
               with class 2
              Error: can't use storage command in MessageContent with interface 0; interface class is 2, expected 8. Abort
              

              But something changed, now the USB LED blinks even if i disable the OPT interface

              1 Reply Last reply Reply Quote 0
              • S
                stephenw10 Netgate Administrator
                last edited by stephenw10 Sep 18, 2023, 5:59 PM Sep 18, 2023, 5:57 PM

                What OPT interface?

                You should remove any ppp interfaces you have configured until you have enabled the USB com ports on the modem. Or the Ethernet interface which doesn't use ppp anyway.

                Did the reported PID change?

                It looks like it's still using config index 1 so you might need to set that back to 0 and retry that command. Or try one of the other Huawei switching methods.

                G 1 Reply Last reply Sep 18, 2023, 6:38 PM Reply Quote 0
                • G
                  GiaNN @stephenw10
                  last edited by GiaNN Sep 18, 2023, 6:40 PM Sep 18, 2023, 6:38 PM

                  @stephenw10 i created an PPP interface to see if it worked.
                  I don't see any PID change in the system log.
                  If id change to the config index 0 if i do usb_modeswitch -W -v 12d1 -p 1f1e -J it gives the same output as before.
                  I still didn't remove the PPPoE interface, i'll do that tomorrow if needed. But i deleted the PPP (OPT1) interface.

                  1 Reply Last reply Reply Quote 0
                  • S
                    stephenw10 Netgate Administrator
                    last edited by Sep 18, 2023, 7:31 PM

                    PPPoE does nothing here. PPP won't do anything until you see USB com ports available.

                    You might need a custom message to mode switch it. There several threads on the usb_modeswitch forum for that device but, as I said, there may well be several versions of it.

                    G 1 Reply Last reply Sep 18, 2023, 7:50 PM Reply Quote 1
                    • G
                      GiaNN @stephenw10
                      last edited by GiaNN Sep 18, 2023, 7:50 PM Sep 18, 2023, 7:50 PM

                      @stephenw10 I did it!
                      i forced config 0 then usb switched and now i see an eu0 interface.
                      But if i want to create a PPP it still shows only /dev/cuau0

                      ue0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
                              options=80000<LINKSTATE>
                              ether 0c:5b:8f:27:9a:64
                              media: Ethernet autoselect
                              nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
                      
                      1 Reply Last reply Reply Quote 0
                      • S
                        stephenw10 Netgate Administrator
                        last edited by Sep 18, 2023, 7:54 PM

                        Aha!
                        Right because using USB Ethernet doesn't require ppp. You should see the ue0 interface as available to assign.
                        Assign it as a new interface, set it to DHCP and see what happens.

                        G 1 Reply Last reply Sep 18, 2023, 7:56 PM Reply Quote 0
                        • G
                          GiaNN @stephenw10
                          last edited by Sep 18, 2023, 7:56 PM

                          @stephenw10 yes i see it in the interfaces section, but how do i put the APN?

                          1 Reply Last reply Reply Quote 0
                          • S
                            stephenw10 Netgate Administrator
                            last edited by Sep 18, 2023, 8:03 PM

                            It may be auto-configured. It may have an management interface that can be used.

                            G 1 Reply Last reply Sep 18, 2023, 8:35 PM Reply Quote 0
                            • G
                              GiaNN @stephenw10
                              last edited by GiaNN Sep 18, 2023, 9:03 PM Sep 18, 2023, 8:35 PM

                              @stephenw10 it cannot be autoconfigured because it's a Vodafone USB and i'm using it with another ISP SIM card, if i set it to DHCP and go to it's IP it goes to PFsense.
                              EDIT ok it was an error, now it works fine Thank You.

                              Now if i can set up from the USB webpage i should set up a script wich force config 0 then usbswitch it.

                              Something doesn't work, the webpage is just a static page. Is there a way to use it as a modem in this doc? So i can put manually from PFsense the APN

                              1 Reply Last reply Reply Quote 0
                              • S
                                stephenw10 Netgate Administrator
                                last edited by Sep 18, 2023, 9:04 PM

                                It will use config index 0 by default. That's what it was using before you set it to 1.

                                You can run that usb_modeswitch command using the shellcmd tool/package:
                                https://docs.netgate.com/pfsense/en/latest/development/boot-commands.html

                                G 1 Reply Last reply Sep 18, 2023, 9:17 PM Reply Quote 1
                                • G
                                  GiaNN @stephenw10
                                  last edited by Sep 18, 2023, 9:17 PM

                                  @stephenw10 mmmmh every time i replugged it in it didn't show up as an interface and if i did usb_modeswitch -W -v 12d1 -p 1f1e -J it gave the error that it was already in the alternate mode.
                                  However if needed for somebody else, i couldn't set up the APN through web interface, i needed to set it up on a Windows machine and the plug it in PFsense

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    stephenw10 Netgate Administrator
                                    last edited by Sep 18, 2023, 9:37 PM

                                    If you check the usbconfig output does it actually show as that PID?

                                    G 1 Reply Last reply Sep 18, 2023, 9:45 PM Reply Quote 0
                                    • G
                                      GiaNN @stephenw10
                                      last edited by Sep 18, 2023, 9:45 PM

                                      @stephenw10 nope

                                      usbconfig
                                      ugen0.1: <AMD XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
                                      ugen4.1: <AMD EHCI root HUB> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
                                      ugen3.1: <AMD OHCI root HUB> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
                                      ugen2.1: <AMD EHCI root HUB> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
                                      ugen1.1: <AMD OHCI root HUB> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
                                      ugen2.2: <Vodafone (Huawei) Vodafone (Huawei)> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        stephenw10 Netgate Administrator
                                        last edited by Sep 18, 2023, 9:54 PM

                                        You need to actually check the IDs so something like: usbconfig -d ugen0.2 dump_device_desc

                                        G 1 Reply Last reply Sep 19, 2023, 7:11 AM Reply Quote 0
                                        • G
                                          GiaNN @stephenw10
                                          last edited by GiaNN Sep 19, 2023, 7:11 AM Sep 19, 2023, 7:11 AM

                                          @stephenw10

                                          usbconfig -d ugen2.2 dump_device_desc
                                          ugen2.2: <Vodafone (Huawei) Vodafone (Huawei)> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
                                          
                                           bLength = 0x0012 
                                           bDescriptorType = 0x0001 
                                           bcdUSB = 0x0210 
                                           bDeviceClass = 0x0002  <Communication device>
                                           bDeviceSubClass = 0x0000 
                                           bDeviceProtocol = 0x0000 
                                           bMaxPacketSize0 = 0x0040 
                                           idVendor = 0x12d1 
                                           idProduct = 0x157f 
                                           bcdDevice = 0x0102 
                                           iManufacturer = 0x0001  <Vodafone (Huawei)>
                                           iProduct = 0x0002  <Vodafone (Huawei)>
                                           iSerialNumber = 0x0000  <no string>
                                           bNumConfigurations = 0x0001 
                                          
                                          
                                          1 Reply Last reply Reply Quote 0
                                          40 out of 53
                                          • First post
                                            40/53
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.