User Tools

Site Tools


Sidebar

Launch of Linino.org

wiki:lininousbmodem

How to configure an USB modem stick on Linino boards

A great number of USB stick modem are now available.

On this tutorial we want to explain the steps you need to configure a 3g connection between your linino board and internet.

Let's start haiving one USB modem stick. For example we are using a Huawey E173

Verify if all the modules we need are installed on our board. Please verify to have:

  • kmod-usb-core
  • kmod-usb-serial
  • kmod-usb2
  • kmod-usb-serial-option
  • kmod-usb-uhci
  • usb-modeswitch
  • usb-modeswitch-data
  • luci-proto-3g
  • ppp
  • comgt
  • chat

Note: the modules in italic are already installed inside the default linino image available here.

If you plug the usb stick modem on the Linino board you should see on dmesg something like this:

[  107.920000] usbcore: registered new interface driver usbserial
[  107.920000] USB Serial support registered for generic
[  107.930000] usbcore: registered new interface driver usbserial_generic
[  107.930000] usbserial: USB Serial Driver core
[  139.960000] USB Serial support registered for GSM modem (1-port)
[  139.960000] usbcore: registered new interface driver option
[  139.960000] option: v0.7.2:USB Driver for GSM modems
[  210.970000] uhci_hcd: USB Universal Host Controller Interface driver
[  416.490000] usb 1-1.1: USB disconnect, device number 4
[  416.500000] sd 2:0:0:0: [sdb] Synchronizing SCSI cache
[  416.500000] sd 2:0:0:0: [sdb]  Result: hostbyte=0x01 driverbyte=0x00
[  430.810000] usb 1-1.1: new high-speed USB device number 5 using ehci-platform
[  431.070000] scsi3 : usb-storage 1-1.1:1.0
[  431.070000] scsi4 : usb-storage 1-1.1:1.1
[  431.590000] usb 1-1.1: USB disconnect, device number 5
[  439.770000] usb 1-1.1: new high-speed USB device number 6 using ehci-platform
[  440.230000] option 1-1.1:1.0: GSM modem (1-port) converter detected
[  440.230000] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[  440.240000] option 1-1.1:1.2: GSM modem (1-port) converter detected
[  440.240000] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[  440.240000] option 1-1.1:1.3: GSM modem (1-port) converter detected
[  440.240000] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[  440.250000] scsi5 : usb-storage 1-1.1:1.4
[  440.250000] scsi6 : usb-storage 1-1.1:1.5
[  441.250000] scsi 5:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[  441.250000] scsi 6:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2

and on usb the releated device

root@linino:/# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 001 Device 003: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Bus 001 Device 004: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader

Add the following configuration inside /etc/config/network

config interface 'wan2'
        option ifname '3g-wan2'
        option proto '3g'
        option service 'umts'
        option apn 'internet.wind'
        option device '/dev/ttyUSB0'

on chat script configuration verify the following settings:

root@linino:/# cat /etc/chatscripts/3g.chat
ABORT   BUSY
ABORT   'NO CARRIER'
ABORT   ERROR
REPORT  CONNECT
TIMEOUT 10
""      "ATZ"
OK      "ATQ0 V1 E1 S0=0 &C1 &D2"
OK      'AT+CGDCONT=1,"IP","$USE_APN"'
SAY     "Calling UMTS/GPRS"
TIMEOUT 30
OK      "ATDT*99***1#"
CONNECT ' '

Verify from the log is the connection goes up without any errors. Use logread command to inspect pppd debug messages:

May 20 22:19:43 linino daemon.notice pppd[12586]: pppd 2.4.5 started by root, uid 0
May 20 22:19:44 linino local2.info chat[12624]: abort on (BUSY)
May 20 22:19:44 linino local2.info chat[12624]: abort on (NO CARRIER)
May 20 22:19:44 linino local2.info chat[12624]: abort on (ERROR)
May 20 22:19:44 linino local2.info chat[12624]: report (CONNECT)
May 20 22:19:44 linino local2.info chat[12624]: timeout set to 10 seconds
May 20 22:19:44 linino local2.info chat[12624]: send (ATZ^M)
May 20 22:19:44 linino local2.info chat[12624]: expect (OK)
May 20 22:19:44 linino local2.info chat[12624]: ATZ^M^M
May 20 22:19:44 linino local2.info chat[12624]: OK
May 20 22:19:44 linino local2.info chat[12624]:  -- got it
May 20 22:19:44 linino local2.info chat[12624]: send (ATQ0 V1 E1 S0=0 &C1 &D2^M)
May 20 22:19:44 linino local2.info chat[12624]: expect (OK)
May 20 22:19:44 linino local2.info chat[12624]: ^M
May 20 22:19:44 linino user.info sysinit: handle umount errors
May 20 22:19:44 linino user.info sysinit: check umount sda
May 20 22:19:44 linino local2.info chat[12624]: ATQ0 V1 E1 S0=0 &C1 &D2^M^M
May 20 22:19:44 linino local2.info chat[12624]: OK
May 20 22:19:45 linino local2.info chat[12624]:  -- got it
May 20 22:19:45 linino local2.info chat[12624]: send (AT+CGDCONT=1,"IP","internet.wind"^M)
May 20 22:19:45 linino local2.info chat[12624]: timeout set to 30 seconds
May 20 22:19:45 linino local2.info chat[12624]: expect (OK)
May 20 22:19:45 linino local2.info chat[12624]: ^M
May 20 22:19:45 linino local2.info chat[12624]: AT+CGDCONT=1,"IP","internet.wind"^M^M
May 20 22:19:45 linino local2.info chat[12624]: OK
May 20 22:19:45 linino local2.info chat[12624]:  -- got it
May 20 22:19:45 linino local2.info chat[12624]: send (ATDT*99***1#^M)
May 20 22:19:45 linino local2.info chat[12624]: expect (CONNECT)
May 20 22:19:45 linino local2.info chat[12624]: ^M
May 20 22:19:45 linino local2.info chat[12624]: ATDT*99***1#^M^M
May 20 22:19:45 linino local2.info chat[12624]: CONNECT
May 20 22:19:45 linino local2.info chat[12624]:  -- got it
May 20 22:19:45 linino local2.info chat[12624]: send ( ^M)
May 20 22:19:45 linino daemon.info pppd[12586]: Serial connection established.
May 20 22:19:45 linino daemon.info pppd[12586]: Using interface 3g-wan2
May 20 22:19:45 linino daemon.notice pppd[12586]: Connect: 3g-wan2 <--> /dev/ttyUSB0
May 20 22:19:47 linino user.info sysinit: handle umount errors
May 20 22:19:47 linino user.info sysinit: check umount sda
May 20 22:19:48 linino daemon.info avahi-daemon[1804]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.240.1.
May 20 22:19:48 linino daemon.info avahi-daemon[1804]: New relevant interface wlan0.IPv4 for mDNS.
May 20 22:19:48 linino daemon.info avahi-daemon[1804]: Registering new address record for 192.168.240.1 on wlan0.IPv4.
May 20 22:19:48 linino daemon.info dnsmasq[1798]: reading /tmp/resolv.conf.auto
May 20 22:19:48 linino daemon.info dnsmasq[1798]: using nameserver 192.168.3.1#53
May 20 22:19:48 linino daemon.info dnsmasq[1798]: using local addresses only for domain lan
May 20 22:19:48 linino daemon.notice netifd: Interface 'lan' is now up
May 20 22:19:48 linino user.notice firewall: Reloading firewall due to ifup of lan (wlan0)
May 20 22:19:49 linino user.info sysinit: handle umount errors
May 20 22:19:49 linino user.info sysinit: check umount sda
May 20 22:19:49 linino daemon.warn pppd[12586]: Could not determine remote IP address: defaulting to 10.64.64.64
May 20 22:19:49 linino daemon.notice pppd[12586]: local  IP address 10.29.209.250
May 20 22:19:49 linino daemon.notice pppd[12586]: remote IP address 10.64.64.64
May 20 22:19:49 linino daemon.notice pppd[12586]: primary   DNS address 193.70.152.25
May 20 22:19:49 linino daemon.notice pppd[12586]: secondary DNS address 212.52.97.25
May 20 22:19:50 linino daemon.notice netifd: Interface 'wan2' is now up

checking th ifconfig command

root@linino:/# ifconfig
3g-wan2   Link encap:Point-to-Point Protocol
          inet addr:10.29.209.250  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:386 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:652 (652.0 B)  TX bytes:15482 (15.1 KiB)
 
eth1      Link encap:Ethernet  HWaddr 90:A2:DA:F8:1D:7E
          inet addr:192.168.3.111  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5927 errors:0 dropped:3 overruns:0 frame:0
          TX packets:6071 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:628269 (613.5 KiB)  TX bytes:1527796 (1.4 MiB)
          Interrupt:4
 
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2864 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2864 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:117072 (114.3 KiB)  TX bytes:117072 (114.3 KiB)
 
wlan0     Link encap:Ethernet  HWaddr 90:A2:DA:F0:1D:7E
          inet addr:192.168.240.1  Bcast:192.168.240.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:371 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:28860 (28.1 KiB)

If you connect to the board through Luci interface you can see the following setting for 3g-wan2 interface.

Now you can use your Linino board with 3G connection also in area where the WiFi is not present.

/var/www/wiki.linino.org/data/pages/wiki/lininousbmodem.txt · Last modified: 2014/05/21 02:33 by administrator

2014 © dog hunter llc and the Linino Community. Linino.org is a dog hunter sponsored community project. Credits