On Thu, Mar 13, 2014 at 02:15:27PM +0000, Stuart Henderson wrote: > On 2014-03-13, Zé Loff <zel...@zeloff.org> wrote: > > Hi all > > > > I found out my Ericsson F3705g GSM/WCDMA modem can be configured to do > > all the LCP, auth, IPCP and routing stuff automagically. A couple of AT > > commands cu (radio on + connect) and a DHCP request on the cdce > > interface is all it takes to get a working connection. A couple AT > > commands more are needed to disconnect / disable radio. > > There is no LCP/IPCP etc. with cdce, the GSM/3G terminal just acts as > an ethernet-like interface instead of acting like a PPP interface. > (With PPP, the session is with the terminal *not* the mobile network).
Exactly. That's why I was wondering on how to do this (this being modem chatting, connect/disconnect scripts, etc) without resorting to ppp(8). The card handles all the stuff that normally would be ppp(8)'s job, as it implements a bunch of AT commands to set auth, LCP, IPCP, DNS, routing, etc. You can even define 'accounts' with specific combinations of these parameters and then just tell the card to 'enable account X'. It establishes the connection and starts emulating ethernet on the cdce interface (please excuse any wrong terminologu, I'm more or less quoting Sony Ericsson, and I'm no expert on the matter). See [1] and [2] (page 238 onwards) if you're interested. > > What is the better way to automate this connecting / disconnecting? > > Can chat(8) be used outside ppp/pppd? > > Yes it can. Just looked it up more carefully. Standard redirection. Duh. I'm sorry I asked... > > Anything usable by netstart?... > > Netstart won't try to configure cdce0 unless the device exists > when it's run .. So you could do either of these: > > 1. modify /etc/rc to send the AT commands before netstart is run > so that it can find a cdce0 device cdce0 is immediately available, no problem there > 2. create hostname.cdce0, accept that it won't be auto configured > at startup, and send the AT commands and run "/etc/netstart cdce0" > from rc.local Not being autoconfigured isn't a problem. hotplugd can be used to send the "radio on" command if I don't care much about battery life, and now that I think of it, maybe I can tell ifstated(8) to enable/disable the GSM/3G connection when I manually tell cdce0 to come up/down (disabling the connection is an important part in all this)... I guess this comes close to option 4 below. > 3. bodge things by putting shell commands in hostname.em0 or similar > > 4. just use a script which you run manually to bring up the mobile > network. > > I prefer 1 or 4.. Many thanks! Zé [1] http://www.natisbad.com/E4300/Dell_Wireless_5530_AT_cmd_ref.html [2] http://dl-developer.sonymobile.com/documentation/DW-65054-dg_at_2006--10_r17a.pdf --