Uno dei piccoli problemi che ho avuto testando OpenIndiana sul mio portatile è stato l’utilizzo della chiavetta internet E353. Il sistema non la riconosceva come modem e non appariva evidente come configurarla.
Visto che Knoppix non aveva nessun problema a gestire la chiavetta non ho perso le speranze e dopo qualche tentativo sono riuscito a fare funzionare tutto soddisfacentemente.
La Huawei E353 inizialmente si presentava come un cdrom/supporto di memoria di massa e non come modem ed come tale era riconosciuta da OpenIndiana, coem l’output di dmesg mi confermava:
usba: [ID 912658 kern.info] USB 2.0 device (usb12d1,14fe) operating at hi speed (USB 2.x) on USB 2.0 root hub: device@2, usb_mid0 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] usb_mid0 is /pci@0,0/pci103c,30d5@1d,7/device@2
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2 (usb_mid0) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,14fe.config1.0) operating at hi speed (USB 2.x) on USB 2.0 root hub: storage@0, scsa2usb0 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] scsa2usb0 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@0
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@0 (scsa2usb0) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,14fe.config1.1) operating at hi speed (USB 2.x) on USB 2.0 root hub: storage@1, scsa2usb1 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] scsa2usb1 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@1
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@1 (scsa2usb1) online
scsi: [ID 583861 kern.info] sd2 at scsa2usb1: target 0 lun 0
genunix: [ID 936769 kern.info] sd2 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@1/disk@0,0
scsi: [ID 583861 kern.info] sd1 at scsa2usb0: target 0 lun 0
genunix: [ID 936769 kern.info] sd1 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@0/disk@0,0
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@0/disk@0,0 (sd1) online
genunix: [ID 127566 kern.info] device pci8086,27ae@2(display#0) keeps up device sd@0,0(disk#1), but the former is not power managed
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@1/disk@0,0 (sd2) online
genunix: [ID 127566 kern.info] device pci8086,27ae@2(display#0) keeps up device sd@0,0(disk#2), but the former is not power managed
L’output di dmesg mi offiriva due informazioni utili: il vendor id della chiavetta (12d1) e l’id della chiavetta stessa (14fe).
Questa modalità di funzionamento è usata da diversi produttori ed ha effettivamente una certa utilità: la chiavetta inizialmente si presenta come uno flash storage che contiene i driver necessari all’installazione della chiavetta, eliminando la necessità di fornire un qualche supporto per l’installazione dei driver ed eliminando anche la possibilità di perdere detto supporto e ritrovarsi in un loop (per recuperare i driver da internet bisogna poter accedere a internet, per accedere a internet servono i driver)
Installati i driver, questi provvedono a modificare la modalità di funzionamento della chiavetta stessa in modo che si presenti come modem.
Naturalmente, i driver contenuti nella chiavetta sono per sistemi operativi Windows (forse anche per sistemi operativi Apple), ma non per altri sistemi operativi.
Fortunatamente, esiste un programma open source per modificare la modalità di funzionamento di una chiavetta: usb_modeswitch (si può trovare qui).
Il programma richiede libusb nella versione che è inclusa in OpenIndiana.
Ho modificato il sorgente in modo che compili (ed ovviamente funzioni) sotto OpenIndiana: l’operazione si riduce all’aggiunta di una coppia di #ifdef oltre che alle dovute modifiche al Makefile.
Tornando all’output di dmesg, ho noto che il driver assegnato alla chiavetta è usb_mid, driver per dispositivi usb multi-interfaccia. Alle varie interfacce era assegnato il driver scsa2usb. La manpage del driver scsa2usb riporta che il driver supporta un’interfaccia ugen che permetterebbe a libusb di comunicare direttamente al device, ma non ho investigato questa strada.
Dopo aver scollegato smontato e scollegato la chiavetta, ho usato il seguente comando che forza OpenIndiana ad utilizzare ugen come driver per la chiavetta:
update_drv -a -i '"usb12d1,14fe"' ugen
Al successivo inserimento della chiavetta, dmesg mi offriva questo output:
usba: [ID 912658 kern.info] USB 2.0 device (usb12d1,14fe) operating at hi speed (USB 2.x) on USB 2.0 root hub: device@2, ugen0 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] ugen0 is /pci@0,0/pci103c,30d5@1d,7/device@2
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2 (ugen0) online
Esattamente quello che volevo. Il prossimo comando che ho utilizato è stato usb_modeswitch con gli appropriati parametri:
usb_modeswitch -v 0x12d1 -p 0x14fe -M 55534243123456780000000000000011062000000100000000000000000000
L’opzione obbligatoria -v indica il vendor id del device su cui usb_modeswitch andrà ad agire, l’opzione obbligatoria -p indica il product id del device a cui usb_modeswitch manderà il messaggio indicato dall’opzione -M (chiaramente, vendor id, product id e messaggio sono tipicamente diversi per ogni chiavetta).
Per motivi ancora da chiarire, mi sono ritrovato a dover lanciare il comando due volte prima che succeda qualcosa di utile (mea culpa per non avere ancora letto a fondo la documentazione di usb_modeswitch). Comunque, ancora una volta dmesg mi confortava:
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2 (ugen0) removed
usba: [ID 912658 kern.info] USB 2.0 device (usb12d1,1506) operating at hi speed (USB 2.x) on USB 2.0 root hub: device@2, usb_mid0 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] usb_mid0 is /pci@0,0/pci103c,30d5@1d,7/device@2
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2 (usb_mid0) online
usba: [ID 349649 kern.info] usba: no driver found for interface 0 (nodename: 'interface') of HUAWEI Mobile
usba: [ID 349649 kern.info] usba: no driver found for interface 1 (nodename: 'interface') of HUAWEI Mobile
usba: [ID 349649 kern.info] usba: no driver found for interface 2 (nodename: 'interface') of HUAWEI Mobile
usba: [ID 349649 kern.info] usba: no driver found for interface 3 (nodename: 'interface') of HUAWEI Mobile
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.4) operating at hi speed (USB 2.x) on USB 2.0 root hub: storage@4, scsa2usb6 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] scsa2usb6 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@4
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@4 (scsa2usb6) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.5) operating at hi speed (USB 2.x) on USB 2.0 root hub: storage@5, scsa2usb7 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] scsa2usb7 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@5
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@5 (scsa2usb7) online
scsi: [ID 583861 kern.info] sd8 at scsa2usb7: target 0 lun 0
genunix: [ID 936769 kern.info] sd8 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@5/disk@0,0
scsi: [ID 583861 kern.info] sd7 at scsa2usb6: target 0 lun 0
genunix: [ID 936769 kern.info] sd7 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@4/disk@0,0
Adesso la chiavetta era riconosciuta come un device diverso, con stesso vendor id (12d1), ma diverso product id in questo caso 1506.
Purtroppo, la chiavetta non era ancora riconosciuta come un modem. In compenso quattro interfacce siano erano di driver. Smontata e scollegata la chiavetta, ho rimediato a questo fatto, forzando OpenIndiana ad utilizzare il driver usbsacm:
update_drv -a -i '"usbif12d1,1506.config1.0"' usbsacm
update_drv -a -i '"usbif12d1,1506.config1.1"' usbsacm
update_drv -a -i '"usbif12d1,1506.config1.2"' usbsacm
update_drv -a -i '"usbif12d1,1506.config1.3"' usbsacm
Ricollegata la chiavetta e utilizzato nuovamente usb_modeswitch, dmesg mi offriva questo output:
usba: [ID 912658 kern.info] USB 2.0 device (usb12d1,14fe) operating at hi speed (USB 2.x) on USB 2.0 root hub: device@2, ugen0 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] ugen0 is /pci@0,0/pci103c,30d5@1d,7/device@2
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2 (ugen0) online
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2 (ugen0) removed
usba: [ID 912658 kern.info] USB 2.0 device (usb12d1,1506) operating at hi speed (USB 2.x) on USB 2.0 root hub: device@2, usb_mid0 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] usb_mid0 is /pci@0,0/pci103c,30d5@1d,7/device@2
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2 (usb_mid0) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.0) operating at hi speed (USB 2.x) on USB 2.0 root hub: interface@0, usbsacm2 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] usbsacm2 is /pci@0,0/pci103c,30d5@1d,7/device@2/interface@0
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/interface@0 (usbsacm2) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.1) operating at hi speed (USB 2.x) on USB 2.0 root hub: interface@1, usbsacm3 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] usbsacm3 is /pci@0,0/pci103c,30d5@1d,7/device@2/interface@1
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/interface@1 (usbsacm3) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.2) operating at hi speed (USB 2.x) on USB 2.0 root hub: interface@2, usbsacm4 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] usbsacm4 is /pci@0,0/pci103c,30d5@1d,7/device@2/interface@2
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/interface@2 (usbsacm4) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.3) operating at hi speed (USB 2.x) on USB 2.0 root hub: interface@3, usbsacm5 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] usbsacm5 is /pci@0,0/pci103c,30d5@1d,7/device@2/interface@3
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/interface@3 (usbsacm5) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.4) operating at hi speed (USB 2.x) on USB 2.0 root hub: storage@4, scsa2usb6 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] scsa2usb6 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@4
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@4 (scsa2usb6) online
usba: [ID 912658 kern.info] USB 2.0 interface (usbif12d1,1506.config1.5) operating at hi speed (USB 2.x) on USB 2.0 root hub: storage@5, scsa2usb7 at bus address 2
usba: [ID 349649 kern.info] HUAWEI Mobile
genunix: [ID 936769 kern.info] scsa2usb7 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@5
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@5 (scsa2usb7) online
scsi: [ID 583861 kern.info] sd8 at scsa2usb7: target 0 lun 0
genunix: [ID 936769 kern.info] sd8 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@5/disk@0,0
scsi: [ID 583861 kern.info] sd7 at scsa2usb6: target 0 lun 0
genunix: [ID 936769 kern.info] sd7 is /pci@0,0/pci103c,30d5@1d,7/device@2/storage@4/disk@0,0
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@4/disk@0,0 (sd7) online
genunix: [ID 408114 kern.info] /pci@0,0/pci103c,30d5@1d,7/device@2/storage@5/disk@0,0 (sd8) online
genunix: [ID 127566 kern.info] device pci8086,27ae@2(display#0) keeps up device sd@0,0(disk#7), but the former is not power managed
genunix: [ID 127566 kern.info] device pci8086,27ae@2(display#0) keeps up device sd@0,0(disk#8), but the former is not power managed
Esattamente quello che volevo. Ho utilizzato il seguente comando per accertarmi che le cose funzionassero nel modo giusto:
tip /dev/term/0
Nella sessione che avevo appena aperto, al comando AT ho ottenuto in risposta OK: il modem funziona.
Ora dovevo preparare i file appropriati perchè pppd potesse funzionare a dovere. In /etc/ppp/peers e /etc/ppp ho creato i file opportuni.
A questo punto mi sono trovato con un piccolo problema: non riuscivo ad accedere ad internet. La soluzione era disabilitare nwadm:
svcadm disable nwam
A questo punto mi potevo connettere con il comando:
pppd call isp
In /etc/ppp mi sono trovato il file resolv.conf che conterreva i DNS che ottenuti dalla connessione.
Usarli è stato molto semplice:
cp /etc/ppp/resolv.conf /etc/resolv.conf
svcadm restart network/dns/client
A questo punto, il comando
ping www.google.it
mi restituiva l’output:
www.google.it is alive
OpenIndiana è quindi connesso alla rete attraverso la chiavetta usb.
Naturalmente ci sono molte cose ancora da migliorare. Ad esempio lanciare usb_modeswitch all’inserimento della chiavetta e automatizzare le diverse procedure che al momento devono essere eseguite da terminale.
A. Cicuta