USB Broadband Modem

Hello everyone!
I buy a usb broadband modem to use on my freebsd machine. Its model is LM003 (LM Technologies) and have a qualcomm chipset.
Code:
# usbconfig -dugen0.5 -v
ugen0.5: <WL-72B 3.5G MODEM OMEGA TECHNOLOGY> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen0.5.0: umass0: <Qualcomm, Incorporated Qualcomm CDMA Technologies MSM, class 0/0, rev 2.00/0.00, addr 5>

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x1c9e
  idProduct = 0x6061
  bcdDevice = 0x0000
  iManufacturer = 0x0003  <Qualcomm, Incorporated>
  iProduct = 0x0002  <Qualcomm CDMA Technologies MSM>
  iSerialNumber = 0x0004  <000000000002>
  bNumConfigurations = 0x0001

First time I connected it to my machine it's detected as usb mass storage and two device (cd0 and da0) appeared in /dev. cd0 is somewhat virtual CD drive that contains windows and mac driver and software (it supporting linux too) and da0 is for SD card reader on it. I not loaded u3g driver yet, so I disconnect device and load u3g and reconnect device. this time cd0 and da0 not appeared but u3g not attached too!
Code:
 # usbconfig -dugen0.5 -v
ugen0.5: <WL-72B 3.5G MODEM OMEGA TECHNOLOGY> 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 = 0x1c9e
  idProduct = 0x6061
  bcdDevice = 0x0000
  iManufacturer = 0x0003  <Qualcomm, Incorporated>
  iProduct = 0x0002  <Qualcomm CDMA Technologies MSM>
  iSerialNumber = 0x0004  <000000000002>
  bNumConfigurations = 0x0001

From what I read in internet, I need to change the usb mode from storage mode to modem. I found usb_modeswitch for this task. When I use it without u3g loaded it works and umass driver detached but with u3g cannot switch mode:

Before loading u3g driver:
Code:
# usb_modeswitch -c /usr/local/etc/usb_modeswitch.conf -W

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.2 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0x6061
TargetClass=    0xff
MessageContent="55534243123456780000000000000606f50402527000000000000000000000"

Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
  found USB ID 0000:0000
  found USB ID 0000:0000
  found USB ID 8087:0a2a
  found USB ID 5986:0366
  found USB ID 8087:8001
  found USB ID 0fce:7186
  found USB ID 1c9e:6061
   vendor ID matched
   product ID matched
   device class 08 not matching target
   count device
 Found devices in default mode (1)
Access device 005 on bus 000
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Qualcomm, Incorporated
     Product: Qualcomm CDMA Technologies MSM
  Serial No.: 000000000002
-------------------------
Looking for active drivers ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
LIBUSB_FUNCTION: libusb_bulk_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer leave 0
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_FUNCTION: libusb10_handle_events_sub complete
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_TRANSFER: sync I/O done
LIBUSB_FUNCTION: libusb10_handle_events_sub complete
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_bulk_transfer leave
 OK, message successfully sent
Read the response to message 1 (CSW) ...
LIBUSB_FUNCTION: libusb_bulk_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer enter
LIBUSB_FUNCTION: libusb_submit_transfer leave 0
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed enter
LIBUSB_FUNCTION: libusb10_handle_events_sub enter
LIBUSB_TRANSFER: sync I/O done
LIBUSB_FUNCTION: libusb10_handle_events_sub complete
LIBUSB_FUNCTION: libusb_handle_events_timeout_completed exit
LIBUSB_FUNCTION: libusb_bulk_transfer leave
 Response successfully read (13 bytes), status 1
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!

When u3g loaded:
Code:
# usb_modeswitch -c /usr/local/etc/usb_modeswitch.conf -W

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.2 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0x6061
TargetClass=    0xff
MessageContent="55534243123456780000000000000606f50402527000000000000000000000"

Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
  found USB ID 0000:0000
  found USB ID 0000:0000
  found USB ID 8087:0a2a
  found USB ID 5986:0366
  found USB ID 8087:8001
  found USB ID 0fce:7186
  found USB ID 1c9e:6061
   vendor ID matched
   product ID matched
   device class 08 not matching target
   count device
 Found devices in default mode (1)
Access device 005 on bus 000
Get the current device configuration ...
 Determining the active configuration failed (error -5). Abort

I'm not sure about supporting FreeBSD from this chipset, but I had a look at u3g driver (/usr/src/sys/dev/usb/serial/u3g.c) I tried to see it at least probed or not by adding some printf at u3g_probe function and saw somthing intersting:
In probe function a line checking uaa->info.bInterfaceClass with UICLASS_VENDOR and and returns ENXIO (I sure this statement is executed, I tried that with device printf) may be at related to mode switching that should change interface class?
So I assume something in other usb driver layers prevent to get u3g tries,
but have no idea about what REALLY should I do.

Any help, idea or something are welcome!
 
Have you tested on a different machine to confirm the device works as intended? Also, what Freebsd Release are you using to do the testing just in case you need to use a supported version
 
usb_modeswitch is a PITA to get working.

I had two Huawei dongles at one point, both with the same model numbers but the were completely different.

I think I did get one working at one point but it was 4G.

Nowadays with the ability to USB Thether a 5G smartphone it does make much sense to use one of these dongles.

I'm amazed at how effortless it is to set up a USBThether compared with spending hours tearing your hair out trying to get usb_modeswitch working.
 
From what I read in internet, I need to change the usb mode from storage mode to modem. I found usb_modeswitch for this task.
Some Qualcom modems it is also possible to do this from the AT Command terminal for the modem.

So I checked /usr/src/sys/dev/usb/usbdevs and it appears your VID & PID is present.
product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA

The next step I would take is look at the serial ports for the AT Command terminals.There may be more than one. One limited in scope and one full access.
ls /dev/cuaU*
Then use a terminal program to check reply from modem. For example using cu:
cu -l /dev/cuaU0.3

What I have seen is modem acts differently depending on USB COMPOSITION. You switch it to another composition with the modem AT Commands.

So you poke at the serial ports until you find a true AT terminal on the modem. They you run commnds like AT!UDUSBCOMP=? to see the available compositions.
Then something like AT!UDUSBCOMP=7 to set it.
FreeBSD has limited modem protocol support so you must get the right composition working. Then the rest will fall into place.
 
Notice that the command structure is different even among Qualcomm manufacturers like Sierra and Telit.


So you need to poke at your modems AT console and see what USB Composition it is using.
You may find your CDROM-Mass Storage device disappears when you pick the right USB Composition.
So don't waste too much time on usbmodeswitching. There are other ways.
The password to unlock AT commands is the key. Sort of a password to maintenance mode of the modem.
 
The techship article breaks down nicely some of the Modem Protocols available. MBIM, QMI, CDC

USB Compositions I spoke of earlier can contain several other ports.
For example USBCOMP=7 might offer
DM Port (managment port)
MODEM (Legacy PPP)
NMEA GPS

Legacy PPP is what you needed on FreeBSD but PPP is a single threaded program so max speed is limited.
Thusly MPD5 came along and offers a daemon for PPP to run concurrent and you get good speed.
But PPP and MPD are horrible to setup. No offense.

MBIM is the current Windows Modem protocol used but we had no support. Same with QMI. Qualcomm Modem Interface. Not supported on FreeBSD.

Luckily all the BSD's now have MBIM protocol thanks to Pierre and the FreeBSD Foundation.
 
Back
Top