USB 3g modem HSDPA

Started by felipegn, October 02, 2014, 09:10:38 PM

Previous topic - Next topic

felipegn

Hi,

I work on connecting my A20-Olinuxino-Micro to internet using a 3G USB HSDPA but it is not working.

Here's the output when I connect the modem to the USB port:

ehci_irq: port change detect
[176430.557706] ehci_irq: port change detect
ehci_irq: port change detect
[176430.781495] ehci_irq: port change detect
The port change to OHCI now!
[176430.840213] The port change to OHCI now!
<6>usb 3-1: new full-speed USB device number 76 using sw-ohci
[176431.142948] usb 3-1: new full-speed USB device number 76 using sw-ohci
====usb_stor_huawei_e220_init===>
[176431.353599] ====usb_stor_huawei_e220_init===>
<6>usb 3-1: USB disconnect, device number 76
[176432.067722] usb 3-1: USB disconnect, device number 76
ehci_irq: port change detect
[176433.066637] ehci_irq: port change detect
ehci_irq: port change detect
[176433.290070] ehci_irq: port change detect
The port change to OHCI now!
[176433.349975] The port change to OHCI now!
<6>usb 3-1: new full-speed USB device number 77 using sw-ohci
[176433.653103] usb 3-1: new full-speed USB device number 77 using sw-ohci
<6>option 3-1:1.0: GSM modem (1-port) converter detected
[176433.850933] option 3-1:1.0: GSM modem (1-port) converter detected
<6>usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
[176433.866553] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
<6>option 3-1:1.1: GSM modem (1-port) converter detected
[176433.885513] option 3-1:1.1: GSM modem (1-port) converter detected
<6>usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1
[176433.899122] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1
<6>option 3-1:1.2: GSM modem (1-port) converter detected
[176433.913882] option 3-1:1.2: GSM modem (1-port) converter detected
<6>usb 3-1: GSM modem (1-port) converter now attached to ttyUSB2
[176433.929724] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB2
====usb_stor_huawei_e220_init===>
[176433.944830] ====usb_stor_huawei_e220_init===>


I tried to install usb-modeswitch and wvdial but it is not working.

Can someone help me, please?

Thank you,

Felipe

MBR

#1
It seems that your modem is corectlly detected and "modeswitched" - you got three serial ports (/dev/ttyUSB[012]) so if it doesn't work, the problem is probably in the wvdial configuration. How does look the /etc/wvdial.conf? Is the modem option set to /dev/ttyUSB[someting]? What does the PPP daemon say during connecting? And did you try to "talk" to the modem with AT commands using Minicom or antoher terminal program?

felipegn

Hi,

My /etc/wvdialconf is exactly like this:

[Dialer Defaults]
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/ttyUSB0
Baud = 9600


It says that the modem option is set to /dev/ttyUSB0. Should I use a phone numer, password and user name?

Looking for the ppp daemon comments, I found nothing when I insert the modem into USB port nor in dmesg:

root@a20-OLinuXino:~/Desktop# dmesg | grep -i ppp
[    1.631607] PPP generic driver version 2.4.2
[    1.639969] PPP BSD Compression module registered
[    1.648702] PPP Deflate Compression module registered
[    1.658673] PPP MPPE Compression module registered


I did not try to "talk" to the modem with AT commands. I will try this Minicom program to see what I get.

Thank you.
8)

MBR

#3
Try starting wvdial manually in a terminal (as root).

