Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using wvdial and usb_modeswitch to connect to internet with usb internet key

103 views
Skip to first unread message

Daniele Disco

unread,
Mar 22, 2017, 5:40:03 AM3/22/17
to
Hi!
Usually to connect to internet my linux box (with gnome), I insert in a usb port my dongle 3G/4g and selecting in Network Manager the broad band connection configured the first time, selecting _Connect_ the pc goes in internet without problems (% of success 99.999).

Now I have to use a debian 8.0 version in an embedded system (Raspberry Pi 3), without graphical interface (if I use the version with any X Window System my code runs slowly), and connect this device to internet with the same internet usb key.

After google search I define a procedure to connect to internet but the % of success is 50%. So I think that somethings is wrong or is not present in my procedure. For this reason I ask your help.

Tools used wvdial, usb_modeswith

The conf file are:
----------------usb_modeswitch.conf-----------------------------
# Configuration for the usb_modeswitch package, a mode switching tool for
# USB devices providing multiple states or modes
#
# Evaluated by the wrapper script /usr/sbin/usb_modeswitch_dispatcher
#
# To enable an option, set it to "1", "yes" or "true" (case doesn't matter)
# Everything else counts as "disable"


# Disable automatic mode switching globally (e.g. to access the original
# install storage)

DisableSwitching=1

# Onda MT8205 LTE

DefaultVendor=0x19d2
DefaultProduct=0x0266

TargetVendor=0x19d2
TargetProduct=0x0265

StandardEject=1

MessageContent="55534243d8a523862400000080000685000000240000000000000000000000"

# Enable logging (results in a extensive report file in /var/log, named
# "usb_modeswitch_<interface-name>" and probably others

EnableLogging=0


# Optional increase of "delay_use" for the usb-storage driver; there are hints
# that a recent kernel default change to 1 sec. may lead to problems, particu-
# larly with USB 3.0 ports. Set this to at least 3 (seconds) in that case.
# Does nothing if the current system value is same or higher

SetStorageDelay=4

----------------usb_modeswitch.conf-----------------------------

----------------wvdial.conf-------------------------------------
[Dialer Defaults]
Auto DNS = yes
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
; Phone = <Target Phone Number>
ISDN = 0
; Password = <Your Password>
New PPPD = yes
; Username = <Your Login Name>
Modem = /dev/ttyUSB2
Baud = 9600

[Dialer ondaTim]
Init1 = ATH
Init2 = ATE1
Init3 = AT+CGDCONT=1,"IP","stringaAPN"
Stupid mode = yes
Phone = *99***1#
Modem = /dev/ttyUSB2
Username = blank
Dial Command = ATD
Password = blank
Baud = 460800
----------------wvdial.conf-------------------------------------

----------------Procedure---------------------------------------
sudo usb_modeswitch -c /etc/usb_modeswitch.conf

verify if in the output of lsusb the product number is in modem mode (my is 0x0265)

sudo modprobe usbserial vendor=0x19d2 product=0x0265

sudo wvdialconf /etc/wvdial.conf

sudo wvdial ondaTim
----------------Procedure---------------------------------------

Can you hemp me to understand what is wrong or what is not present?
TIA

Daniele Disco

unread,
Mar 22, 2017, 3:00:04 PM3/22/17
to
Nobody can help me?

didier gaumet

unread,
Mar 22, 2017, 3:20:05 PM3/22/17
to
I cannot help you with wvdial, I have used this rarely looong ago for
simple dial-up (no 3G/4G).

NetworkManager itself (not its applet) does not depend upon any GUI part
and nmcli (command line) and nmtui (ncurses text interface, roughly
equivalent to nm-applet) are included in the package.
NetworkManager depending on Modemmanager and usb_modeswitch, it would be
easy for you to manage your 3G/4G dongle.

tv.d...@googlemail.com

unread,
Mar 22, 2017, 4:20:04 PM3/22/17
to
Hi, I have a similar installation on a LEDE (ex-OpenWRT) router that
connect through a 3G usb dongle, and I use usb modems on Debian too. On
all systems I have:

> # Disable automatic mode switching globally (e.g. to access the original
> # install storage)
> DisableSwitching=1

set to "0", otherwise switching the usb device from mass storage to
modem hangs more often than not. Any reason why you need "1" here ?

I can't look into the LEDE chat script right now, but will do tomorrow
and report any difference with your setup that strikes me.

Cheers.

David Wright

unread,
Mar 22, 2017, 4:30:05 PM3/22/17
to
Perhaps you should set this to find out what's going on both when
you have success and failure, to see if there's a difference.
IIRC (15 years) wvdial uses ppp. I know that ppp can be made to log
debug information. I can't remember whether wvdial does. (I never
used it but I helped occasionally.) So once again you need to look
at the logs when it works and when it doesn't.

Cheers,
David.
0 new messages