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

    Using a LG Stylo Phone as a CDCE device for WAN in Pfsense 2.3.3-RELEASE (amd64)

    Scheduled Pinned Locked Moved Hardware
    9 Posts 2 Posters 1.4k 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.
    • G
      gjdunga
      last edited by

      Greetings,

      I have a LG LS-770 (1011) Phone that I would like to use as a CDCE serial device to tether to a pfsense homebrew PC.

      I have already copied if_urndis & if_cdce, and have confirmed they are loaded, but I'm assuming that the device needs a udev rule, or some other config tweak to get this to work as the device does not show up in either ppp or pppoe. (I didn't find it anywhere, but free-bsd is not my native tounge.)

      This is the lsusb of the device while it is tethered to a system. [Not the pfsense device!]

      
      Bus 001 Device 009: ID 1004:61f1 LG Electronics, Inc. 
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass          239 Miscellaneous Device
        bDeviceSubClass         2 ?
        bDeviceProtocol         1 Interface Association
        bMaxPacketSize0        64
        idVendor           0x1004 LG Electronics, Inc.
        idProduct          0x61f1 
        bcdDevice            2.32
        iManufacturer           2 LG Electronics Inc.
        iProduct                3 LGE Android Phone
        iSerial                 4 0700a65xxxxxxxxx  (Edited for privacy)
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength           98
          bNumInterfaces          3
          bConfigurationValue     1
          iConfiguration          0 
          bmAttributes         0x80
            (Bus Powered)
          MaxPower              500mA
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         0
            bInterfaceCount         2
            bFunctionClass          2 Communications
            bFunctionSubClass       2 Abstract (modem)
            bFunctionProtocol       1 AT-commands (v.25ter)
            iFunction               8 CDC Serial
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      2 Abstract (modem)
            bInterfaceProtocol      1 AT-commands (v.25ter)
            iInterface              6 CDC Abstract Control Model (ACM)
            CDC Header:
              bcdCDC               1.10
            CDC Call Management:
              bmCapabilities       0x00
              bDataInterface          1
            CDC ACM:
              bmCapabilities       0x02
                line coding and serial state
            CDC Union:
              bMasterInterface        0
              bSlaveInterface         1 
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x82  EP 2 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0040  1x 64 bytes
              bInterval               9
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0 
            iInterface              7 CDC ACM Data
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x01  EP 1 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        2
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass    255 Vendor Specific Subclass
            bInterfaceProtocol    255 Vendor Specific Protocol
            iInterface              0 
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x83  EP 3 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
      Device Qualifier (for other device speed):
        bLength                10
        bDescriptorType         6
        bcdUSB               2.00
        bDeviceClass          239 Miscellaneous Device
        bDeviceSubClass         2 ?
        bDeviceProtocol         1 Interface Association
        bMaxPacketSize0        64
        bNumConfigurations      1
      Device Status:     0x0000
        (Bus Powered)
      
      

      Pfsense reports this with a usbconfig dump_device_desc

      ugen1.2: <lge android="" phone="" lg="" electronics="" inc.="">at usbus1, cfg=0 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 = 0x1004
        idProduct = 0x61f9
        bcdDevice = 0x0228</probed></lge> 
      

      Would anyone kindly hand-hold me a bit so I can get this working?
      Thanks in advance!
      Gabriel

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

        If it's actually cdce I would expect it to appear as a USB Ethernet device to pfSense so probably as ue0.

        That would be assigned like other interfaces and used directly.

        If you view the console and connect the phone it should show you what new devices are detected.

        You are seeing it appear as different product IDs there as though it's in a different mode. Neither is USB tethering mode though:

        	61f1  Optimus Android Phone [LG Software mode]
        	61f9  Optimus (Various Models) MTP Mode
        	61fc  Optimus 3
        	61fe  Optimus Android Phone [USB tethering mode]
        

        Steve

        1 Reply Last reply Reply Quote 0
        • G
          gjdunga
          last edited by

          Steve,

          When Plugged into the console, it reports:

          
          ugen1.2: <lg electronics="" inc.="">at usbus1
          ugen1.2: <lg electronics="" inc.="">at usbus1 (disconnected)
          ugen1.2: <lg electronics="" inc.="">at usbus1</lg></lg></lg> 
          

          It is connecting to something, then automagicly disconnecting, and then loads again. This is repeatable by unplugging and repluggin back in. |
          I will reboot the box with the device attached, and see if I can get anything else from dmesg.

          1 Reply Last reply Reply Quote 0
          • G
            gjdunga
            last edited by

            Steve,

            Same as posted in my first post.

            Can you throw me a carrot on writing a Udev rule to force the device to be seen as a cdce?
            I think what is happening is that it is displaying a whole bunch of devices to the box, and because they are all nonstandard, it's has no clue how to config it.

            Gabriel

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

              I don't think a udev script will help there. It has to be recognised by a driver in order to be used. It appears to be changing modes when it's connected maybe.

              Does the phone have different tethering modes you can try? It may appear as a different device ID we can work with.
              Currently pfSense sees it as an MTP mode device which is unhelpful.

              Steve

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

                Running a quick test here on my own LG Nexus 4 it can appear as (at least) 3 devices, MTP, PTP and an RNDIS ethernet tethering device when I enable USB Tethering.

                	4ee0  Nexus 4 (bootloader)
                	4ee1  Nexus Device (MTP)
                	4ee2  Nexus Device (debug)
                	4ee3  Nexus 4/5/7/10 (tether)
                	4ee4  Nexus 4/5/7/10 (debug + tether)
                	4ee5  Nexus 4 (PTP)
                	4ee6  Nexus 4/5 (PTP + debug)
                

                You will probably still need the RNDIS driver though. Probably need to be imported unless this happens: https://redmine.pfsense.org/issues/7468

                Steve

                1 Reply Last reply Reply Quote 0
                • G
                  gjdunga
                  last edited by

                  Steve,

                  The device is set to charge only, when I did the stuff above. Going back and manually setting the mode to ptp or mpt resulted in the same. I copied the if_urndis, if_cdce, and if_ipheth kernel drivers into the box from a freebsd 10 p16 ISO. I put the kload in the boot.conf, and can show them loaded. A friend allowed me to play with thier samsung note and ue0 did generate. Is there a usbconfig kludge or a usb quirk we can try?

                  I have no problem building a devel platform if needed, however I am uncomfortable as I am not quite sure yet how FreeBsd and pfsense toolchains work. I am used to Debian and to some degree linux from scratch (LFS).

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

                    Hmm, if it really doesn't appear as a different device in all modes I'm not sure what we can do.

                    Try running:

                    usbconfig -d 1.2 dump_all_config_desc
                    

                    Assuming it's still ugen1.2.

                    That should report differences in the interfaces presented.

                    With just the urndis module loaded I see this when I enable tethering:

                    Apr 14 22:00:02 	kernel 		ugen0.4: <lge>at usbus0 (disconnected)
                    Apr 14 22:00:02 	kernel 		ugen0.4: <lge>at usbus0
                    Apr 14 22:00:02 	kernel 		urndis0: <rndis communications="" control="">on usbus0
                    Apr 14 22:00:02 	kernel 		ue0: <usb ethernet="">on urndis0
                    Apr 14 22:00:02 	kernel 		ue0: Ethernet address: 4a:aa:0c:9a:6b:59</usb></rndis></lge></lge> 
                    

                    Steve

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

                      There may be multiple config indexes available in which case you might need to force it to load a different index to be recognised.

                      For example:

                      usbconfig -d 1.2 set_config 3
                      

                      Generally configs indexes are 0-4 but there may not be any. It's worth trying though.

                      If one of them does allow it to be recognised you can add a USB quirk to loader.conf.local to apply it every time.

                      Steve

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