FreeBSD's ppp(8) and u3g UMTS modem: Difference between revisions

From ZS64
Jump to navigationJump to search
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Drivers==
Many USB UMTS data sticks provide a serial port over which you can speak asynchronous PPP to the stick to establish a data connection. The hardware drivers contain more info on all functions provided, see [http://www.FreeBSD.org/cgi/man.cgi?query=u3g&apropos=0&sektion=4&manpath=FreeBSD+8.0-RELEASE&format=html u3g(4)] et al.
Many USB UMTS data sticks provide a serial port over which you can speak asynchronous PPP to the stick to establish a data connection. The hardware drivers contain more info on all functions provided, see [http://www.FreeBSD.org/cgi/man.cgi?query=u3g&apropos=0&sektion=4&manpath=FreeBSD+8.0-RELEASE&format=html u3g(4)] et al.


Sample [http://www.FreeBSD.org/cgi/man.cgi?query=ppp.conf&apropos=0&sektion=5&manpath=FreeBSD+8.0-RELEASE&format=html ppp.conf(5)]:
Usually, these devices present a umass(4) interface that provides a virtual CD-ROM with driver software, and one or more serial ports. On many sticks, the first serial port is the one you can use for data connections, but this isn't always the case, so you might need to google your particular model, or try them out one by one.
 
==ppp.conf==
I've switched off the PIN code query on the SIM (using a regular mobile phone), or see below.
 
The APN data has been hard-coded in the chat script (see the line starting with 'AT+CGDCONT'; depending on your provider, you might need to change it. Google ''umts apn settings'' or similar to find the APN, and username and password, if required, for your network operator.
 
Sample [http://www.FreeBSD.org/cgi/man.cgi?query=ppp&apropos=0&sektion=8&manpath=FreeBSD+8.0-RELEASE&format=html ppp.conf]:
  u3g:
  u3g:
  set device /dev/cuaU0.0
  set device /dev/cuaU0.0
  set speed 115200
  set speed 115200
  # the stick/the network fail to provide an IP unless you suggest one, so the
  # if the stick/the network fail to provide an IP unless you suggest one, the
  # following line might be necessary
  # following line might help
  #set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0
  #set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0
# name of the APN
set phone "internet"
# username and password are often unnecessary, but almost always generic
  set authname internet
  set authname internet
  set authkey  internet
  set authkey  internet
Line 17: Line 28:
  AT+CMEE=2 OK-AT-OK \
  AT+CMEE=2 OK-AT-OK \
  AT+CSQ OK \
  AT+CSQ OK \
  AT+CGDCONT=1,\\\"IP\\\",\\\"internet\\\" OK \
  AT+CGDCONT=1,\\\"IP\\\",\\\"\T\\\" OK \
  AT+CGACT? OK-AT-OK \
  AT+CGACT? OK-AT-OK \
  AT+CGATT? OK \
  AT+CGATT? OK \
Line 24: Line 35:
  ATD*99***1# CONNECT"
  ATD*99***1# CONNECT"
   set crtscts on
   set crtscts on
  nat enable yes
  # enable or disable updating /etc/resolv.conf with nameservers from the peer
disable dns
# add default route through this connection
  add default HISADDR
  add default HISADDR
#disable dns
 
==PIN Code Query==
AT command to switch off the PIN code query:
AT+CLCK="SC",0,"XXXX"
and back on again:
AT+CLCK="SC",1,"XXXX"

Latest revision as of 08:27, 7 January 2010

Drivers

Many USB UMTS data sticks provide a serial port over which you can speak asynchronous PPP to the stick to establish a data connection. The hardware drivers contain more info on all functions provided, see u3g(4) et al.

Usually, these devices present a umass(4) interface that provides a virtual CD-ROM with driver software, and one or more serial ports. On many sticks, the first serial port is the one you can use for data connections, but this isn't always the case, so you might need to google your particular model, or try them out one by one.

ppp.conf

I've switched off the PIN code query on the SIM (using a regular mobile phone), or see below.

The APN data has been hard-coded in the chat script (see the line starting with 'AT+CGDCONT'; depending on your provider, you might need to change it. Google umts apn settings or similar to find the APN, and username and password, if required, for your network operator.

Sample ppp.conf:

u3g:
	set device /dev/cuaU0.0
	set speed 115200
	# if the stick/the network fail to provide an IP unless you suggest one, the
	# following line might help
	#set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0
	# name of the APN
	set phone "internet"
	# username and password are often unnecessary, but almost always generic
	set authname internet
	set authkey  internet
	set log local phase ipcp
	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\\\",\\\"\T\\\" OK \
		AT+CGACT? OK-AT-OK \
		AT+CGATT? OK \
		AT+CGCLASS? OK \
		AT+COPS? OK \
		ATD*99***1# CONNECT"
 	set crtscts on
	# enable or disable updating /etc/resolv.conf with nameservers from the peer
	disable dns
	# add default route through this connection
	add default HISADDR

PIN Code Query

AT command to switch off the PIN code query:

AT+CLCK="SC",0,"XXXX"

and back on again:

AT+CLCK="SC",1,"XXXX"