Web lists-archives.com

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




On Wed 22 Mar 2017 at 02:10:24 (-0700), Daniele Disco wrote:
> 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

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.

> # 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?

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.