You are not logged in.

#1 2013-08-06 21:31:13

studentik
Member
Registered: 2013-05-24
Posts: 38

[SOLVED] netctl profile auto-start/stop on Huawei modem plug-in/out

Hello!

I have Huawei 3G USB modem.

$ lsusb | grep -i huawei
Bus 004 Device 007: ID 12d1:1436 Huawei Technologies Co., Ltd. E173 3G Modem (modem-mode)

I am trying to make netctl to auto-switch to internet connection via this modem as soon as I plug it in.

Following Arch Wiki, I made internet via wvdial working fine:

$ sudo wvdial kymp
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","internet.kymp.net"
AT+CGDCONT=1,"IP","internet.kymp.net"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Tue Aug  6 22:52:11 2013
--> Pid of pppd: 2087
--> Using interface ppp0
--> local  IP address <...>
--> remote IP address <...>
--> primary   DNS address <...>
--> secondary DNS address <...>

Next, I tried to setup netctl profile for this modem, but my netctl mobile_ppp profile is NOT working:

$ cat /etc/netctl/ttyUSB0-kymp | nocomment
Description='Kymp internet connection'
Interface=ttyUSB0
Connection=mobile_ppp
PPPDebug=true
AccessPointName=internet.kymp.net
Mode=3Gpref

...with following log info:

$ sudo journalctl -b | grep pppd | grep 2387
pppd 2.4.5 started by root, uid 0
Script /usr/sbin/chat -v -t15 -f /run/network/mobile_ppp.ttyUSB0.ttyUSB0-kymp/modem.chat finished (pid 2389), status = 0x0
Serial connection established.
using channel 8
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xbe5c7839> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x11 <asyncmap 0x0> <auth chap MD5> <magic 0x167ecad> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x11 <auth chap MD5>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xbe5c7839> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x12 <asyncmap 0x0> <magic 0x167ecad> <pcomp> <accomp>]
sent [LCP ConfAck id=0x12 <asyncmap 0x0> <magic 0x167ecad> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xbe5c7839]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <addr 192.168.1.15> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [LCP DiscReq id=0x13 magic=0x167ecad]
rcvd [LCP EchoRep id=0x0 magic=0x167ecad be 5c 78 39]
rcvd [LCP ProtRej id=0x14 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfNak id=0x1 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x2 <addr 192.168.1.15> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
rcvd [IPCP ConfNak id=0x2 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x3 <addr 192.168.1.15> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
rcvd [IPCP ConfNak id=0x3 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x4 <addr 192.168.1.15> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
rcvd [IPCP ConfNak id=0x4 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x5 <addr 192.168.1.15> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
rcvd [IPCP ConfNak id=0x5 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x6 <addr 192.168.1.15> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
Hangup (SIGHUP)
Modem hangup
Connection terminated.
Exit.

Seems like something is wrong in netctl profile and I need to teach netctl to use wvdial instead of whatever-it-uses-now for mobile_ppp connection.
So the question is: "Is this possible to make netctl profile based on wvdial connection? Or is this possible to fix abovr netctl mobile_ppp profile?" 

Any help is appreciated! Thank you!

Last edited by studentik (2013-08-09 04:33:18)

Offline

#2 2013-08-09 04:31:14

studentik
Member
Registered: 2013-05-24
Posts: 38

Re: [SOLVED] netctl profile auto-start/stop on Huawei modem plug-in/out

Managed to solve above problem by adding "noipdefault" parameter to pppd config lines in /usr/lib/network/connections/mobile_ppp

In case somebody needs, here is how to make netctl profile auto-start/stop on Huawei modem plug-in/out:

$ cat /etc/udev/rules.d/99-huaweimodem.rules 
ACTION=="add"   , SUBSYSTEM=="tty"  , KERNEL=="ttyUSB[0-9]", DEVPATH=="*:1.0*", SYMLINK+="huaweimodem"
ACTION=="change", SUBSYSTEM=="block", ENV{ID_CDROM_MEDIA}=="1", ENV{ID_SERIAL}=="HUAWEI*", ENV{ID_TYPE}=="cd", RUN+="/usr/bin/netctl start huawei"
ACTION=="remove", SUBSYSTEM=="tty"  , KERNEL=="ttyUSB[0-9]", DEVPATH=="*:1.0*", RUN+="/usr/bin/netctl stop huawei"

$ cat /etc/netctl/huawei 
Description='Kymp/DNA internet connection'
Interface=huaweimodem
Connection=mobile_ppp
AccessPointName=internet
User=internet
Password=internet

Worked for me for E173 and E220 Huawei modems with two different ISPs.

Last edited by studentik (2013-08-09 04:40:55)

Offline

#3 2014-04-01 08:06:17

dizzib
Member
Registered: 2013-12-09
Posts: 7

Re: [SOLVED] netctl profile auto-start/stop on Huawei modem plug-in/out

Thanks for posting 99-huaweimodem.rules. Works like a charm!

Offline

#4 2015-04-21 15:37:47

carongangoo
Member
Registered: 2014-10-22
Posts: 58

Re: [SOLVED] netctl profile auto-start/stop on Huawei modem plug-in/out

hi everybody !
Via Archlinux installed on an external usb hdd, I am unable to connect to the internet with a huawei usb modem E 153 .I followed the wiki and I get the following error : "  can't use storage command in MessageContent with interface 0; interface class is 239, should be 8. Aborting ".
Can you please help ?
Regards
Caron

Offline

#5 2015-05-04 08:58:34

pklaus
Member
Registered: 2011-05-03
Posts: 8

Re: [SOLVED] netctl profile auto-start/stop on Huawei modem plug-in/out

studentik wrote:

Managed to solve above problem by adding "noipdefault" parameter to pppd config lines in /usr/lib/network/connections/mobile_ppp


Thanks for sharing this bit of information. This solved the issue for me. But before fixing this, I also had to change the file at another position: I had to escape the quotes around the IP in the connect string setting the APN, so that it now looks like this:

${AccessPointName:+'OK-AT-OK' 'AT+CGDCONT=1,\"IP\",$(quote_word "$AccessPointName")'}

Without this change, I was getting errors like this:

May 04 10:25:26 bppi chat[2105]: send (AT+CGDCONT=1,IP,"web.vodafone.de"^M)
May 04 10:25:27 bppi chat[2105]: expect (OK)
May 04 10:25:27 bppi chat[2105]: ^M
May 04 10:25:27 bppi chat[2105]: AT+CGDCONT=1,IP,"web.vodafone.de"^M^M
May 04 10:25:27 bppi chat[2105]: ERROR^M
May 04 10:25:30 bppi pppd[2103]: Connect script failed

Offline

#6 2015-09-01 22:46:58

Zucca
Member
From: KUUSANKOSKI, Finland
Registered: 2009-02-26
Posts: 135

Re: [SOLVED] netctl profile auto-start/stop on Huawei modem plug-in/out

I did took a look at the mobile_ppp script source (netctl v.1.11-1). It checks for ChatScript variable.
That variable can cointain path to your custom chat script.
Set it on your network profile file (/etc/netctl/<profilefile>).

See man netctl.profile for more.

I tested it and managed to get my Huawei e3372 _finally_ working. \o/

Last edited by Zucca (2015-09-01 23:32:22)


K.i.s.s. <3

Offline

Board footer

Powered by FluxBB