Huawei E220
Questa pagina descrive come abilitare il supporto per Huawei E220 sui sistemi Debian.
Contents
Huawei E220 (chiamato anche vodem) è un modem USB esterno HSDPA a 3.6Mbps.
Kernel
2.6.20
Utenti Etch: il supporto per questo dispositivo non è disponibile nel kernel 2.6.18. Si usi un kernel EtchAndAHalf: apt-cache search linux-image-2.6.24-etchnhalf e installare un paccketto appropriato per il proprio sistema.
- Prima di continuare riavviare con questo kernel.
Nei kernel Linux 2.6.20 e successivi, E220 è supportato nativamente usando il modulo usbserial.ko (interfaccia usbserial generica).
Anche usb_storage.ko riconosce il modem Huawei E220 senza nessun ulteriore provvedimento.
Quel che segue deve essere compilato nel kernel o disponibile come modulo:
CONFIG_PPP CONFIG_PPP_FILTER CONFIG_PPP_ASYNC CONFIG_USB_SERIAL CONFIG_USB_SERIAL_GENERIC CONFIG_USB_SERIAL_OPTION
Dopo aver collegato E220 ad una porta USB si dovrebbero trovare tre device /dev/ttyUSB*, i file di configurazione per pppd e Wvdial sono inclusi più avanti.
Si può ora connettere il modem con:
wvdial hsdpa
Kernel più vecchi (precedenti al 2.6.20)
Ci sono soluzioni alternative per le distribuzioni con kernel meno recenti, ad esempio per il 2.6.18 di Etch:
Dalla versione 2.6.20-rc2-mm1 del kernel incluso nel ramo GIT:
?gregkh-usb-usb-storage-ignore-the-virtual-cd-drive-of-the-huawei-e220-usb-modem.patch
- gregkh-usb-usb-gsm-driver-added-vendorid-and-productid-for-huawei-e220-usb-modem.patch
Si veda anche:
Sui kernel vecchi questa utilità può attivare i device ttyUSBx, vedere anche questo file di testo.
Il Modem
Il dispositivo USB non sembra avere bisogno di alcun driver particolare, quello USB si presenta semplicemente come un device usb-serial, a patto che si dica al kernel di ignorare il device usb-storage che è anche presente, e trattarlo come usb-serial. Ciò può essere complicato, un suggerimento è quello di disabilitare usb_storage, non molto utile se si usano chiavette di memoria USB; una soluzione che funziona è utilizzare il pacchetto usb-modeswitch.
Il dispositivo di memoria USB incorporato ha i driver Windows, molto intelligente in realtà, un dispositivo che porta con sé i propri driver; presumibilmente perché viene visto come archiviazione di massa quando si inserisce, su macchine Windows esegue automaticamente i driver che fanno il resto.
I dispositivi PCMCIA sembrano avere un chip PCMCIA-a-USB, quindi si collegano alla porta USB sul chipe della scheda modem chip; una bella trafila, ma supponendo di avere un chip USB esistente e uno PCMCIA-a-USB, questa è una soluzione semplice ed economica.
Script
Script di avvio con i seguenti comandi (o una variante dello stesss):
modprobe usb-ohci modprobe usb-uhci modprobe usbserial vendor=0x12d1 product=0x1001 modprobe usbserial vendor=0x12d1 product=0x1003 mknod /dev/ttyUSB0 c 188 0 mknod /dev/ttyUSB1 c 188 1 mknod /dev/ttyUSB2 c 188 2
modconf
È possibile usare modconf per caricare il driver ?usbserial con il produttore della scheda e l'id come argomenti (per non usare ogni volta modprobe).
Si possono inoltre utilizzare alcuni degli script disponibili da PHARscape, in particolare relativi all'uso di Wvdial, infine con un semplice link simbolico da ttyUSB0 al modem e wvdial con 'internet' come argomento si avrà la connessione.
Ubuntu
The Huawei E220 can be a USB 'dongle' for HSDPA connection through (for me, anyway) the Vodaphone network.
When inserted into a Ubuntu OS, it is immediately detected as a SCSI/CDROM type bulk storage device, and the files that are used by Windows appear attached to the filesystem similar to any other USB storage device.
Close any window that might be showing you those files. Then unmount the device (eject the CDROM icon you'll find on the desktop created when you inserted the device).
All commands I give here are just the commands - you will likely need to put 'sudo' in front of them so you have the permissions of root to carry them out...
Insert the device and give it a chance to settle down (enjoy watching the lights flash...)
When you insert the device and it gets recognised as a storage device, it will have created /dev/ttyUSB0. You can see that with:
ls -la /dev/ttyU*
You will likely only see one entry: ttyUSB0.
To make the modem work, you must first remove the module that is used for USB storage devices. You can do that with:
rmmod usb-storage
If you are told it is in use, that is an indication you didn't close windows and eject the device first.
This next command may not be absolutely necessary, but it won't hurt anything (heh, heh...):
rmmod usb-serial
You are now going to re-insert that module, but giving the specific details of your modem. First, make sure you have the right details by using:
lsusb
You should see an entry similar to this in the output:
Bus 004 Device 004: ID 12d1:1003
The Bus and/or Device number might be different for you, but the important part is the ID. If yours is not 12d1:1003, you'll need to modify the next command, but I *think* it will be either that or 12d1:1001...
This command will insert the module with the device specific details:
modprobe usbserial vendor=0x12d1 product=0x1003
Now, remove the device, wait a bit for things to settle, and then plug it back in.
I *think* you may now have maybe three entries if you do:
ls -la /dev/ttyU*
Basically, what has been done is that you have removed the initial inclination to treat the device only as a bulk storage (removing the module that handles that). You've also manually caused the recognition of the device (using the modprobe command). So that when you re-plugged it, it should now be able to work with the *modem* part of the device addressing it as /dev/ttyUSB0, rather than that being the bulk storage device.
Use a text editor such as pico to edit or create if necessary the file to handle the dialling configuration. My /etc/wvdial.conf file looks like this:
# wvdial for Vodacom Data. Created by Tazz_tux # Version 1.0 # Change Log: # # Added support for HSDPA. # Added Headers and version control. [Dialer Defaults] Phone = *99***1# Username = username Password = password Stupid Mode = 1 Dial Command = ATDT [Dialer hsdpa] Modem = /dev/ttyUSB0 Baud = 460800 Init2 = ATZ Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ISDN = 0 Modem Type = Analog Modem
I've only put in the relevant sections - the full file can be found at the address below this posting.
You can dial the modem with:
wvdial hsdpa
If all is happy, you'll see the messages in the terminal window to show how it is connecting, your IP address, your remote gateway and 2 nameservers the network provides for you.
Do remember the various need for 'sudo' unless you change ownerships/permissions. In particular, if it looks like you've connected but are not able to connect to any sites, etc, look for a message telling you that /etc/ppp/pap-secrets and /etc/ppp/chap-secrets are not able to be written to - that may well indicate that you for sure need to run the wvdial command as sudo (If you are running it as a normal user, that user would need to have the ability to write to those files for the connection to be able to work...)
See Also
