The FreeBSD u3g driver

No image "freebsd-usbdaemon.gif" attached to U3gDriver


This driver supports 3G (UMTS, HSDPA, HSUPA, HSPA) cards that provide access to one or more serial ports through a USB interface, providing PPP and AT command channels simultaneously. Some devices provide access to multiple pairs of channels for integrated GPS', or other access methods (Option HSO driver).

Transfer speeds should be above 30k on a good UMTS connection and a fast server:

% curl -o /dev/null
% Total    % Received % Xferd  Average Speed   Time    Time     Time    Current
Dload      Upload     Total                    Spent   Left             Speed
12 19.9M   12 2486k    0     0  40203      0  0:08:39  0:01:03  0:07:36 43921

Some (older) devices (from Sierra for example) provide 1 serial port through a normal serial port or the normal serial USB drivers. They usually support the ETSI / 3GPP 27.010 3GPPMultiplexProtocol, making it possible to open a AT command channel and a PPP connection channel simultaneously. A basic implementation which works on an Option Globetrotter GPRS card is available. Contact me for details.

Verified to work

See the man page.

Installation instructions

The driver is available in both FreeBSD 7 and FreeBSD 8. The one in FreeBSD 8 and up was written by Hans Petter Selasky. Consult freebsd-usb@… for more information and bug reports.

The driver from FreeBSD 7 should be usable on FreeBSD 6, without too many changes. You will need to patch ucom.c though with the attached patch (see below).


To start your connection automatically use something like the following snippet in your devd.conf:

  attach 100 {
    device-name "ucom[0-9]+";
    match "vendor" "0x12d1";
    match "product" "0x1003";
    action "/usr/sbin/ppp -ddial kpn";

Some people have been able to get their device to successfully switch from driver mode to modem mode using usb_modeswitch. You can compile it on !FreeBSD with

    cc -L /usr/local/lib -I/usr/local/include -lusb -o usb_modeswitch usb_modeswitch.c

if you have libusb installed. The mass storage devices the devices present should be available through ugen. Note that umass must not be present in your kernel nor as a module (or it should be made to ignore these devices).

To see signal strength for example while online:

  1. Start ppp (See also PPPFor3GModems).
  2. Connect to the other port, in my case /dev/cuaU0.2, using cu -l /dev/cuaU0.2 and type in commands like AT+CSQ and ATI1.

More information

Contact freebsd-usb@… with questions on FreeBSD 8 and 9 .

Last modified 8 years ago Last modified on Nov 8, 2010, 12:30:31 PM