FreeBSD 9 and 3G Modems

Mike Tancsa mike at sentex.net
Thu Jan 26 16:12:27 UTC 2012


On 1/26/2012 10:58 AM, Odhiambo Washington wrote:
>     Hi,
>            kldload u3g
>            kldload umodem
> 
> 
> Done, although kldload u3g tells me that file already exists! Perhaps
> because I booted up with my Huawei dongle plugged in.
> kldstat | grep u3g shows me nothing though.

Looks like its already defined in the kernel!

> ugen6.2: <HUAWEI Mobile Huawei Technologies> at usbus6, cfg=0 md=HOST
> spd=HIGH (480Mbps) pwr=ON

It sees it.

>  
> 
> 
>     then
> 
>      sysctl -a dev.u3g
> 
> 
> [wash at pcbsd9] /home/wash# sysctl -a dev.u3g
> dev.u3g.0.%desc: Huawei Technologies HUAWEI Mobile, class 0/0, rev
> 2.00/0.00, addr 2
> dev.u3g.0.%driver: u3g
> dev.u3g.0.%location: bus=1 hubaddr=1 port=6 devaddr=2 interface=0
> dev.u3g.0.%pnpinfo: vendor=0x12d1 product=0x1001 devclass=0x00
> devsubclass=0x00 sernum="" release=0x0000 mode=host intclass=0xff
> intsubclass=0xff
>  intprotocol=0xff  ttyname=U0 ttyports=3
> dev.u3g.0.%parent: uhub

More importantly, the driver sees it and has used cuaU0.*

>     and
>     ls -l /dev/cuaU*
> 
> 
> [wash at pcbsd9] /home/wash# ls -l /dev/cuaU*
> crw-rw----  1 uucp  dialer    0, 117 Jan 26 18:23 /dev/cuaU0.0
> crw-rw----  1 uucp  dialer    0, 118 Jan 26 18:23 /dev/cuaU0.0.init
> crw-rw----  1 uucp  dialer    0, 119 Jan 26 18:23 /dev/cuaU0.0.lock
> crw-rw----  1 uucp  dialer    0, 123 Jan 26 18:23 /dev/cuaU0.1
> crw-rw----  1 uucp  dialer    0, 124 Jan 26 18:23 /dev/cuaU0.1.init
> crw-rw----  1 uucp  dialer    0, 125 Jan 26 18:23 /dev/cuaU0.1.lock
> crw-rw----  1 uucp  dialer    0, 129 Jan 26 18:23 /dev/cuaU0.2
> crw-rw----  1 uucp  dialer    0, 130 Jan 26 18:23 /dev/cuaU0.2.init
> crw-rw----  1 uucp  dialer    0, 131 Jan 26 18:23 /dev/cuaU0.2.lock

This is where you need to do a bit of experimenting.  Some modems
register these "sub ports" and others do not.  Some are for out of band
control and one will be the device you actually use in your ppp config.
 The init string sort of depends on your carrier. But a basic one to try
in ppp.conf is below.  For the set device line, you might need to change
it to /dev/cuaU0.1 or /dev/cuaU0.2

invoke with ppp -ddial u3g

You might need the authname and auth key, you might not. For the context
you might need to change it from internet.com to something else.  Again,
ask your carrier for that info. Try first without the CGDCONT line as
the default in the modem might do the trick.


u3g:
 set device /dev/cuaU0.0
 set server /var/run/gprs-internet "" 0177
 set speed 921600
 set timeout 0
 set authname wapuser1
 set authkey wap
 set dial "ABORT BUSY TIMEOUT 2 \
        \"\" \
        AT OK-AT-OK \
        AT+CFUN=1 OK-AT-OK \
        AT+CMEE=2 OK-AT-OK \
        AT+CSQ OK \
        AT+CGDCONT=1,\\\"IP\\\",\\\"internet.com\\\" OK \
        AT&v OK \
        ATD*99# CONNECT"
 set crtscts on
 disable vjcomp
 disable acfcomp
 disable deflate
 disable deflate24
 disable pred1
 disable protocomp
 disable mppe
 disable ipv6cp
 disable lqr
 disable echo
 #nat enable yes
 enable dns
 resolv writable
 set dns 8.8.8.8
 set ifaddr 10.1.0.2/0 10.1.0.1/0 255.255.255.255 0.0.0.0
 add default HISADDR          # See ppp.link*




-- 
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, mike at sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada   http://www.tancsa.com/


More information about the freebsd-questions mailing list