LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 03-23-2015, 07:06 PM   #1
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 15.0 64bit
Posts: 186

Rep: Reputation: 23
Help using 3G USB dongle through WWAN interface rather than PPP


I'm tryng to make an Olicard-300 3g usb modem work using WWAN network interface rather than PPP.

When I plug-in this particoular modem, an interface wwan0 and a device /dev/cdc-wdm0 are created.
So I'm ask myself if there are any chances to use this wwan0 for internet connection.

I usually configure theese type of device as a dial-up modem:
also in this case it is possible to create /dev/ttyUSB* devices loading usbserial kernel module and then configure a ppp connectiong using for example a pppd and chat script, or wvdial or any other ppp tool.

But... I'm courious to know if is possible to configure internet connection over wwan0 interface and how to make it.

I'm trying this stuff on a Debian Jessie installed via neinst... There aren't any graphic environment installed yet, it's a minimal system for now.

I've added ppp, modemmanager and so on.. also libmbim-utils and libqmi-utils (mbimcli or qmicli to inquire that cdc-wdm0 device, but without luck...).

Can anybody help me out there?
Let me know about any log to post there...

Thanks in advance!
 
Old 03-24-2015, 03:42 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,734

Rep: Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126
I've never used a mobile broadband device that presents anything other than a serial interface, (so I'm curious too), but since you mention a wwan0 network device being created, one would assume that Network Manager could handle it in principle. Did you try configuring it there yet? With the device plugged in, what is reported?
Code:
/sbin/ifconfig
Code:
/sbin/route -n
or
Code:
ip address
Code:
ip route
I have seen threads where success was manually achieved using
Code:
ifconfig wwan0 up
dhclient wwan0
Anyway, hopefully someone more familiar with these newer devices can chime in to help progress this.

Last edited by ferrari; 03-24-2015 at 03:43 AM.
 
Old 03-24-2015, 06:59 AM   #3
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 15.0 64bit
Posts: 186

Original Poster
Rep: Reputation: 23
Thnaks for your reply!

That wwan0 interface is created but is down.

Searching the web, I had found success story you reported.
So I've tried the "by hand way":

Code:
iconfig wwan0 up
dhclient wwan0
But nothing...

Then I've tried to configure it in /etc/network/interface.d/wwan0 like explained at this link for example:
So in my case I've translated it as follow:
Code:
iface wwan0 inet dhcp
   wwan_apn  "ibox.tim.it"
An then bring up the interface with a simple:
Code:
ifup wwan0
But... It doesn't work.
There is likely something more to do..

Uhmm...
I've just read about the need (at the link above, but also there) to send an AT command (I think manufacturer specific) that magically connect the dongle to the requested APN.
For example:
Code:
AT^NDISDUP=1,1,"apn"
So I've decided to try it with an other dongle I'm using: "Huawei E-353"
This one is a linux-friendly dongle ufficially supported and working out of the box as a modem device /dev/ttyUSB*.. Thanks to modem-manager and usb-modeswitch.
On Debian Jessie also in this case I obtain a wwan0 interface pluging in the dongle.
Now I'm tring it on an older system Slackware-14.0 in which no wwan0 is automatically created.

Anyway if I send:
Code:
echo -ne 'AT^NDISDUP=1,1,"ibox.tim.it"\n\r' > /dev/ttyUSB0
Suddently dongle led light stop flashing and remain lit (dark blue) like when it is regularly connected to internet.

Peraphs that is the missing part of the configuration.
And the interface config file could be as follow:
Code:
iface wwan0 inet dhcp
        pre-up echo -ne 'AT^NDISDUP=1,1,"ibox.tim.it"\n' > /dev/ttyUSB0
