From owner-freebsd-drivers@FreeBSD.ORG Wed May 18 10:37:17 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C7DC1065672 for ; Wed, 18 May 2011 10:37:17 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta15.westchester.pa.mail.comcast.net (qmta15.westchester.pa.mail.comcast.net [76.96.59.228]) by mx1.freebsd.org (Postfix) with ESMTP id BDE5F8FC15 for ; Wed, 18 May 2011 10:37:16 +0000 (UTC) Received: from omta19.westchester.pa.mail.comcast.net ([76.96.62.98]) by qmta15.westchester.pa.mail.comcast.net with comcast id kyGL1g00727AodY5FyQ1Bc; Wed, 18 May 2011 10:24:01 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta19.westchester.pa.mail.comcast.net with comcast id kyPz1g00X1t3BNj3fyQ0ya; Wed, 18 May 2011 10:24:01 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 8FDE1102C19; Wed, 18 May 2011 03:23:58 -0700 (PDT) Date: Wed, 18 May 2011 03:23:58 -0700 From: Jeremy Chadwick To: "crsnet.pl" Message-ID: <20110518102358.GA71561@icarus.home.lan> References: <8bce9b8a86d5c7a83095d8e58f794f64@i-pi.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8bce9b8a86d5c7a83095d8e58f794f64@i-pi.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hardware@freebsd.org, freebsd-current@freebsd.org, freebsd-stable@freebsd.org, freebsd-questions@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: FreeBSD 8.2 and Lenovo X300 WWAN Modem X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 10:37:17 -0000 On Wed, May 18, 2011 at 11:40:36AM +0200, crsnet.pl wrote: > Hello. > Have here anyone run this modem/GPS under FreeBSD 8.2 ? Modem is > recognized, but when i try to run ppp -ddial iplus i get this error > : > > /var/log/messages > May 18 11:20:59 x60s ppp[1656]: tun0: Warning: Chat script failed > > /var/log/ppp > May 18 11:20:53 x60s ppp[1656]: tun0: Phase: deflink: opening -> dial > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Send: AT^M > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Expect(2): OK > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Received: AT^M^M > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Received: OK^M > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Send: AT+CFUN=1^M > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Expect(2): OK > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Received: AT+CFUN=1^M^M > May 18 11:20:53 x60s ppp[1656]: tun0: Chat: Received: ERROR^M I'm not familiar with GPS modem units, but I am familiar with classic modems and a little bit with chat scripts from my Linux days. A couple things -- and possibly these GPS modems behave differently than what I was used to back in the early 90s: 1) Based on the chat logs above, it looks like echo mode is enabled on the modem. The client should be sending "AT\r", and it should receive the response "OK\r". Instead, the log indicates what you're getting back is "AT\r\rOK\r". 2) Regardless of #1, the AT+CFUN=1 command you're sending to the modem results in the modem itself responding with ERROR. This isn't coming from ppp, chat, or anything else -- the modem is literally responding with ERROR itself. Meaning, that command (obviously not Hayes!) the modem firmware doesn't know how to interpret. I have no idea what +CFUN=1 does, but then again the modem doesn't seem to either. :-) So I guess my advice would be: fix your chat script to work properly with your modem. :-) Your script is here: > 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\\\" OK \ > AT+CGACT? OK-AT-OK \ > AT+CGATT? OK \ > AT+CGCLASS? OK \ > AT+COPS? OK \ > ATD*99***1# CONNECT" -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP 4BD6C0CB |