netcfg/wvdial reconnect issue with Vodafone K3772

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

netcfg/wvdial reconnect issue with Vodafone K3772

Postby crazystick » Tue Jan 15, 2013 2:43 pm

Hi there.

I'm having a strange issue with a 3G modem from Vodafone, netcfg-wvdial from AUR (modified PKGBUILD to include the R.Pi architecture) on a Raspberry Pi running ArchLinuxArm.

I have managed to configure this modem, and I'm able to dial the connection fine on boot (via a udev rule which fires after usb_modeswitch does it's thing) using the netcfg script from AUR. It works very nicely, including when the connection gets disconnected pppd automatically reconnects. I am also able to stop and start the connection with $this->bbcode_second_pass_code('', ' sudo systemctl stop/start netcfg@wvdial ')

However, at some point after a disconnect, when pppd restarts and redials, following CHAP authentication, I receive the following message in the logs: $this->bbcode_second_pass_code('', 'IPCP: timeout sending Config-Requests') and following that, pppd exits and does not restart. Also I am no longer able to stop/start the connection via netcfg. Since this is destined for an embedded system, and the 3G modem is the only connection, auto-reconnect is pretty important as it is the only way of getting in remotely.

Relevant log files (please let me know if I can provide any more):

pppd logs of successful connect, reconnect and failure:
$this->bbcode_second_pass_code('', '
Jan 14 13:45:47 rpi pppd[1051]: pppd 2.4.5 started by root, uid 0
Jan 14 13:45:47 rpi pppd[1051]: Using interface ppp0
Jan 14 13:45:47 rpi pppd[1051]: Connect: ppp0 <--> /dev/ttyUSB0
Jan 14 13:45:47 rpi pppd[1051]: CHAP authentication succeeded: Welcome!!
Jan 14 13:45:47 rpi pppd[1051]: CHAP authentication succeeded
Jan 14 13:45:50 rpi pppd[1051]: Could not determine remote IP address: defaulting to 10.64.64.64
Jan 14 13:45:50 rpi pppd[1051]: Cannot determine ethernet address for proxy ARP
Jan 14 13:45:50 rpi pppd[1051]: local IP address 10.103.200.174
Jan 14 13:45:50 rpi pppd[1051]: remote IP address 10.64.64.64
Jan 14 13:45:50 rpi pppd[1051]: primary DNS address 88.82.13.60
Jan 14 13:45:50 rpi pppd[1051]: secondary DNS address 88.82.13.60
Jan 14 15:25:36 rpi pppd[1051]: LCP terminated by peer
Jan 14 15:25:36 rpi pppd[1051]: Connect time 99.8 minutes.
Jan 14 15:25:36 rpi pppd[1051]: Sent 66758 bytes, received 67207 bytes.
Jan 14 15:25:36 rpi pppd[1051]: Modem hangup
Jan 14 15:25:36 rpi pppd[1051]: Connection terminated.
Jan 14 15:25:37 rpi pppd[1051]: Exit.
Jan 14 15:26:12 rpi pppd[1294]: pppd 2.4.5 started by root, uid 0
Jan 14 15:26:12 rpi pppd[1294]: Using interface ppp0
Jan 14 15:26:12 rpi pppd[1294]: Connect: ppp0 <--> /dev/ttyUSB0
Jan 14 15:26:12 rpi pppd[1294]: CHAP authentication succeeded: Welcome!!
Jan 14 15:26:12 rpi pppd[1294]: CHAP authentication succeeded
Jan 14 15:26:15 rpi pppd[1294]: Could not determine remote IP address: defaulting to 10.64.64.64
Jan 14 15:26:15 rpi pppd[1294]: Cannot determine ethernet address for proxy ARP
Jan 14 15:26:15 rpi pppd[1294]: local IP address 10.103.72.209
Jan 14 15:26:15 rpi pppd[1294]: remote IP address 10.64.64.64
Jan 14 15:26:15 rpi pppd[1294]: primary DNS address 88.82.13.60
Jan 14 15:26:15 rpi pppd[1294]: secondary DNS address 88.82.13.60
Jan 14 18:30:44 rpi pppd[1294]: LCP terminated by peer
Jan 14 18:30:44 rpi pppd[1294]: Connect time 184.5 minutes.
Jan 14 18:30:44 rpi pppd[1294]: Sent 127943 bytes, received 127487 bytes.
Jan 14 18:30:44 rpi pppd[1294]: Modem hangup
Jan 14 18:30:44 rpi pppd[1294]: Connection terminated.
Jan 14 18:30:44 rpi pppd[1294]: Exit.
Jan 14 18:31:19 rpi pppd[1823]: pppd 2.4.5 started by root, uid 0
Jan 14 18:31:19 rpi pppd[1823]: Using interface ppp0
Jan 14 18:31:19 rpi pppd[1823]: Connect: ppp0 <--> /dev/ttyUSB0
Jan 14 18:31:19 rpi pppd[1823]: CHAP authentication succeeded: Welcome!!
Jan 14 18:31:19 rpi pppd[1823]: CHAP authentication succeeded
Jan 14 18:32:33 rpi pppd[1823]: IPCP: timeout sending Config-Requests
')

netcfg profiile
$this->bbcode_second_pass_code('', '
CONNECTION="wvdial"
WVDIAL_PROFILE=""
INTERFACE="ignore"
WVDIAL_CTL_FILE="/var/run/wvdial.pid"
WVDIAL_FLAGS=""
')
Last edited by crazystick on Wed Jan 16, 2013 12:32 pm, edited 1 time in total.
crazystick
 
Posts: 23
Joined: Wed Jul 25, 2012 3:09 pm

Re: netcfg/wvdial reconnect issue

Postby tgc » Wed Jan 16, 2013 6:14 am

I don't know much about the setup you describe, but to me it sounds more like a driver issue, not an issue with the rasoberry pi. Have you tested the modem on a different linux system?
If it should be related to the raspberry pi, it might be that you need a powered hub to power the usb modem.
tgc
 
Posts: 66
Joined: Sun May 20, 2012 8:05 am

Re: netcfg/wvdial reconnect issue with Vodafone K3772

Postby crazystick » Wed Jan 16, 2013 12:31 pm

I don't really know if its a driver issue, since it can run for a day and survive multiple disconnects by automatically redialing. I'm not really sure how I would make that determination. I am going to try it on a standard Arch under VirtualBox to see if I can reproduce it there.

Re the power issue, I know that can be a problem with the R.Pi, but unfortunately, usb_modeswitch which is required to switch the modem from a storage device to a modem device doesn't seem to work when the dongle is plugged in to a hub.

In lieu of a wiki to share how I got this working, here's the rest of my configuration:

udev is responsible for picking up the modem and calling usb_modeswitch. The following rule is part of usb_modeswitch:

/lib/udev/rules.d/40-usb_modeswitch.rules
$this->bbcode_second_pass_code('', '
...
# Vodafone / Huawei K3772
ATTR{idVendor}=="12d1", ATTR{idProduct}=="1526", RUN+="usb_modeswitch '%b/%k'"
...
')

This seems to end up calling usb_modeswitch with the wrong arguments unless you plug it directly into the Pi.

usb_modeswitch also requires a config file for the specific device:

/etc/usb_modeswitch.d/12d1\:1526
$this->bbcode_second_pass_code('', '
DefaultVendor= 0x12d1
DefaultProduct= 0x1526

TargetVendor= 0x12d1
TargetProduct= 0x14cf

MessageContent="555342437f0000000002000080000a11062000000000000100000000000000"
')

This turns the 12d1:1526 into a 12d1:14cf and then shows up as /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2. Finally, when usb_modeswitch does it's thing, start the netcfg-wvdial service, again via udev:

/etc/udev/rules.d/91-local.rules
$this->bbcode_second_pass_code('', '
...
ATTR{idVendor}=="12d1", ATTR{idProduct}=="14cf", TAG+="systemd", ENV{SYSTEMD_WANTS}="netcfg@wvdial.service"
...
')

The final part of the puzzle is the configuration of wvdial, which you can find elsewhere, but for completeness, here is my config:

/etc/wvdial.conf
$this->bbcode_second_pass_code('', '
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Modem Type = Analog Modem
ISDN = 0
Init1 = ATZ
Modem = /dev/ttyUSB0
Baud = 460800
Phone = *99#
Username = web
Password = web
Init3 = AT+CGDCONT=1,"IP", "smart"
')

The username, password and APN will depend on what kind of contract you have with Vodafone, PAYG, monthly etc.
Last edited by WarheadsSE on Wed Jan 16, 2013 4:15 pm, edited 1 time in total.
Reason: adjusting code tags
crazystick
 
Posts: 23
Joined: Wed Jul 25, 2012 3:09 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest