18 мая, 2012

WeTelecom WM-D200 в Linux

Принесли родственники новый модем от MTS с просьбой прикрутить его к Linux. Быстрый поиск в интернете не принес каких-либо историй успеха.


После подключения в системе появляется еще один CDROM, dmesg:

[113380.704214] usb 3-2: new full-speed USB device number 2 using uhci_hcd
[113380.854208] usb 3-2: New USB device found, idVendor=22de, idProduct=6801
[113380.854215] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[113380.854221] usb 3-2: Product: USB MMC Storage
[113380.854226] usb 3-2: Manufacturer: WeTelecom Incorporated
[113380.854230] usb 3-2: SerialNumber: 000000000002
[113380.856458] scsi6 : usb-storage 3-2:1.0
[113381.862256] scsi 6:0:0:0: CD-ROM            We       Telecom CD-ROM   1.00 PQ: 0 ANSI: 2
[113381.876235] sr1: scsi-1 drive
[113381.876500] sr 6:0:0:0: Attached scsi CD-ROM sr1
[113386.109382] sr1: CDROM (ioctl) error, command: Xpwrite, Read disk info 51 00 00 00 00 00 00 00 02 00
[113386.109405] sr: Sense Key : Hardware Error [current] 
[113386.109413] sr: Add. Sense: No additional sense information
[113388.587384] sr1: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
[113388.587407] sr: Sense Key : Hardware Error [current] 
[113388.587415] sr: Add. Sense: No additional sense information
[113396.000231] usb 3-2: USB disconnect, device number 2
[113397.206286] usb 3-2: new full-speed USB device number 3 using uhci_hcd
[113397.352371] usb 3-2: New USB device found, idVendor=22de, idProduct=6801
[113397.352379] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[113397.352384] usb 3-2: Product: WeTelecom Mobile Products
[113397.352389] usb 3-2: Manufacturer: WeTelecom Incorporated
[113397.361638] scsi7 : usb-storage 3-2:1.3
[113398.369455] scsi 7:0:0:0: CD-ROM            We       Telecom CD-ROM   1.00 PQ: 0 ANSI: 2
[113398.376308] sr1: scsi3-mmc drive: 192x/345x dvd-ram cartridge changer
[113398.420326] sr1: CDROM (ioctl) error, command: Spare (out), Mechanism status bd 00 00 00 00 00 00 00 00 08 00 00
[113398.420351] sr: Sense Key : Hardware Error [current] 
[113398.420360] sr: Add. Sense: No additional sense information
[113398.420691] sr 7:0:0:0: Attached scsi CD-ROM sr1
[113398.568431] sr1: CDROM (ioctl) error, command: Xpwrite, Read disk info 51 00 00 00 00 00 00 00 02 00
[113398.568454] sr: Sense Key : Hardware Error [current] 
[113398.568462] sr: Add. Sense: No additional sense information
[113399.048440] sr1: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
[113399.048463] sr: Sense Key : Hardware Error [current] 
[113399.048471] sr: Add. Sense: No additional sense information

lsusb лаконичен до безобразия:

# lsusb
...
Bus 003 Device 003: ID 22de:6801  

usb_modemswitch бессилен перед очередной китайской железкой:

usb_modeswitch -v 22de -p 6801

Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 003 on bus 003 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using first interface: 0x00
Using endpoints 0x02 (out) and 0x82 (in)
Not a storage device, skipping SCSI inquiry

USB description data (for identification)
-------------------------
Manufacturer: WeTelecom Incorporated
     Product: WeTelecom Mobile Products
  Serial No.: not provided
-------------------------
Warning: no switching method given.
-> Run lsusb to note any changes. Bye.

sakis3g отказался инициализировать устройство, сославшись на несоответствие спецификации GSM. Я так понимаю попытка проинициализировать устройство стандартной строкой вернула ошибку.

ModemManager ничего не знает о таких модемах и даже не предпринимает попытку инициализировать зверька.

Но не все так плохо:

modprobe usbserial
modprobe option
echo "22de 6801" > /sys/bus/usb-serial/drivers/option1/new_id

И жизнь начинает налаживаться:

[113812.519886] usbcore: registered new interface driver usbserial
[113812.519920] USB Serial support registered for generic
[113812.520354] usbcore: registered new interface driver usbserial_generic
[113812.520359] usbserial: USB Serial Driver core
[113819.140733] USB Serial support registered for GSM modem (1-port)
[113819.140875] usbcore: registered new interface driver option
[113819.140878] option: v0.7.2:USB Driver for GSM modems
[113853.783119] option 3-2:1.0: GSM modem (1-port) converter detected
[113853.783339] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB0
[113853.783416] option 3-2:1.1: GSM modem (1-port) converter detected
[113853.783550] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB1
[113853.783624] option 3-2:1.2: GSM modem (1-port) converter detected
[113853.783754] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB2

Быстрая проверка - wvdial и kppp чудесно устанавливают соединение с MTS.
Остался последний штрих настройки:

cat /etc/modprobe.d/wetelecom.conf
options usbserial vendor=0x22de product=0x6801

cat /etc/udev/rules.d/wetelecom.rules
SUBSYSTEM=="usb", ATTR{idProduct}=="6801", ATTR{idVendor}=="22de", RUN+="/sbin/modprobe option"

И модем детектируется и работает не хуже популярных AnyData и Huawei.
Отправить комментарий