xe135.com Building Better Worlds

29May/100

Huawei K3765 and Vodafone on Arch Linux

Recently I got myself a 3G subscription as a fallback for when the ADSL is down. Since I use a Linux server to manage things at home it became the logical choice to maintain this connection. Although Vodafone is quite ahead with supporting Linux that came with all sorts of dependencies (python, GUI) I didn't like.

The ingredients: Arch Linux, kernel 2.6.33 (and pppd), Huawei K3765 and Vodafone Mobile Connect.

The following is more of a overview of all the configuration files involved and the expected values by Vodafone in The Netherlands. If the files already exist on your system please make sure these additions are correctly added. Also, your AP (office.vodafone.nl in my example) may be different.

Configure the hardware;
modprobe usbserial vendor=0x12d1 product=0x1465
You can add the previous command to /etc/rc.local or use a better solution to survive reboots. Check out the output of dmesg, it should read something like;

usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usb 1-1: generic converter now attached to ttyUSB0

After that we need to make sure we have all the necessary software;
pacman -Sy pppd

We have a lot of files to configure, let's go:
/etc/ppp/chap-secrets
vodafone * vodafone *
/etc/chatscripts/vodafone.chat
TIMEOUT 3
ABORT "BUSY"
ABORT DELAYED
"" ATZ
OK AT+CGDCONT=1,"IP","office.vodafone.nl"
OK ATD*99#
CONNECT ""

/etc/ppp/peers/vodafone
connect "/usr/sbin/chat -v -f /etc/chatscripts/vodafone.chat"
noauth
noipdefault
user vodafone
defaultroute
usepeerdns

/etc/ppp/ip-up.d/vodafone.sh (optional)
#!/bin/sh
echo `date +%s` vodafone UP >> /var/log/vodafone.log

/etc/ppp/ip-down.d/vodafone.sh (optional)
#!/bin/sh
echo `date +%s` vodafone DOWN time: $CONNECT_TIME recv: $BYTES_RCVD sent: $BYTES_SENT >> /var/log/vodafone.log

If you decide to use these script make sure both are executable;
chmod +x /etc/ppp/ip-up.d/vodafone.sh /etc/ppp/ip-down.d/vodafone.sh
We're done! To start your connection;
pppd /dev/ttyUSB0 460800 call vodafone
after that /var/log/everything.log should contain something like;

pppd: Serial connection established.
pppd: Using interface ppp0
pppd: Connect: ppp0 < --> /dev/ttyUSB0
pppd: CHAP authentication succeeded

To close the connection;
poff
If you chose to use the up & down scripts check out /var/log/vodafone.log. In this file you'll find UNIX timestamps plus any information related to the event.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.