Jump to content

Recommended Posts

Posted (edited)

Hi,

I am using a TP-Link MA180 3g dongle.

The device reference from the usb mode switch device reference file in the Wiki:
"########################################################

# TP-Link MA180
#
# Contributor: complexgeek

DefaultVendor= 0x2357
DefaultProduct=0x0200

TargetVendor= 0x2357
TargetProduct= 0x0201

MessageContent="5553424312345678000000000000061b000000020000000000000000000000"

"

The custom part I added to the 3g connection script in the pineapple interface:

"case "$MODEM" in

*2357:0200*) echo "TPLINK MA-180 (Golan) 200 detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=umts
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.apn=internet.golantelecom.net.il
uci set network.wan2.username=
uci set network.wan2.password=
uci set network.wan2.defaultroute=1
uci commit network
usb_modeswitch -v 2357 -p 0200 -V 2357 -P 0200 -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x2357 product=0x0200
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT
;;
*2357:0201*) echo "TPLINK MA-180 (Golan) 201 detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=umts
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.apn=internet.golantelecom.net.il
uci set network.wan2.username=
uci set network.wan2.password=
uci set network.wan2.defaultroute=1
uci commit network
usb_modeswitch -v 2357 -p 0201 -V 2357 -P 0201 -M 5553424312345678000000000000061b000000020000000000000000000000-n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x2357 product=0x0201
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT
;;"
This is /etc/chatscripts/3g.chat:
"
ABORT BUSY
ABORT 'NO CARRIER'
ABORT ERROR
REPORT CONNECT
TIMEOUT 10
"" "AT&F"
OK "ATE1"
OK 'AT+CGDCONT=1,"IP","$USE_APN"'
SAY "Calling UMTS/GPRS"
TIMEOUT 30
OK "ATD*99***1#"
CONNECT ' '
"
And lastly here is the interesting part of /etc/config/network:
config interface 'wan2'
option ifname 'ppp0'
option proto '3g'
option service 'umts'
option device '/dev/ttyUSB0'
option apn 'internet.golantelecom.net.il'
option defaultroute '1'

The dongle seems to do a modechange as in the 3G page it changes from Bus 001 Device 003: ID 2357:0200 to Bus 001 Device 003: ID 2357:0201

also the log file shows at startup:

00:00:43 Pineapple user.notice usb-modeswitch: 1-1:1.0: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
00:00:42 Pineapple user.notice usb-modeswitch: 1-0:1.0: Manufacturer=Linux_3.3.8_ehci_hcd Product=Generic_Platform_EHCI_Controller Serial=ehci-platform

And the lsusb -v looks like this:

"

Bus 001 Device 003: ID 2357:0201
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x2357
idProduct 0x0201
bcdDevice 0.00
iManufacturer 3 TP-LINK, Incorporated
iProduct 2 TP-LINK HSUPA Modem
iSerial 4 863077010746372
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 138
bNumInterfaces 5
bConfigurationValue 1
iConfiguration 1 TP-LINK Configuration
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk-Only
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 4
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86 EP 6 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x87 EP 7 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x05 EP 5 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
"

and here is how the log looks after running the script:

"

00:13:45 Pineapple daemon.notice netifd: Interface 'wan2' is now down
00:13:45 Pineapple daemon.info pppd[3298]: Exit.
00:13:44 Pineapple local2.info chat[3306]: alarm
00:13:44 Pineapple local2.info chat[3306]: Failed
00:13:44 Pineapple daemon.err pppd[3298]: Connect script failed
00:13:34 Pineapple local2.info chat[3306]: timeout set to 10 seconds
00:13:34 Pineapple local2.info chat[3306]: send (AT&F^M)
00:13:34 Pineapple local2.info chat[3306]: report (CONNECT)
00:13:34 Pineapple local2.info chat[3306]: expect (OK)
00:13:34 Pineapple local2.info chat[3306]: abort on (NO CARRIER)
00:13:34 Pineapple local2.info chat[3306]: abort on (ERROR)
00:13:34 Pineapple local2.info chat[3306]: abort on (BUSY)
00:13:33 Pineapple daemon.notice pppd[3298]: pppd 2.4.5 started by root, uid 0
00:13:33 Pineapple daemon.info dnsmasq[1593]: using nameserver 8.8.8.8#53
00:13:33 Pineapple daemon.info dnsmasq[1593]: using local addresses only for domain lan
00:13:33 Pineapple daemon.info dnsmasq[1593]: reading /tmp/resolv.conf.auto
00:13:31 Pineapple daemon.notice netifd: Interface 'wan2' is now down
00:13:31 Pineapple daemon.info pppd[3168]: Exit.
00:13:30 Pineapple local2.info chat[3173]: alarm
00:13:30 Pineapple local2.info chat[3173]: Failed
00:13:30 Pineapple daemon.err pppd[3168]: Connect script failed
00:13:20 Pineapple local2.info chat[3173]: timeout set to 10 seconds
00:13:20 Pineapple local2.info chat[3173]: send (AT&F^M)
00:13:20 Pineapple local2.info chat[3173]: report (CONNECT)
00:13:20 Pineapple local2.info chat[3173]: expect (OK)
00:13:20 Pineapple local2.info chat[3173]: abort on (NO CARRIER)
00:13:20 Pineapple local2.info chat[3173]: abort on (ERROR)
00:13:20 Pineapple local2.info chat[3173]: abort on (BUSY)
00:13:19 Pineapple daemon.notice pppd[3168]: pppd 2.4.5 started by root, uid 0
00:13:19 Pineapple daemon.info dnsmasq[1593]: using nameserver 8.8.8.8#53
00:13:19 Pineapple daemon.info dnsmasq[1593]: using local addresses only for domain lan
00:13:19 Pineapple daemon.info dnsmasq[1593]: reading /tmp/resolv.conf.auto
00:13:17 Pineapple daemon.notice netifd: Interface 'wan2' is now down
00:13:17 Pineapple daemon.info pppd[3111]: Exit.
00:13:16 Pineapple local2.info chat[3115]: alarm
00:13:16 Pineapple local2.info chat[3115]: Failed
00:13:16 Pineapple daemon.err pppd[3111]: Connect script failed
00:13:06 Pineapple local2.info chat[3115]: timeout set to 10 seconds
00:13:06 Pineapple local2.info chat[3115]: send (AT&F^M)
00:13:06 Pineapple local2.info chat[3115]: report (CONNECT)
00:13:06 Pineapple local2.info chat[3115]: expect (OK)
00:13:06 Pineapple local2.info chat[3115]: abort on (NO CARRIER)
00:13:06 Pineapple local2.info chat[3115]: abort on (ERROR)
00:13:06 Pineapple local2.info chat[3115]: abort on (BUSY)
00:13:05 Pineapple daemon.notice pppd[3111]: pppd 2.4.5 started by root, uid 0
00:13:05 Pineapple daemon.info dnsmasq[1593]: using nameserver 8.8.8.8#53
00:13:05 Pineapple daemon.info dnsmasq[1593]: using local addresses only for domain lan
00:13:05 Pineapple daemon.info dnsmasq[1593]: reading /tmp/resolv.conf.auto
00:13:03 Pineapple daemon.notice netifd: Interface 'wan2' is now down
00:13:03 Pineapple daemon.info pppd[2981]: Exit.
00:13:02 Pineapple local2.info chat[2995]: alarm
00:13:02 Pineapple local2.info chat[2995]: Failed
00:13:02 Pineapple daemon.err pppd[2981]: Connect script failed
00:12:52 Pineapple local2.info chat[2995]: timeout set to 10 seconds
00:12:52 Pineapple local2.info chat[2995]: send (AT&F^M)
00:12:52 Pineapple local2.info chat[2995]: report (CONNECT)
00:12:52 Pineapple local2.info chat[2995]: expect (OK)
00:12:52 Pineapple local2.info chat[2995]: abort on (NO CARRIER)
00:12:52 Pineapple local2.info chat[2995]: abort on (ERROR)
00:12:52 Pineapple local2.info chat[2995]: abort on (BUSY)
00:12:51 Pineapple daemon.notice pppd[2981]: pppd 2.4.5 started by root, uid 0
00:12:51 Pineapple daemon.info dnsmasq[1593]: using nameserver 8.8.8.8#53
00:12:51 Pineapple daemon.info dnsmasq[1593]: using local addresses only for domain lan
00:12:51 Pineapple daemon.info dnsmasq[1593]: reading /tmp/resolv.conf.auto
00:12:49 Pineapple daemon.notice netifd: Interface 'wan2' is now down
00:12:49 Pineapple daemon.info pppd[2855]: Exit.
00:12:48 Pineapple local2.info chat[2859]: alarm
00:12:48 Pineapple local2.info chat[2859]: Failed
00:12:48 Pineapple daemon.err pppd[2855]: Connect script failed
00:12:38 Pineapple local2.info chat[2859]: expect (OK)
00:12:37 Pineapple local2.info chat[2859]: timeout set to 10 seconds
00:12:37 Pineapple local2.info chat[2859]: send (AT&F^M)
00:12:37 Pineapple local2.info chat[2859]: report (CONNECT)
00:12:37 Pineapple local2.info chat[2859]: abort on (NO CARRIER)
00:12:37 Pineapple local2.info chat[2859]: abort on (ERROR)
00:12:37 Pineapple local2.info chat[2859]: abort on (BUSY)
00:12:36 Pineapple daemon.notice pppd[2855]: pppd 2.4.5 started by root, uid 0
00:12:36 Pineapple daemon.info dnsmasq[1593]: using nameserver 8.8.8.8#53
00:12:36 Pineapple daemon.info dnsmasq[1593]: using local addresses only for domain lan
00:12:36 Pineapple daemon.info dnsmasq[1593]: reading /tmp/resolv.conf.auto
00:12:35 Pineapple daemon.notice netifd: Interface 'wan2' is now down
00:12:34 Pineapple daemon.info pppd[2746]: Exit.
00:12:33 Pineapple local2.info chat[2762]: alarm
00:12:33 Pineapple local2.info chat[2762]: Failed
00:12:33 Pineapple daemon.err pppd[2746]: Connect script failed
00:12:23 Pineapple local2.info chat[2762]: timeout set to 10 seconds
00:12:23 Pineapple local2.info chat[2762]: send (AT&F^M)
00:12:23 Pineapple local2.info chat[2762]: report (CONNECT)
00:12:23 Pineapple local2.info chat[2762]: expect (OK)
00:12:23 Pineapple local2.info chat[2762]: abort on (NO CARRIER)
00:12:23 Pineapple local2.info chat[2762]: abort on (ERROR)
00:12:23 Pineapple local2.info chat[2762]: abort on (BUSY)
00:12:22 Pineapple daemon.notice pppd[2746]: pppd 2.4.5 started by root, uid 0
00:12:22 Pineapple daemon.info dnsmasq[1593]: using nameserver 8.8.8.8#53
00:12:22 Pineapple daemon.info dnsmasq[1593]: using local addresses only for domain lan
00:12:22 Pineapple daemon.info dnsmasq[1593]: reading /tmp/resolv.conf.auto
00:12:21 Pineapple daemon.notice netifd: Interface 'wan2' is now down
00:12:20 Pineapple daemon.info pppd[2589]: Exit.
00:12:19 Pineapple local2.info chat[2594]: alarm
00:12:19 Pineapple local2.info chat[2594]: Failed
00:12:19 Pineapple daemon.err pppd[2589]: Connect script failed
00:12:10 Pineapple user.notice root: 3G: firewall stopped
00:12:09 Pineapple local2.info chat[2594]: timeout set to 10 seconds
00:12:09 Pineapple local2.info chat[2594]: send (AT&F^M)
00:12:09 Pineapple local2.info chat[2594]: report (CONNECT)
00:12:09 Pineapple local2.info chat[2594]: expect (OK)
00:12:09 Pineapple local2.info chat[2594]: abort on (NO CARRIER)
00:12:09 Pineapple local2.info chat[2594]: abort on (ERROR)
00:12:09 Pineapple local2.info chat[2594]: abort on (BUSY)
00:12:08 Pineapple daemon.notice pppd[2589]: pppd 2.4.5 started by root, uid 0
00:12:05 Pineapple kern.info kernel: [ 254.410000] usbcore: registered new interface driver usbserial_generic
00:12:05 Pineapple kern.info kernel: [ 254.400000] usbserial_generic 1-1:1.4: generic converter detected
00:12:05 Pineapple kern.info kernel: [ 254.400000] usb 1-1: generic converter now attached to ttyUSB3
00:12:05 Pineapple kern.info kernel: [ 254.390000] usbserial_generic 1-1:1.3: generic converter detected
00:12:05 Pineapple kern.info kernel: [ 254.390000] usb 1-1: generic converter now attached to ttyUSB2
00:12:05 Pineapple kern.info kernel: [ 254.380000] usb 1-1: generic converter now attached to ttyUSB1
00:12:05 Pineapple kern.info kernel: [ 254.370000] usbserial_generic 1-1:1.1: generic converter detected
00:12:05 Pineapple kern.info kernel: [ 254.370000] usb 1-1: generic converter now attached to ttyUSB0
00:12:05 Pineapple kern.info kernel: [ 254.360000] usbserial_generic 1-1:1.0: generic converter detected
00:12:05 Pineapple kern.info kernel: [ 254.360000] USB Serial support registered for generic
00:12:05 Pineapple kern.info kernel: [ 254.350000] usbcore: registered new interface driver usbserial
00:12:02 Pineapple kern.info kernel: [ 251.320000] usbcore: deregistering interface driver usbserial
00:12:02 Pineapple kern.info kernel: [ 251.310000] usbcore: deregistering interface driver usbserial_generic
00:12:02 Pineapple kern.info kernel: [ 251.310000] USB Serial deregistering driver generic
00:11:25 Pineapple user.notice root: 3G: Connection Script here, searching for modems"

"

Please help me out :)

I will donate to whoever can help me make it work!

Thank you for your precious help

Edited by ronny
Spoiler Tags
Posted

This config should work :

#!/bin/sh
# ---------------------------------------------------------
# 3G Connection Script for WiFi Pineapple. "Does the thing"
#
# Version: 2012-02-17
# Supports:
#
# ZTE MF591 (T-Mobile) -dkitchen
# Novatel MC760 (Virgin) -dkitchen
# Novatel MC760 (Ting) -dkitchen
# Sierra 598u (Ting) -brianzimm
# And more.
#
# Updates: wifipineapple.com
# ---------------------------------------------------------


# -----------------------------------------------------------
# Configure /etc/ppp/options with hard-coded working settings
# -----------------------------------------------------------
echo "
logfile /dev/null
noaccomp
nopcomp
nocrtscts
lock
maxfail 0" > /etc/ppp/options

# --------------------------------------------------------------------------------------------------
# Check for known usb modem vendor and product IDs then switch 'em from storage to serial modem mode
# --------------------------------------------------------------------------------------------------
echo "Searching for attached 3G Modems"
logger "3G: Connection Script here, searching for modems"
MODEM=$(lsusb | awk '{ print $6 }')
echo $MODEM

case "$MODEM" in

*2357:0200*) echo "TP-Link MA180 Found, Switching."
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=umts
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.apn=internet.golantelecom.net.il
uci set network.wan2.username=
uci set network.wan2.password=
uci set network.wan2.defaultroute=1
uci commit network
usb_modeswitch -v 2357 -p 0200 -V 2357 -P 0201 -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x2357 product=0x0200
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

;;

*19d2:1523*) echo "ZTE MF591 (T-Mobile) detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=umts
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.apn=epc.tmobile.com
uci set network.wan2.username=internet
uci set network.wan2.password=internet
uci set network.wan2.defaultroute=1
uci commit network
usb_modeswitch -v 19d2 -p 1523 -V 19d2 -P 1525 -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x19d2 product=0x1525
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

;;
*1410:6002* | *1410:5031*) echo "Novatel MC760 (Virgin Mobile) detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=cdma
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.username=internet
uci set network.wan2.password=internet
uci set network.wan2.defaultroute=1
uci set network.wan2.ppp_redial=persist
uci set network.wan2.peerdns=0
uci set network.wan2.dns=8.8.8.8
uci set network.wan2.keepalive=1
uci set network.wan2.pppd_options=debug
uci set network.wan2.pppd_options=noauth
uci commit network
usb_modeswitch -v 1410 -p 5031 -V 1410 -P 6002 -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x1410 product=0x6002
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

;;
*1410:5030*) echo "Novatel MC760 (Ting) detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=cdma
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.username=internet
uci set network.wan2.password=internet
uci set network.wan2.defaultroute=1
uci set network.wan2.ppp_redial=persist
uci set network.wan2.peerdns=0
uci set network.wan2.dns=8.8.8.8
uci set network.wan2.keepalive=1
uci set network.wan2.pppd_options=debug
uci set network.wan2.pppd_options=noauth
uci commit network
usb_modeswitch -v 1410 -p 5030 -V 1410 -P 6000 -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x1410 product=0x6000
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

;;
*1199:0025*) echo "Sierra 598u (Ting) detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=cdma
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.username=internet
uci set network.wan2.password=internet
uci set network.wan2.defaultroute=1
uci set network.wan2.ppp_redial=persist
uci set network.wan2.peerdns=0
uci set network.wan2.dns=8.8.8.8
uci set network.wan2.keepalive=1
uci set network.wan2.pppd_options=debug
uci set network.wan2.pppd_options=noauth
uci commit network
usb_modeswitch -v 1199 -p 0025
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x1199 product=0x0025
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

;;
*12d1:1436*) echo "Huawei E173 detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=umts
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.apn=apn
uci set network.wan2.username=username
uci set network.wan2.password=password
uci set network.wan2.defaultroute=1
uci commit network
usb_modeswitch -v 12d1 -p 1436
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x12d1 product=0x1436
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

;;
*12d1:140c*) echo "Huawei Modem (3-IRL) detected. Attempting mode switch"
uci delete network.wan2
uci set network.wan2=interface
uci set network.wan2.ifname=ppp0
uci set network.wan2.proto=3g
uci set network.wan2.service=umts
uci set network.wan2.device=/dev/ttyUSB0
uci set network.wan2.apn=3internet
uci set network.wan2.username=
uci set network.wan2.password=
uci set network.wan2.defaultroute=1
uci commit network
usb_modeswitch -v 12d1 -p 140c -V 12d1 -P 140c -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x12d1 product=0x140c
sleep 5; /etc/init.d/firewall disable; /etc/init.d/firewall stop
logger "3G: firewall stopped"
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT

;;
esac

-Foxtrot

Posted

Foxtrot, it doesn't work here is my log:

19:52:13 Pineapple user.notice root: 3G: firewall stopped
19:52:08 Pineapple kern.info kernel: [ 436.680000] usbserial: USB Serial Driver core
19:52:08 Pineapple kern.info kernel: [ 436.670000] usbcore: registered new interface driver usbserial_generic
19:52:08 Pineapple kern.info kernel: [ 436.660000] usbcore: registered new interface driver usbserial
19:52:08 Pineapple kern.info kernel: [ 436.660000] USB Serial support registered for generic
19:52:05 Pineapple kern.info kernel: [ 433.620000] usbcore: deregistering interface driver usbserial
19:52:05 Pineapple kern.info kernel: [ 433.620000] USB Serial deregistering driver generic
19:52:05 Pineapple kern.info kernel: [ 433.610000] usbcore: deregistering interface driver usbserial_generic
19:51:54 Pineapple user.notice fstab: mount: mounting /dev/sda1 on /usb failed: Invalid argument
19:51:53 Pineapple user.notice usb-modeswitch: 1-1:1.4: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
19:51:53 Pineapple user.notice usb-modeswitch: 1-1:1.3: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
19:51:53 Pineapple user.notice usb-modeswitch: 1-1:1.2: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
19:51:53 Pineapple user.notice usb-modeswitch: 1-1:1.1: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
19:51:52 Pineapple user.notice usb-modeswitch: 1-1:1.0: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
19:51:52 Pineapple kern.notice kernel: [ 421.510000] sd 1:0:0:1: [sda] Attached SCSI removable disk
19:51:52 Pineapple kern.notice kernel: [ 421.480000] sd 1:0:0:1: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
19:51:52 Pineapple kern.notice kernel: [ 421.450000] sd 1:0:0:1: [sda] Write Protect is off
19:51:52 Pineapple kern.notice kernel: [ 421.440000] sd 1:0:0:1: [sda] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
19:51:52 Pineapple kern.notice kernel: [ 421.430000] sd 1:0:0:1: Attached scsi generic sg1 type 0
19:51:52 Pineapple kern.notice kernel: [ 421.430000] scsi 1:0:0:1: Direct-Access TP-LINK MMC Storage 2.31 PQ: 0 ANSI: 2
19:51:52 Pineapple kern.notice kernel: [ 421.410000] scsi 1:0:0:0: CD-ROM TP-LINK MMC Storage 2.31 PQ: 0 ANSI: 2
19:51:52 Pineapple kern.notice kernel: [ 421.410000] scsi 1:0:0:0: Attached scsi generic sg0 type 5
19:51:52 Pineapple kern.info kernel: [ 421.490000] sda: sda1
19:51:52 Pineapple kern.debug kernel: [ 421.460000] sd 1:0:0:1: [sda] Mode Sense: 0f 0e 00 00
19:51:51 Pineapple kern.info kernel: [ 420.410000] scsi1 : usb-storage 1-1:1.2
19:51:51 Pineapple kern.info kernel: [ 420.020000] usb 1-1: new high-speed USB device number 3 using ehci-platform
19:51:51 Pineapple kern.info kernel: [ 419.590000] usb 1-1: USB disconnect, device number 2
19:51:50 Pineapple kern.warn kernel: [ 419.570000] usb 1-1: usbfs: process 2319 (usb_modeswitch) did not claim interface 0 before use
19:51:50 Pineapple kern.notice kernel: [ 419.570000] sd 0:0:0:1: [sda] Synchronizing SCSI cache
19:51:47 Pineapple user.notice root: 3G: Connection Script here, searching for modems

Posted

Foxtrot, it is directly plugged in to the power adapter and I already clicked force connection.

here is logs:

21:22:47 Pineapple user.notice root: 3G: firewall stopped
21:22:42 Pineapple user.notice fstab: mount: mounting /dev/sda1 on /usb failed: Invalid argument
21:22:42 Pineapple kern.notice kernel: [ 102.330000] sd 3:0:0:1: [sda] Attached SCSI removable disk
21:22:42 Pineapple kern.notice kernel: [ 102.290000] sd 3:0:0:1: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
21:22:42 Pineapple kern.notice kernel: [ 102.280000] sd 3:0:0:1: [sda] Write Protect is off
21:22:42 Pineapple kern.notice kernel: [ 102.270000] sd 3:0:0:1: [sda] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
21:22:42 Pineapple kern.notice kernel: [ 102.260000] sd 3:0:0:1: Attached scsi generic sg1 type 0
21:22:42 Pineapple kern.notice kernel: [ 102.260000] scsi 3:0:0:1: Direct-Access TP-LINK MMC Storage 2.31 PQ: 0 ANSI: 2
21:22:42 Pineapple kern.notice kernel: [ 102.250000] scsi 3:0:0:0: Attached scsi generic sg0 type 5
21:22:42 Pineapple kern.notice kernel: [ 102.240000] scsi 3:0:0:0: CD-ROM TP-LINK MMC Storage 2.31 PQ: 0 ANSI: 2
21:22:42 Pineapple kern.info kernel: [ 102.320000] sda: sda1
21:22:42 Pineapple kern.info kernel: [ 102.230000] usbserial: USB Serial Driver core
21:22:42 Pineapple kern.info kernel: [ 102.220000] usbcore: registered new interface driver usbserial_generic
21:22:42 Pineapple kern.info kernel: [ 102.210000] usbcore: registered new interface driver usbserial
21:22:42 Pineapple kern.info kernel: [ 102.210000] USB Serial support registered for generic
21:22:42 Pineapple kern.debug kernel: [ 102.280000] sd 3:0:0:1: [sda] Mode Sense: 0f 0e 00 00
21:22:41 Pineapple user.notice usb-modeswitch: 1-1:1.0: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
21:22:40 Pineapple kern.info kernel: [ 101.170000] scsi3 : usb-storage 1-1:1.0
21:22:40 Pineapple kern.info kernel: [ 101.020000] usb 1-1: new high-speed USB device number 6 using ehci-platform
21:22:38 Pineapple kern.info kernel: [ 99.100000] usbcore: deregistering interface driver usbserial
21:22:38 Pineapple kern.info kernel: [ 99.100000] USB Serial deregistering driver generic
21:22:38 Pineapple kern.info kernel: [ 99.090000] usbcore: deregistering interface driver usbserial_generic
21:22:37 Pineapple kern.notice kernel: [ 97.650000] sd 2:0:0:1: [sda] Synchronizing SCSI cache
21:22:37 Pineapple kern.info kernel: [ 97.670000] sd 2:0:0:1: [sda] Result: hostbyte=0x01 driverbyte=0x00
21:22:37 Pineapple kern.info kernel: [ 97.650000] usb 1-1: USB disconnect, device number 5
21:22:31 Pineapple user.notice fstab: mount: mounting /dev/sda1 on /usb failed: Invalid argument
21:22:29 Pineapple user.notice usb-modeswitch: 1-1:1.4: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
21:22:29 Pineapple user.notice usb-modeswitch: 1-1:1.3: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
21:22:29 Pineapple user.notice usb-modeswitch: 1-1:1.2: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
21:22:29 Pineapple user.notice usb-modeswitch: 1-1:1.1: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
21:22:29 Pineapple user.notice usb-modeswitch: 1-1:1.0: Manufacturer=TP-LINK,_Incorporated Product=TP-LINK_HSUPA_Modem Serial=863077010746372
21:22:29 Pineapple kern.notice kernel: [ 90.150000] sd 2:0:0:1: [sda] Attached SCSI removable disk
21:22:29 Pineapple kern.notice kernel: [ 90.120000] sd 2:0:0:1: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
21:22:29 Pineapple kern.notice kernel: [ 90.120000] sd 2:0:0:1: [sda] Write Protect is off
21:22:29 Pineapple kern.notice kernel: [ 90.110000] sd 2:0:0:1: [sda] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
21:22:29 Pineapple kern.notice kernel: [ 90.100000] sd 2:0:0:1: Attached scsi generic sg1 type 0
21:22:29 Pineapple kern.notice kernel: [ 90.090000] scsi 2:0:0:1: Direct-Access TP-LINK MMC Storage 2.31 PQ: 0 ANSI: 2
21:22:29 Pineapple kern.notice kernel: [ 90.080000] scsi 2:0:0:0: CD-ROM TP-LINK MMC Storage 2.31 PQ: 0 ANSI: 2
21:22:29 Pineapple kern.notice kernel: [ 90.080000] scsi 2:0:0:0: Attached scsi generic sg0 type 5
21:22:29 Pineapple kern.info kernel: [ 90.140000] sda: sda1
21:22:29 Pineapple kern.debug kernel: [ 90.120000] sd 2:0:0:1: [sda] Mode Sense: 0f 0e 00 00
21:22:28 Pineapple kern.warn kernel: [ 88.270000] usb 1-1: usbfs: process 2078 (usb_modeswitch) did not claim interface 0 before use
21:22:28 Pineapple kern.notice kernel: [ 88.260000] sd 1:0:0:1: [sda] Synchronizing SCSI cache
21:22:28 Pineapple kern.info kernel: [ 89.080000] scsi2 : usb-storage 1-1:1.2
21:22:28 Pineapple kern.info kernel: [ 88.700000] usb 1-1: new high-speed USB device number 5 using ehci-platform
21:22:28 Pineapple kern.info kernel: [ 88.270000] usb 1-1: USB disconnect, device number 4
21:22:20 Pineapple user.notice root: 3G: Connection Script here, searching for modems

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...