11.02.2019

Подключение MTS Connect (он же anydata adu-510a ) к Linux






[ 3252.432029] usb 1-1: new full speed USB device using uhci_hcd and address 6
[ 3252.595198] usb 1-1: New USB device found, idVendor=05c6, idProduct=1000
[ 3252.595207] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3252.595216] usb 1-1: Product: USB MMC Storage
[ 3252.595222] usb 1-1: Manufacturer: AnyDATA Corporation
[ 3252.595229] usb 1-1: SerialNumber: 000000000002
[ 3252.596905] usb 1-1: configuration #1 chosen from 1 choice
[ 3252.603244] scsi5 : SCSI emulation for USB Mass Storage devices
[ 3252.606077] usb-storage: device found at 6
[ 3252.606086] usb-storage: waiting for device to settle before scanning
[ 3257.605634] usb-storage: device scan complete
[ 3257.608602] scsi 5:0:0:0: CD-ROM AnyDATA CD-ROM 1.00 PQ: 0 ANSI: 2
[ 3257.638520] sr1: scsi-1 drive
[ 3257.638885] sr 5:0:0:0: Attached scsi CD-ROM sr1
[ 3257.639102] sr 5:0:0:0: Attached scsi generic sg2 type 5
[ 3282.696074] usb 1-1: USB disconnect, address 6
[ 3283.928030] usb 1-1: new full speed USB device using uhci_hcd and address 7
[ 3284.085547] usb 1-1: New USB device found, idVendor=16d5, idProduct=6502
[ 3284.085557] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3284.085565] usb 1-1: Product: AnyDATA CDMA Products
[ 3284.085572] usb 1-1: Manufacturer: AnyDATA Corporation
[ 3284.087147] usb 1-1: configuration #1 chosen from 1 choice
[ 3284.092733] option 1-1:1.0: GSM modem (1-port) converter detected
[ 3284.093015] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 3284.094780] option 1-1:1.1: GSM modem (1-port) converter detected
[ 3284.095177] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 3284.097805] option 1-1:1.2: GSM modem (1-port) converter detected
[ 3284.098225] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 3284.098742] scsi6 : SCSI emulation for USB Mass Storage devices
[ 3284.104433] usb-storage: device found at 7
[ 3284.104443] usb-storage: waiting for device to settle before scanning
[ 3289.105962] usb-storage: device scan complete
[ 3289.108950] scsi 6:0:0:0: CD-ROM AnyDATA CD-ROM 1.00 PQ: 0 ANSI: 2
[ 3289.122873] sr1: scsi3-mmc drive: 0x/0x caddy
[ 3289.123236] sr 6:0:0:0: Attached scsi CD-ROM sr1
[ 3289.123454] sr 6:0:0:0: Attached scsi generic sg2 type 5
[ 3289.173854] sr1: CDROM (ioctl) error, command: Xpwrite, Read disk info 51 00 00 00 00 00 00 00 02 00
[ 3289.176187] sr: Sense Key : Hardware Error [current]
[ 3289.176198] sr: Add. Sense: No additional sense information
[ 3402.232063] usb 1-1: USB disconnect, address 7
[ 3402.233570] option: option_instat_callback: error -108


ТО все гуд

в /etc/ppp/peers создаем файлик mtsconnect

с содержимым

/dev/ttyUSB0 230400 crtscts modem
noccp novj
connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T '#777'"
noauth user mobile remotename mtsconnect
usepeerdns defaultroute
replacedefaultroute
# debug updetach

Добавить в
/etc/ppp/chap-secrets
mobile mtsconnect internet


в

файлик up_mts.sh

#!/bin/sh
#echo "route -n | egrep ^0.0.0.0 | grep -v ppp | sed s/^[^ ]* *([^ ]*) ../default gw 1/"



foo=$(ps ax)
bar=$(echo $foo | grep "/usr/sbin/pppd")
if [ "$bar" ]; then
echo "pppd USED"
exit 1

else

echo "NOT STARTED"


bar=$(lsusb | grep AnyDATA)
if [ "$bar" ]; then
/usr/sbin/pppd call mtsconnect
echo "starting"
sleep 10
foo=$(ps ax)
bar=$(echo $foo | grep "/usr/sbin/pppd")

if [ "$bar" ]; then

echo "Starting OK"
exit 0
else
echo "NOT STARTING"
exit 1
fi
else
echo "NOT DEVICE FOUND"
exit 1
fi
exit 1
fi




добавляем в кронтаб */1 * * * * /etc/ppp/up_mts.sh > /root/aaa.log
Если хотим чтобы кронтаб молчал то
*/1 * * * * /etc/ppp/up_mts.sh > /dev/null



Есть вариант что модем определится как флешка тогда нада использовать (в дебиане сразу есть такой пакет usb-modeswitch )
usb-modeswitch-1.2.5.tar.bz2
tar -xf usb_modeswitch-0.9.4.tar.bz2
./compile.sh
cp usb_modeswitch /usr/bin/



touch change_modes.sh

Содержимое файла change_modes.sh

#!/bin/bash
/usr/bin/usb_modeswitch -v 05c6 -p 1000 -V 16d5 -P 6502 -m 0x00000008 \
-M 5553424328932a86000000000000061b000000020000000000000000000000

Комментариев нет :

Отправить комментарий