That pearphs could work with the huawei E-353 (I'll try it on debian jessie).

But for the Olicard-300 the problem is that it isn't recognized as a modem out of the box: modem-manager + usb_modeswitch don't seem to be able to switch it, so it rest recognized as a "Zero CD" (/dev/sr*).
Also lsusb command report vendor and product "2020:0002", rather than the expected (modem mode) "2020:4000".

I've found this quite simple procedure to switch it:

Code:
# eject /dev/sr0
This is enought to switch to modem mode: now lsusb says "2020:4000".
Also the interface wwan0 is created after that "fake ejecting".

But we don't have any serial port yet like /dev/ttyUSB*.
So for that scope manual loading of usbserial kernel module seems to be needed:
Code:
# usbserial vendor=0x2020 product=0x4000
Now we have:
- /dev/ttyUSB0 (able to receive an AT command that activate the dongle something like the AT^NDISUP working for the huawei)
- wwan0 configured to pre-activate the dongle and obtain an ip address

Will all this work???
I'll try to get it....

Stay tuned!

... And any suggest or comment is greatly appreciated!
 
Old 03-24-2015, 12:04 PM   #4
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 15.0 64bit
Posts: 186

Original Poster
Rep: Reputation: 23
Ok folks!
I've good news and bad ones..

The good:

My Huawei-E353 can connect over WWAN on Debian Jessie:

Code:
~# cat /etc/network/interface.d/wwan0
iface wwan0 inet dhcp
      pre-up echo -ne 'AT^NDISDUP=1,1,"ibox.tim.it"\n' > /dev/ttyUSB0
#     post-up $todo-setup-route... something like:  ip route add default via ${WWAN_INET_IP} dev wwan0
Code:
~# ifup wwan0
~# ifconfig wwan0
reading... the inet interface wwan0 IP and copy to the follow command

Code:
~# ip route add default via x.x.x.x dev wwan0
Ok, now I should substitute the IP assigned by the ISP to wwan0 interface in the post-up string above.
This is necessary because my isp doesn't seem to automatically route wwan0 to internet..
I don't know well Debian, but i think there will be a environment variable to use in interface.d files for recall the IP assigned value.

I mean if my isp assign to wwan the ip: 10.187.100.105
I have to launch as post-up string: "ip route add default via 10.187.100.105 dev wwan0"
I need an environment variable usable in /etc/network/interfaces.d/wwan0 countaining the above assigned ip (10.187.100.105).
Is there that variable?


- The bad news.
Other usb key, Olicard-300 doesn't support AT^NDISDUP command. Seems this is only used by Huawei devices.
So I'm not able to force that key to connect to the ISP right APN.
And I've not found any At commands reference manual for "Olivetti" devices.
If you know where to find it, please let me know! Now I'm close to the solution of this configuration... just lil help needed to accompilsh.
 
Old 03-24-2015, 02:43 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,734

Rep: Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126
Good progress!

Quote:
But for the Olicard-300 the problem is that it isn't recognized as a modem out of the box: modem-manager + usb_modeswitch don't seem to be able to switch it, so it rest recognized as a "Zero CD" (/dev/sr*).
Also lsusb command report vendor and product "2020:0002", rather than the expected (modem mode) "2020:4000".

I've found this quite simple procedure to switch it:

Code:

# eject /dev/sr0

This is enought to switch to modem mode: now lsusb says "2020:4000".
Also the interface wwan0 is created after that "fake ejecting".
This part could be automated with a udev rule with something like
Code:
ATTR{idVendor}=="2020", ATTR{idProduct}=="2000, RUN+="/usr/bin/eject k", OPTIONS="last_rule"
Maybe another rule to load the 'usbserial' driver after the device switching? Just a guess from me
Code:
ATTR{idVendor}=="2020", ATTR{idProduct}=="4000, RUN+="/sbin/modprobe usbserial vendor=0x2020 product=0x4000"

Last edited by ferrari; 03-24-2015 at 04:08 PM.
 
Old 03-24-2015, 04:09 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,734

Rep: Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126
For some strange reason I couldn't get the udev rule to display percent and k, other symbols appear ok. The percent character needs to precede the 'k' character to work. The forum editor removes or hides it. Why is that I wonder?

Last edited by ferrari; 03-24-2015 at 04:13 PM.
 
Old 03-24-2015, 10:01 PM   #7
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,734

Rep: Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126
Quote:
The bad news.
Other usb key, Olicard-300 doesn't support AT^NDISDUP command. Seems this is only used by Huawei devices.
So I'm not able to force that key to connect to the ISP right APN.
And I've not found any At commands reference manual for "Olivetti" devices.
If you know where to find it, please let me know! Now I'm close to the solution of this configuration... just lil help needed to accompilsh.
Hmmm... I wonder if you need to do something using QMI similar to what is outlined here

http://www.draisberghof.de/usb_modes...pic.php?p=9465

Code:
sudo uqmi -d /dev/cdc-wdm0 --start-network ibox.tim.it
or in /etc/network/interface.d/wwan0 with something like
Code:
iface wwan0 inet dhcp
pre-up uqmi -d /dev/cdc-wdm0 --start-network ibox.tim.it --keep-client-id wds
Sorry to be vague. I don't have one of these devices to play with.
 
Old 03-25-2015, 08:46 PM   #8
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 15.0 64bit
Posts: 186

Original Poster
Rep: Reputation: 23
I've tried something like that:

I can't find uqmi for debian jessie via apt package manager...
But there is libqmi-utils that contains "qmicli", I think it is something very close to "uqmi".

Anyway those user interfaces to libqmi do not seems to work for me.

liqmi could/should work with Huawei dongle...
and libmbim (and its mbimcli) should talk with the Olicard.
(also mmcli without any lucky event).
But I'cant make any of those tools working, obtaining nothing more of a cryptic "error transaction timeout" or something similar.



Huawei dongle has its (peraphs proprietary) AT command (AT^NDISDUP=1,1,"a.p.n") to connect via NDIS mode, so no need of libqmi/libmbim/mmcli

But I can't find any AT equivalent for the Olivetti Olicard 300. However reading for example Olicard 100 features, pdf manual found online talks about NDIS/RAS modes.... that guide is windows oriented, but if that Olivetti key supports NDIS, I think it must be somewhere an at command to activate that feature.
The problem is that AT commands for olivetti olicards are not so easy to find on the net!

Anyway thanks for your hints!

PS.
In /etc/network/interfaces.d/* I have to use executables absolute path ("/bin/echo" instead of "echo"), example:

Code:
iface wwan0 inet dhcp
     pre-up /bin/echo -ne 'AT^NDISDUP=1,1,"ibox.tim.it"\r\n' > /dev/ttyUSB0
     post-down /bin/echo -ne 'AT^NDISDUP=1,0\r\n' > /dev/ttyUSB0
This works ok with "ifup" and "ifdown" too.
Obiouvsly just for the Huawei dongle...
 
Old 03-25-2015, 09:12 PM   #9
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,734

Rep: Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126
I stumbled across this while searching for anything that might be helpful

http://lugscandiano.org/index.php/In...22529_su_linux

but a quick look at the tarball shows that it's just automating connectivity with udev rules and accessing via the /dev/ttyUSB0 device node.

I would consider trying to contact the Olivetti vendor directly.

Last edited by ferrari; 03-25-2015 at 09:33 PM.
 
Old 05-03-2015, 06:47 PM   #10
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 15.0 64bit
Posts: 186

Original Poster
Rep: Reputation: 23
Just an update about Olicard 300 dongle:
you can find more info about my progress with this mobile internet dongle at following link:
http://www.draisberghof.de/usb_modes...php?f=3&t=2273

The above are about mode switching step and involve applying a patch to option.c source of that kernel module.
After that I can obtain follwing output of usb-device:
Code:
T:  Bus=02 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2020 ProdID=4000 Rev=03.00
S:  Manufacturer=Network Connect
S:  Product=MT6225 
C:  #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option
I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
As you can see now we have an MBIM interfaced that is linked to /dev/cdc-wdm0 (or /dev/cdc-wdm1 when I have also Huawei dongle plugged in).
Morever we have also four /dev/ttyUSB* devices managed by option kernel module.

Ok...
After upgrading to a recent kernel and recent libmbim I can obtain some results by testing the MBIM connection on slackware-14.0.

Firstly turning on radio state is needed
Code:
# mbimcli -d /dev/cdc-wdm1 --set-radio-state=on
# mbimcli -d /dev/cdc-wdm1 --query-radio-state
[/dev/cdc-wdm1] Radio state retrieved:
             Hardware Radio State: 'on'
             Software Radio State: 'on'
Ok now we can use mbim-network script provided by libmbim package to try connection.
I need to set my APN address in the proper config file:
Code:
# cat /etc/mbim-network.conf 
APN=ibox.tim.it
Then let's try to connect:
Code:
# mbim-network /dev/cdc-wdm1 start
Loading profile...
    APN: ibox.tim.it
Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm1 --query-subscriber-ready-status --no-close'...
[/dev/cdc-wdm1] Subscriber ready status retrieved: Ready state: 'initialized' Subscriber ID: 'XXXXXXXXXXXXXXX' SIM ICCID: 'XXXXXXXXXXXXXXXXXX' Ready info: 'unknown' Telephone numbers: (1) 'XXXXXXXXXX' [/dev/cdc-wdm1] Session not closed: TRID: '3'
Saving state... (TRID: 3)
Querying registration state 'mbimcli -d /dev/cdc-wdm1 --query-registration-state --no-open=3 --no-close'...
[/dev/cdc-wdm1] Registration status: Network error: 'unknown' Register state: 'home' Register mode: 'automatic' Available data classes: 'hsdpa, hsupa' Current cellular class: 'gsm' Provider ID: '22201' Provider name: '22201' Roaming text: 'unknown' Registration flags: 'packet-service-automatic-attach' [/dev/cdc-wdm1] Session not closed: TRID: '4'
Saving state... (TRID: 4)
Attaching to packet service with 'mbimcli -d /dev/cdc-wdm1 --attach-packet-service --no-open=4 --no-close'...
Saving state... (TRID: 5)
Starting network with 'mbimcli -d /dev/cdc-wdm1 --connect=ibox.tim.it --no-open=5 --no-close'...
Network started successfully
Saving state... (TRID: 6)
Ok at this point dongle should be properly connected to my ISP. Its led begin to blink too, like when connection is active.
But we are not yet online: we still need an IP address!

How to obtain it?
Lets try by setting up dhcp with dhclient:
Code:
# dhclient -4 wwan1
And there are following new lines appended in "/var/log/messages":
Code:
May  4 00:26:05 darkstar dhclient: DHCPDISCOVER on wwan1 to 255.255.255.255 port 67 interval 7
May  4 00:26:12 darkstar dhclient: DHCPDISCOVER on wwan1 to 255.255.255.255 port 67 interval 8
May  4 00:26:20 darkstar dhclient: DHCPDISCOVER on wwan1 to 255.255.255.255 port 67 interval 16
May  4 00:26:36 darkstar dhclient: DHCPDISCOVER on wwan1 to 255.255.255.255 port 67 interval 16
May  4 00:26:52 darkstar dhclient: DHCPDISCOVER on wwan1 to 255.255.255.255 port 67 interval 14
May  4 00:27:06 darkstar dhclient: No DHCPOFFERS received.
May  4 00:27:06 darkstar dhclient: No working leases in persistent database - sleeping.
Seems dhcp doesn't work properly...
I've try also to configure rc.d inetd1.conf file (the slackware way..):
Code:
# Config information for wwan1:
IFNAME[6]="wwan1"
IPADDR[6]=""
NETMASK[6]=""
USE_DHCP[6]="yes"
DHCP_HOSTNAME[6]=""
DHCP_KEEPRESOLV[6]="yes"
DHCP_KEEPNTP[6]="yes"
...but it fails.
Code:
# /etc/rc.d/rc.inet1 wwan1_start
Polling for DHCP server on interface wwan1:
dhcpcd[14386]: version 5.5.6 starting
dhcpcd[14386]: wwan1: sending IPv6 Router Solicitation
dhcpcd[14386]: wwan1: broadcasting for a lease
dhcpcd[14386]: wwan1: sending IPv6 Router Solicitation
dhcpcd[14386]: wwan1: sending IPv6 Router Solicitation
dhcpcd[14386]: timed out
dhcpcd[14386]: allowing 8 seconds for IPv4LL timeout
dhcpcd[14386]: wwan1: sending IPv6 Router Solicitation
dhcpcd[14386]: wwan1: no IPv6 Routers available
dhcpcd[14386]: timed out
So I've read about DHCP support and It seems many MBIM devices don't support it.
If I right understand, there must be an other way to obtain an IP address directly using Lib-MBIM.
But I still didn't understand how to do...

So if you have any hint please let me know!
It would be really greatly appreciated!

PS.
The same steps are replicable on my other dongle: the huawei one.
But this time It supports qmilib rather than mbim.
Also this time we need a config file /etc/qmi-network.conf:

Code:
 cat /etc/qmi-network.conf 
APN="ibox.tim.it"
And an entry for wwan0 in interfaces config file /etc/rc.d/rc.inet1.conf
Code:
# Config information for wwan0:
IFNAME[5]="wwan0"
IPADDR[5]=""
NETMASK[5]=""
USE_DHCP[5]="yes"
DHCP_HOSTNAME[5]=""
DHCP_KEEPRESOLV[5]="yes"
DHCP_KEEPNTP[5]="yes"
Now we can connect with following commands:
Code:
qmi-network /dev/cdc-wdm0 start && /etc/rc.d/rc.inet1 wwan0_restart
In this case DHCP support seems ok and my ISP assigns an IP properly to wwan0 interface.
So non need to send vendor defined AT commands to /dev/ttyUSB0 as I reported in my previous post... thanks to new kernel and new libqmi upgrade.

Last edited by joenew; 05-03-2015 at 06:52 PM.
 
Old 05-04-2015, 12:19 AM   #11
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,734

Rep: Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126Reputation: 1126
Well done with the progress. I can see you've been working hard here.
 
Old 04-19-2016, 04:33 PM   #12
mackela13
LQ Newbie
 
Registered: Apr 2016
Posts: 2

Rep: Reputation: Disabled
hey. did you managed to obtain IP address directly using Lib-MBIM. I have the same problem, mbim is started succesfully but no ip on wwan0
 
Old 04-21-2016, 03:54 AM   #13
mackela13
LQ Newbie
 
Registered: Apr 2016
Posts: 2

Rep: Reputation: Disabled
help

i am having same problem, did you managed to solve it?
 
Old 04-22-2016, 06:22 AM   #14
joenew
Member
 
Registered: Mar 2010
Distribution: slackware 15.0 64bit
Posts: 186

Original Poster
Rep: Reputation: 23
Hi Mackela, I haven't that Olicard dongle anymore. But yes finally I had solved by install the development version of "libmbim" (via git repository).
I had also asked on project mailing list, take a look to this thread:
https://lists.freedesktop.org/archiv...ay/000560.html

They had released a new patched version that at connection time returns IP, GATEWAY, NETWORK and all addresses needed to configure your "wwan0" interface.
So you just need to "parse" that returned infos and reuse them as "ip" command arguments. If you read the above topic I had reported my solution:
Quote:
Finally I launched mbimcli connection... and it report also my IP GW DNS MTU
etc... So It works!

Ok, but now we have to manually configure wwan inferface.

[...]

Now I've used these commands (iproute2):
-----------------------
ip a a $IP dev $DEV b +
ip l s $DEV up
ip r a default via $GW dev $DEV
-------------------------------

IP is my assigned IP/network
GW is my assigned gateway
DEV is my wwan interface wwan0, or wwan1...
So I may have a bash script somewhere, I don't remember... If I find it I'll post.

Anyway Mackela, try to post your output and other infos about your system:
- which linux system are you using? (distro and kernel version)
- which dongle model are you referring to?
- which libmbim version is installed on your system?
- Try to connect by using libmbim and report output. So we'll see if it reports infos about address gateway and so on.
- Report also "ifconfig" command to show wwan interface up and its data.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[raspbian] ppp interface dropping regularly layr Linux - Networking 8 09-23-2013 04:05 AM
[SOLVED] script if ppp interface is up KatrinAlec Linux - Networking 7 08-24-2012 08:52 AM
how to connect to internet via usb dongle (MPS internet dongle) on Fedora 16 O.S danibhai Linux - Newbie 1 07-30-2012 12:03 PM
ppp interface... culin Linux - Networking 4 04-13-2007 04:49 PM
waiting for the PPP interface ertz Linux - Networking 2 05-17-2004 05:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 11:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration