Difference between revisions of "Huawei E173s"

From ArchWiki
Jump to: navigation, search
Line 5: Line 5:
  
 
== Check modem ==
 
== Check modem ==
Plug in the modem and install usbutils (base):
+
Install usbutils (base) if not installed:
 
  pacman -Sy usbutils
 
  pacman -Sy usbutils
Run lsusb:
+
Plug in the modem and run lsusb:
 
  lsusb | grep Huawei
 
  lsusb | grep Huawei
 
The output should be something like this:
 
The output should be something like this:
Line 13: Line 13:
 
The ID 12d1:1c0b refers to vendor id and product id. If you get different values, it means your modem is not Huawei E173s (of course, you can always open the USB stick to double check).
 
The ID 12d1:1c0b refers to vendor id and product id. If you get different values, it means your modem is not Huawei E173s (of course, you can always open the USB stick to double check).
 
== Set up usb_modeswitch ==
 
== Set up usb_modeswitch ==
Install usb_modeswitch (community):
+
Install usb_modeswitch (community) if not installed:
 
  pacman -Sy usb_modeswitch
 
  pacman -Sy usb_modeswitch
 
Create a configuration file for your modem:  
 
Create a configuration file for your modem:  
 
  nano /etc/usb_modeswitch.d/12d1:1c0b
 
  nano /etc/usb_modeswitch.d/12d1:1c0b
Paste the following:
+
Add the following lines:
 
  DefaultVendor=0x12d1  
 
  DefaultVendor=0x12d1  
 
  DefaultProduct=0x1c0b  
 
  DefaultProduct=0x1c0b  
Line 25: Line 25:
 
  MessageEndpoint=0x0f  
 
  MessageEndpoint=0x0f  
 
  MessageContent="55534243123456780000000000000011062000000100000000000000000000"
 
  MessageContent="55534243123456780000000000000011062000000100000000000000000000"
Save it (Ctrl+X).
+
At this point if you remove your modem and re-insert it it should switch to modem mode automatically or just use the following line to do it manually:
At this point you can either remove your modem and re-insert it for it to be switched to modem mode automatically or use the following line to do it manually:
+
 
  usb_modeswitch -c /etc/usb_modeswitch.d/12d1:1c0b
 
  usb_modeswitch -c /etc/usb_modeswitch.d/12d1:1c0b
 
== Check if the modem is switched ==
 
== Check if the modem is switched ==
Line 43: Line 42:
 
Run sakis3g:
 
Run sakis3g:
 
  sakis3g --interactive
 
  sakis3g --interactive
You will have to provide APN, username and password, assuming everything goes right you should be connected by now.
+
You will have to provide your APN, username and password, assuming everything goes right you should be connected by now.
== Connect at system startup with sakis3g ==
+
== Connect at system startup==
 
First you need to create a configuration file:
 
First you need to create a configuration file:
 
  nano /etc/sakis3g.conf
 
  nano /etc/sakis3g.conf
This is how my configuration file looks like, it will work if you are using T-Mobile in the UK (the first 4 lines should probably be left as is):
+
Add the following lines (CUSTOM_APN, APN_USER and APN_PASS refer to your APN, username and password respectively, you may have to adjust them):
 
  OTHER="USBMODEM"
 
  OTHER="USBMODEM"
 
  USBMODEM=12d1:1c05
 
  USBMODEM=12d1:1c05
Line 55: Line 54:
 
  APN_USER="t-mobile"
 
  APN_USER="t-mobile"
 
  APN_PASS="tm"
 
  APN_PASS="tm"
Save it (Ctrl+X) and now you are almost finished. What you need to do is to run sakis3g connect at system startup. For some reason putting it in /etc/rc.local does not work so a good option if you are using X but not using a login manager like GDM is to put it in your .xinitrc:
+
What you need to do is to run sakis3g connect at system startup. The easiest way to do this is to add these lines to /etc/rc.local:
 +
sakis3g connect --console
 +
sleep 3
 +
The second line gives you time to examine the output of sakis3g at system startup to see if everything is working as it should, if it is, you can just remove it later. Another option, if you are using X but not using a login manager like GDM, is to put it in your .xinitrc (see the first line):
 
  sudo sakis3g connect &
 
  sudo sakis3g connect &
 
  exec openbox
 
  exec openbox
For this you first need to edit /etc/sudoers and add the following line:
+
For this to work you need to the following line to /etc/sudoers:
  username ALL=(ALL) NOPASSWD:/usr/bin/sakis3g
+
  <username> ALL=(ALL) NOPASSWD:/usr/bin/sakis3g
Replace username with your username.
+
Replace <username> with your username.

Revision as of 11:32, 3 May 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

This page describes how to set up Huawei E173s 3G USB modem on Arch Linux.

Check modem

Install usbutils (base) if not installed:

pacman -Sy usbutils

Plug in the modem and run lsusb:

lsusb | grep Huawei

The output should be something like this:

Bus 003 Device 003: ID 12d1:1c0b Huawei Technologies Co., Ltd.

The ID 12d1:1c0b refers to vendor id and product id. If you get different values, it means your modem is not Huawei E173s (of course, you can always open the USB stick to double check).

Set up usb_modeswitch

Install usb_modeswitch (community) if not installed:

pacman -Sy usb_modeswitch

Create a configuration file for your modem:

nano /etc/usb_modeswitch.d/12d1:1c0b

Add the following lines:

DefaultVendor=0x12d1 
DefaultProduct=0x1c0b 
TargetVendor=0x12d1 
TargetProduct=0x1c05 
CheckSuccess=20 
MessageEndpoint=0x0f 
MessageContent="55534243123456780000000000000011062000000100000000000000000000"

At this point if you remove your modem and re-insert it it should switch to modem mode automatically or just use the following line to do it manually:

usb_modeswitch -c /etc/usb_modeswitch.d/12d1:1c0b

Check if the modem is switched

lsusb | grep Huawei

The output should be something like this:

Bus 003 Device 003: ID 12d1:1c05 Huawei Technologies Co., Ltd.

Note that the product ID has changed from 1c0b to 1c05. It means that the USB stick can now be used as a modem. Also note that it can take some time (probably not more than 15 seconds) for the modem to switch if you removed and re-inserted it instead of running usb_modeswitch manually.

Connecting

The easiest way to connect is with sakis3g. Install ppp (base) and net-tools (core) if not installed:

pacman -Sy ppp net-tools

Download and install sakis3g from [1]:

wget http://www.sakis3g.org/versions/latest/i386/sakis3g.gz
gunzip sakis3gz
mv sakis3g /usr/bin

Run sakis3g:

sakis3g --interactive

You will have to provide your APN, username and password, assuming everything goes right you should be connected by now.

Connect at system startup

First you need to create a configuration file:

nano /etc/sakis3g.conf

Add the following lines (CUSTOM_APN, APN_USER and APN_PASS refer to your APN, username and password respectively, you may have to adjust them):

OTHER="USBMODEM"
USBMODEM=12d1:1c05
USBDRIVER="option"
APN="CUSTOM_APN"
CUSTOM_APN="general.t-mobile.uk"
APN_USER="t-mobile"
APN_PASS="tm"

What you need to do is to run sakis3g connect at system startup. The easiest way to do this is to add these lines to /etc/rc.local:

sakis3g connect --console
sleep 3

The second line gives you time to examine the output of sakis3g at system startup to see if everything is working as it should, if it is, you can just remove it later. Another option, if you are using X but not using a login manager like GDM, is to put it in your .xinitrc (see the first line):

sudo sakis3g connect &
exec openbox

For this to work you need to the following line to /etc/sudoers:

<username> ALL=(ALL) NOPASSWD:/usr/bin/sakis3g

Replace <username> with your username.