Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 'usb_modeswitch' equivalent



On Fri, 8 Mar 2013, NONAKA Kimihiro wrote:

Hi,

2013/3/7 Saifi Khan <saifi.khan%fastpath.in@localhost>:

Issue
-----
On attaching HUAWEI E171 USB 3G MODEM with vendor Id 12d1 and product Id
1506 (configures absolutely fine on gentoo linux using usb_modeswitch) the
following lines are seen in the dmesg log:
(snip)
Can the more experience NetBSD folks share how they got the USB 3G Modem to
work ? All suggestions and pointers to address this issue will be
appreciated.

Please test attached patch.

Regards,
--
NONAKA Kimihiro


Nonaka Kimihiro San:

Thank you so much. The patch works without any issues. Please see below.


NetBSD 6.99.17 (MYKERNEL) #0: Fri Mar  8 04:42:11 IST 2013
        root@x53u:/usr/src/sys/arch/amd64/compile/MYKERNEL

ATTACH
--------
ehci1: handing over full speed device on port 1 to ohci1
u3ginit0 at uhub3 port 1: Switching to 3G mode
u3ginit0: detached
u3ginit0: at uhub3 port 1 (addr 2) disconnected
u3g0 at uhub3 port 1 configuration 1 interface 0
ucom0 at u3g0 portno 0: 3G Modem
u3g1 at uhub3 port 1 configuration 1 interface 1
u3g1: Missing bulk in/out for interface 1
u3g2 at uhub3 port 1 configuration 1 interface 2
ucom1 at u3g2 portno 0: 3G Modem
u3g3 at uhub3 port 1 configuration 1 interface 3
ucom2 at u3g3 portno 0: 3G Modem
umass1 at uhub3 port 1 configuration 1 interface 4
umass1: HUAWEI HUAWEI Mobile, rev 2.00/1.02, addr 2
umass1: using SCSI over Bulk-Only
scsibus1 at umass1: 2 targets, 1 lun per target
umass2 at uhub3 port 1 configuration 1 interface 5
cd1 at scsibus1 target 0 lun 0: <HUAWEI, Mass Storage, 2.31> cdrom removable
umass2: HUAWEI HUAWEI Mobile, rev 2.00/1.02, addr 2
umass2: using SCSI over Bulk-Only
scsibus2 at umass2: 2 targets, 1 lun per target
sd1 at scsibus2 target 0 lun 0: <HUAWEI, SD Storage, 2.31> disk removable
sd1: drive offline
sd1: unable to open device, error = 19

DETACH
--------
ucom0: detached
u3g0: detached
u3g0: at uhub3 port 1 (addr 2) disconnected
u3g1: detached
u3g1: at uhub3 port 1 (addr 2) disconnected
ucom1: detached
u3g2: detached
u3g2: at uhub3 port 1 (addr 2) disconnected
ucom2: detached
u3g3: detached
u3g3: at uhub3 port 1 (addr 2) disconnected
cd1: detached
scsibus1: detached
umass1: detached
umass1: at uhub3 port 1 (addr 2) disconnected
sd1: detached
scsibus2: detached
umass2: detached
umass2: at uhub3 port 1 (addr 2) disconnected

The ppp log shows the correct sequence of negotiations:

OK

OK

CONNECT
Serial connection established.
Using interface ppp0
Connect: ppp0 <--> /dev/ttyU0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x99fe808a> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <accomp> <pcomp> <asyncmap 0x0> <mru 1500> <magic 0x543> 
<auth chap MD5>]
sent [LCP ConfAck id=0x1 <accomp> <pcomp> <asyncmap 0x0> <mru 1500> <magic 0x543> 
<auth chap MD5>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x99fe808a> <pcomp> <accomp>]
rcvd [CHAP Challenge id=0x1 <bddfeb891ef1b48cdb1654d02f7bd8a4>, name = 
"HUAWEI_CHAP_SRVR"]
sent [CHAP Response id=0x1 <2b8cfd34446ec08d458bc0cd6e6ff2bd>, name = " "]
rcvd [CHAP Success id=0x1 "Welcome!!"]
CHAP authentication succeeded: Welcome!!
CHAP authentication succeeded
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfNak id=0x1 <addr 0.0.0.0>]
rcvd [LCP ProtRej id=0x2 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 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x2]
sent [IPCP ConfAck id=0x2]
rcvd [IPCP ConfNak id=0x2 <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x3 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfNak id=0x3 <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x4 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfNak id=0x4 <addr 117.231.135.142> <ms-dns1 218.248.241.3> <ms-dns2 
218.248.241.4>]
sent [IPCP ConfReq id=0x5 <addr 117.231.135.142> <ms-dns1 218.248.241.3> <ms-dns2 
218.248.241.4>]
rcvd [IPCP ConfAck id=0x5 <addr 117.231.135.142> <ms-dns1 218.248.241.3> <ms-dns2 
218.248.241.4>]
Could not determine remote IP address: defaulting to 10.64.64.64
local  IP address 117.231.135.142
remote IP address 10.64.64.64
primary   DNS address 218.248.241.3
secondary DNS address 218.248.241.4
Hangup (SIGHUP)
Connect time 11.4 minutes.
Sent 48700 bytes, received 706943 bytes.
sent [LCP TermReq id=0x2 "User request"]
rcvd [LCP TermAck id=0x2]
Connection terminated.

The complete log from the /var/log/messages file is:

Mar 14 13:33:14 x53u pppd[612]: pppd options in effect:
Mar 14 13:33:14 x53u pppd[612]: debug           # (from /etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: persist         # (from /etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: logfile ppp.log         # (from 
/etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: dryrun          # (from command line)
Mar 14 13:33:14 x53u pppd[612]: noauth          # (from /etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: user x53u               # (from 
/etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: password ??????         # (from 
/etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: /dev/ttyU0              # (from 
/etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: 460800          # (from /etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: connect /usr/pkg/sbin/chat -v -f 
/etc/ppp/peers/bsnl3g.chat             # (from /etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: local           # (from /etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: novj            # (from /etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: noipdefault             # (from 
/etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: defaultroute            # (from 
/etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: usepeerdns              # (from 
/etc/ppp/peers/bsnl3g)
Mar 14 13:33:14 x53u pppd[612]: Exit.
Mar 14 13:33:54 x53u pppd[477]: pppd 2.4.4 started by root, uid 0
Mar 14 13:33:54 x53u chat[258]: abort on (NO CARRIER)
Mar 14 13:33:54 x53u chat[258]: abort on (NO DIALTONE)
Mar 14 13:33:54 x53u chat[258]: abort on (NO ANSWER)
Mar 14 13:33:54 x53u chat[258]: abort on (DELAYED)
Mar 14 13:33:54 x53u chat[258]: abort on (ERROR)
Mar 14 13:33:54 x53u chat[258]: abort on (BUSY)
Mar 14 13:33:54 x53u chat[258]: send (^MAT^M)
Mar 14 13:33:54 x53u chat[258]: send (ATZ^M)
Mar 14 13:33:54 x53u chat[258]: expect (OK)
Mar 14 13:33:54 x53u chat[258]: ^M
Mar 14 13:33:54 x53u chat[258]: OK
Mar 14 13:33:54 x53u chat[258]: -- got it Mar 14 13:33:54 x53u chat[258]: send (AT+CGDCONT=1,"IP","bsnlnet"^M)
Mar 14 13:33:55 x53u chat[258]: expect (OK)
Mar 14 13:33:55 x53u chat[258]: ^M
Mar 14 13:33:55 x53u chat[258]: ^M
Mar 14 13:33:55 x53u chat[258]: OK
Mar 14 13:33:55 x53u chat[258]: -- got it Mar 14 13:33:55 x53u chat[258]: send (ATDT*99#^M)
Mar 14 13:33:55 x53u chat[258]: timeout set to 30 seconds
Mar 14 13:33:55 x53u chat[258]: expect (CONNECT)
Mar 14 13:33:55 x53u chat[258]: ^M
Mar 14 13:33:55 x53u chat[258]: ^M
Mar 14 13:33:55 x53u chat[258]: CONNECT
Mar 14 13:33:55 x53u chat[258]: -- got it Mar 14 13:33:55 x53u chat[258]: send (^M)
Mar 14 13:33:55 x53u pppd[477]: Serial connection established.
Mar 14 13:33:55 x53u pppd[477]: Using interface ppp0
Mar 14 13:33:55 x53u pppd[477]: Connect: ppp0 <--> /dev/ttyU0
Mar 14 13:33:56 x53u pppd[477]: CHAP authentication succeeded: Welcome!!
Mar 14 13:33:56 x53u pppd[477]: CHAP authentication succeeded
Mar 14 13:33:58 x53u pppd[477]: Could not determine remote IP address: 
defaulting to 10.64.64.64
Mar 14 13:33:58 x53u pppd[477]: local  IP address 117.231.135.142
Mar 14 13:33:58 x53u pppd[477]: remote IP address 10.64.64.64
Mar 14 13:33:58 x53u pppd[477]: primary   DNS address 218.248.241.3
Mar 14 13:33:58 x53u pppd[477]: secondary DNS address 218.248.241.4
Mar 14 13:45:20 x53u pppd[477]: Hangup (SIGHUP)
Mar 14 13:45:20 x53u pppd[477]: Connect time 11.4 minutes.
Mar 14 13:45:20 x53u pppd[477]: Sent 48700 bytes, received 706943 bytes.
Mar 14 13:45:20 x53u pppd[477]: Connection terminated.

As a reference i'm also posting the options and the chat script file.

Here is the /etc/ppp/peer/bsnl3g options file

noauth
connect "/usr/pkg/sbin/chat -v -f /etc/ppp/peers/bsnl3g.chat"
/dev/ttyU0
460800
local
defaultroute
noipdefault
usepeerdns
novj
persist
user ' ' password ' '
debug
logfile "ppp.log"

and the corresponding '/etc/ppp/peer/bsnl3g.chat' file

ECHO ON
ABORT 'NO CARRIER' ABORT 'NO DIALTONE' ABORT 'NO ANSWER' ABORT 'DELAYED'
ABORT 'ERROR'
ABORT 'BUSY'
'' '\rAT'
'' ATZ
OK 'AT+CGDCONT=1,"IP","bsnlnet"'
OK 'ATDT*99#'
TIMEOUT 30
CONNECT ''
HANGUP ON

Please review and share your thoughts about any further improvements that are possible.

Thank you for your time.


thanks
Saifi.



Home | Main Index | Thread Index | Old Index