And this is my /etc/wvdial.conf as an example, you probably will have to modify the "internet" (name of the ATP, see http://code.peternixon.net/packetdata/wiki/GPRS%20Modem%20Configuration), username and password. And for some modems, you must use the last serial port (in this case, /dev/ttyUSB2).


[Dialer Defaults]
Modem = /dev/ttyUSB0
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","internet"
Stupid Mode = 1
Phone = *99#
ISDN = 0
Username = username
Password = password


PS: If you don't need to use the modem on Windows machines, you can disable the internal flash "CD-ROM" drive (and/or SD-card reader) and skip modeswitching, saving some time during the init, see https://wiki.archlinux.org/index.php/Huawei_E1550_3G_modem#AT_commands.

MBR

Also, look at this page http://whirlpool.net.au/wiki/mobiles_mobileasmodem_dun how to get CID profiles (used in the AT+CGDCONT AT command), but skip all the Windows stuff and just use minicom.

felipegn

I try to use wvdial and sometime it says:
NO CARRIER
--> No Carrier!  Trying again.
--> Sending: ATDT*99#
--> Waiting for carrier.


Other times I get it right:
wvdial Vivo
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
N?
+CPIN:READY
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Sending: AT+CGDCONT=1,"IP","zap.vivo.com.br"
AT+CGDCONT=1,"IP","zap.vivo.com.br"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
AT+CPIN?
+CPIN:READY
OK
<3>option: option_instat_callback: error -62
[425128.896916] option: option_instat_callback: error -62
<6>usb 5-1: USB disconnect, device number 5
[425128.935010] usb 5-1: USB disconnect, device number 5
<3>option: option_instat_callback: error -108
[425128.944983] option: option_instat_callback: error -108
--> Disconnecting at Tue Oct  7 16:49:51 2014


I feel that my Onlinuxino keeps disconnecting and reconnecting my 3G modem.
<3>option: option_instat_callback: error -62
[425393.504910] option: option_instat_callback: error -62
<6>usb 5-1: USB disconnect, device number 21
[425393.530873] usb 5-1: USB disconnect, device number 21
<3>option: option_instat_callback: error -108
[425393.549990] option: option_instat_callback: error -108
<6>option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[425393.563186] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
<6>option 5-1:1.0: device disconnected
[425393.575919] option 5-1:1.0: device disconnected
<6>option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[425393.589596] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
<6>option 5-1:1.1: device disconnected
[425393.602376] option 5-1:1.1: device disconnected
<6>option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[425393.617941] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
<6>option 5-1:1.2: device disconnected
[425393.630500] option 5-1:1.2: device disconnected

root@a20-OLinuXino:~/Desktop#
root@a20-OLinuXino:~/Desktop# ehci_irq: port change detect
[425397.968327] ehci_irq: port change detect
ehci_irq: port change detect
[425398.189865] ehci_irq: port change detect
The port change to OHCI now!
[425398.249922] The port change to OHCI now!
<6>usb 5-1: new full-speed USB device number 22 using sw-ohci
[425398.552719] usb 5-1: new full-speed USB device number 22 using sw-ohci
====usb_stor_huawei_e220_init===>
[425398.743576] ====usb_stor_huawei_e220_init===>
<6>usb 5-1: USB disconnect, device number 22
[425399.380513] usb 5-1: USB disconnect, device number 22

root@a20-OLinuXino:~/Desktop# ehci_irq: port change detect
[425400.379414] ehci_irq: port change detect
ehci_irq: port change detect
[425400.599735] ehci_irq: port change detect
The port change to OHCI now!
[425400.659765] The port change to OHCI now!
<6>usb 5-1: new full-speed USB device number 23 using sw-ohci
[425400.962586] usb 5-1: new full-speed USB device number 23 using sw-ohci
<6>option 5-1:1.0: GSM modem (1-port) converter detected
[425401.157490] option 5-1:1.0: GSM modem (1-port) converter detected
<6>usb 5-1: GSM modem (1-port) converter now attached to ttyUSB0
[425401.170312] usb 5-1: GSM modem (1-port) converter now attached to ttyUSB0
<6>option 5-1:1.1: GSM modem (1-port) converter detected
[425401.184503] option 5-1:1.1: GSM modem (1-port) converter detected
<6>usb 5-1: GSM modem (1-port) converter now attached to ttyUSB1
[425401.197285] usb 5-1: GSM modem (1-port) converter now attached to ttyUSB1
<6>option 5-1:1.2: GSM modem (1-port) converter detected
[425401.211570] option 5-1:1.2: GSM modem (1-port) converter detected
<6>usb 5-1: GSM modem (1-port) converter now attached to ttyUSB2
[425401.224641] usb 5-1: GSM modem (1-port) converter now attached to ttyUSB2
====usb_stor_huawei_e220_init===>
[425401.236589] ====usb_stor_huawei_e220_init===>


And I don't need to use it on Windows machines so I'll work on that.

Thank you MBR.

felipegn

I can detect it with lsusb -v:
Bus 003 Device 032: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x1001 E169/E620/E800 HSDPA Modem
  bcdDevice            0.00
  iManufacturer           1 Qualcomm, Incorporated
  iProduct                2 Qualcomm CDMA Technologies MSM
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          108
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             128
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            3.04
  iManufacturer           3 Linux 3.4.67+ sw_hcd-hcd
  iProduct                2 sw_hcd host driver
  iSerial                 1 sw_hcd_host0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x0011
    Per-port power switching
    No overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood        5 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x02
  PortPwrCtrlMask    0xff
Hub Port Status:
   Port 1: 0000.0100 power
Device Status:     0x0001
  Self Powered

felipegn

I changed the modem and I got wvdial to work:


--> Initializing modem.
--> Sending: ATZ
AT+CPIN?
+CPIN: READY
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT 115200
--> Carrier detected.  Waiting for prompt.
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Wed Oct  8 12:48:44 2014
--> Pid of pppd: 4528
--> Using interface ppp0
--> pppd: �8�[01]`4�[01]
--> pppd: �8�[01]`4�[01]
--> pppd: �8�[01]`4�[01]
--> pppd: �8�[01]`4�[01]
--> pppd: �8�[01]`4�[01]
--> pppd: �8�[01]`4�[01]
--> Disconnecting at Wed Oct  8 12:49:20 2014
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds


But I can't connect to the internet yet.

felipegn

Ok, now I can access the internet. Thank you very much MBR for your help.

The problem was the 3G signal. I changed place and now I can access the internet.

I only have to say that I used 2 modems:
- 3G HSDPA modem from Olimex (https://www.olimex.com/Products/USB-Modules/MOD-USB3G/)
- 3G TP-LINK modem (http://76.my/Malaysia/tp-link-ma180-3g-3-75g-usb-broadband-modem-digi-maxis-celcom-umobile-ookas-1206-27-ookas@1.jpg)

For the first one I couldn't access the internet. I don't know why but my Onlinuxino gets very hot and it stops working. It happenned like four times. I would like to ask for the /etc/wvdial.conf file of someone that could make it work with this 3G modem.

The second modem I could access internet.

Thank you.