PDA

View Full Version : Huawei E220 USB usage in Fedora8 - bugs and workarounds


krajorama
25th January 2008, 11:30 PM
Hi,

I'm using this Huawei E220 usb to connect to my local provider (Pannon in Hungary). At first I could not connect and I got (after turning on pppd debug):
...
Jan 26 00:24:00 krajo pppd[4168]: CHAP authentication succeeded
Jan 26 00:24:00 krajo pppd[4168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>
]
Jan 26 00:24:00 krajo pppd[4168]: Hangup (SIGHUP)
Jan 26 00:24:00 krajo pppd[4168]: Modem hangup
Jan 26 00:24:00 krajo pppd[4168]: Connection terminated.
...

The solution turned out to be to wait 5 seconds after sending the "AT+CPIN=<pin>" command to the modem. The hardware is probably buggy and answers "OK" before actually finishing the operation.

However wvdial used in Fedora doesn't support delays, so I had to write my own expect script:
send "AT+CPIN=<pin>\r"
sleep 5
send "ATZ\r"
expect "OK"
send "ATM0\r"
expect "OK"
send "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0\r"
expect "OK"
send "ATDT*99#\r"
expect {
"CONNECT" exit 0
default exit 1
}

Then change /etc/ppp/peers/Pannon from
connect "/usr/bin/wvdial --remotename Pannon --chat 'Pannon'"
to
connect "/usr/bin/expect -f /root/bin/Pannon.expect"
Where Pannon is my ISP and /root/bin/Pannon.expect is the place for the little script above.


I've also made udev start ppp by itself, so when I plug in the modem, it connects. But that's a different story.

regards, krajo