Jump to content

Add 3g Modem


Mr.miYagi

Recommended Posts

Hi Guys

Im playing around with my MK4 and tried a few things, to add a 3g Modem.

But cant figure out how. I tried to modify the 3g script with no luck...

Now i have 2 questions:

I think i messed up the 3g script. Cant find the original script and the update link doesent work.

Can somebody post the original code.

Can somebody help me, to add a huwei e180 to the script?

Thx

Link to comment
Share on other sites

Hi Guys

Im playing around with my MK4 and tried a few things, to add a 3g Modem.

But cant figure out how. I tried to modify the 3g script with no luck...

Now i have 2 questions:

I think i messed up the 3g script. Cant find the original script and the update link doesent work.

Can somebody post the original code.

Can somebody help me, to add a huwei e180 to the script?

Thx

In the advance tab will factory reset button do the trick?

Link to comment
Share on other sites

mr.miyagi,

I searched through the supported 3G modems in the wiki and could not find your huwei e180. Darren should be able to clarify things, I am no expert. As I understand, most devices use the same manner to connect.

Link to comment
Share on other sites

Its listed on the supported devices. But what exactly i have to change on the script, to get it working? Its not supported, out of the box...

I have 6 different 3g modems, but didnt get working, i tried to modify the script, but with no luck...

Thats what the Lofile tells:

user.notice usb-modeswitch: 1-1:1.1: Manufacturer=HUAWEI_Technology Product=HUAWEI_Mobile Serial=?

user.notice usb-modeswitch: 1-1:1.1: Selecting /etc/usb_modeswitch.d/12d1:1003 for mode switching

user.notice usb-modeswitch: switching seemingly failed

Edited by Mr.miYagi
Link to comment
Share on other sites

Give me ur PID and VID, i try to modify the script for u.

E160 doesent seems really supported, we can try this:

########################################################

# Huawei devices

#

# Contributor: Hans Kurent, Denis Sutter, Vincent Teoh

DefaultVendor= 0x12d1

DefaultProduct= 0x1003

TargetClass= 0xff

HuaweiMode=1

Link to comment
Share on other sites

mine is also a Huawei but its a E220, ID 12d1:1003 same as yours, but i can not get it setup

ok I got it going now

*12d1:1003*) echo "E220 HSDPA 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=wcdma

uci set network.wan2.device=/dev/ttyUSB0

uci set network.wan2.apn=maxisbb

uci set network.wan2.username=maxis

uci set network.wan2.password=maxis

uci set network.wan2.defaultroute=1

uci commit network

usb_modeswitch -v 12d1 -p 1003 -V 12d1 -P 1003 -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20

sleep 10; rmmod usbserial

sleep 3; insmod usbserial vendor=0x12d1 product=0x1003

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

Edited by kevambert
Link to comment
Share on other sites

Give me ur PID and VID, i try to modify the script for u.

E160 doesent seems really supported, we can try this:

########################################################

# Huawei devices

#

# Contributor: Hans Kurent, Denis Sutter, Vincent Teoh

DefaultVendor= 0x12d1

DefaultProduct= 0x1003

TargetClass= 0xff

HuaweiMode=1

Mr.miYagi,

Yes, it is indeed VID: 12d1 and PID: 1003.

Could you please share your script?

Thank you in advance,

Nik

Link to comment
Share on other sites

For what it's worth, some 3G USB modems won't be able to mode switch on Ubuntu. However if you open up a windows virtual machine and attach the USB device to the virtual machine and run the driver from windows, then attach it back to the host the mode should be switched and it should be able to connect to a 3g network.

Link to comment
Share on other sites

Yes, it is indeed VID: 12d1 and PID: 1003.

Could you please share your script?

Thank you in advance,

Nik

Here my friend. Don't forged to change apn, user and pw:

#!/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

#

# Updated: 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

*12d1:1003*) echo "Huawei E180"

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=gprs.swisscom.ch

uci set network.wan2.username=

uci set network.wan2.password=

uci set network.wan2.defaultroute=1

uci commit network

usb_modeswitch -v 12d1 -p 1003

sleep 10; rmmod usbserial

sleep 3; insmod usbserial vendor=0x12d1 product=0x1003

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

;;

Link to comment
Share on other sites

Does anyone know if a 3G/4G modem will work or if a 4G modem will work at 3G speed? I have two modems and I haven't been able to get either of them to work. One is a 4G Verizon USB551L and the other is a Sprint Sierra 250U 3G/4G modem. I sure don't want to go buy another modem if one of these will work. :(

Guess I could post more info. ;)

This is with the Sierra modem

00:55 user.info sysinit: Searching for attached 3G Modems

00:55 user.notice root: 3G: Connection Script here, searching for modems

00:57 user.info sysinit: 1d6b:0002 0424:2512 1199:0301 198f:0220

00:57 user.info sysinit: Beceem BCSM250 (Sprint) detected. Attempting mode switch

00:58 user.info sysinit: Looking for target devices ...

00:58 user.info sysinit: Found devices in target mode or class (1)

00:58 user.info sysinit: Looking for default devices ...

00:58 user.info sysinit: Found devices in default mode, class or configuration (1)

00:58 user.info sysinit: Accessing device 004 on bus 001 ...

00:58 user.info sysinit: Getting the current device configuration ...

00:58 user.info sysinit: OK, got current device configuration (1)

00:58 user.info sysinit: Using first interface: 0x00

00:58 user.info sysinit: Using endpoints 0x02 (out) and 0x81 (in)

00:58 user.info sysinit: Not a storage device, skipping SCSI inquiry

00:58 user.info sysinit: USB description data (for identification)

00:58 user.info sysinit: Trying to send message 1 to endpoint 0x02 ...

01:14 daemon.info hostapd: wlan0: STA 30:7c:30:ed:ec:8e IEEE 802.11: authenticated

01:14 daemon.info hostapd: wlan0: STA 30:7c:30:ed:ec:8e IEEE 802.11: associated (aid 1)

01:14 daemon.info dnsmasq[1669]: reading /tmp/resolv.conf.auto

01:14 daemon.info dnsmasq[1669]: using nameserver 8.8.8.8#53

01:14 daemon.info dnsmasq[1669]: using local addresses only for domain lan

01:17 daemon.info dnsmasq-dhcp[1669]: DHCPDISCOVER(br-lan)

01:17 daemon.info dnsmasq-dhcp[1669]: DHCPOFFER(br-lan) 172.16.42.136

01:17 daemon.info dnsmasq-dhcp[1669]: DHCPDISCOVER(br-lan)

01:17 daemon.info dnsmasq-dhcp[1669]: DHCPOFFER(br-lan) 172.16.42.136

01:17 daemon.info dnsmasq-dhcp[1669]: DHCPREQUEST(br-lan) 172.16.42.136

01:17 daemon.info dnsmasq-dhcp[1669]: DHCPACK(br-lan) 172.16.42.136

01:21 user.info sysinit: OK, message successfully sent

01:21 user.info sysinit: Reading the response to message 1 (CSW) ...

01:21 user.info sysinit: Response reading got error -145

01:21 user.info sysinit: Device is gone, skipping any further commands

01:21 user.info sysinit: Checking for mode switch (max. 20 times, once per second) ...

01:21 user.info sysinit: Searching for target devices ...

01:21 user.info sysinit: Searching for target devices ...

01:21 user.info sysinit: Searching for target devices ...

01:21 user.info sysinit: Searching for target devices ...

01:21 user.info sysinit: Searching for target devices ...

01:21 user.info sysinit: Searching for target devices ...

01:30 daemon.info hostapd: wlan0: STA f4:0b:93:cd:a1:48 IEEE 802.11: authenticated

01:30 daemon.info hostapd: wlan0: STA f4:0b:93:cd:a1:48 IEEE 802.11: associated (aid 2)

01:31 kern.info kernel: [ 91.430000] usbcore: deregistering interface driver usbserial_generic

01:31 kern.info kernel: [ 91.440000] USB Serial deregistering driver generic

01:31 kern.info kernel: [ 91.440000] usbcore: deregistering interface driver usbserial

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPDISCOVER(br-lan)

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPOFFER(br-lan) 172.16.42.144

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPDISCOVER(br-lan)

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPOFFER(br-lan) 172.16.42.144

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPDISCOVER(br-lan)

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPOFFER(br-lan) 172.16.42.144

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPREQUEST(br-lan) 172.16.42.144

01:34 daemon.info dnsmasq-dhcp[1669]: DHCPACK(br-lan) 172.16.42.144

01:34 kern.info kernel: [ 94.530000] usbcore: registered new interface driver usbserial

01:34 kern.info kernel: [ 94.540000] USB Serial support registered for generic

01:34 kern.info kernel: [ 94.540000] usbserial_generic 1-1.1:1.0: generic converter detected

01:34 kern.info kernel: [ 94.550000] usb 1-1.1: generic converter now attached to ttyUSB0

01:34 kern.info kernel: [ 94.550000] usbcore: registered new interface driver usbserial_generic

01:34 kern.info kernel: [ 94.560000] usbserial: USB Serial Driver core

01:34 user.notice 3g-hotplug: Starting interface wan2 for device ttyUSB0

01:38 daemon.notice pppd[2267]: pppd 2.4.5 started by root, uid 0

01:39 local2.info chat[2272]: abort on (BUSY)

01:39 local2.info chat[2272]: abort on (NO CARRIER)

01:39 local2.info chat[2272]: abort on (ERROR)

01:39 local2.info chat[2272]: report (CONNECT)

01:39 local2.info chat[2272]: timeout set to 10 seconds

01:39 local2.info chat[2272]: send (AT&F^M)

01:39 local2.info chat[2272]: expect (OK)

01:39 user.info sysinit: /www//3g.sh: line 136: /etc/init.d/firewall: not found

01:39 user.info sysinit: /www//3g.sh: line 136: /etc/init.d/firewall: not found

01:39 user.notice root: 3G: firewall stopped

01:40 user.info sysinit: setting up led LAN

01:40 user.info sysinit: setting up led WAN

01:40 user.info sysinit: setting up led WLAN

01:40 user.info sysinit: setting up led USB

01:49 local2.info chat[2272]: alarm

01:49 local2.info chat[2272]: Failed

01:49 daemon.err pppd[2267]: Connect script failed

02:21 local2.info chat[2290]: abort on (BUSY)

02:21 local2.info chat[2290]: abort on (NO CARRIER)

02:21 local2.info chat[2290]: abort on (ERROR)

02:21 local2.info chat[2290]: report (CONNECT)

02:21 local2.info chat[2290]: timeout set to 10 seconds

02:21 local2.info chat[2290]: send (AT&F^M)

02:21 local2.info chat[2290]: expect (OK)

02:31 local2.info chat[2290]: alarm

02:31 local2.info chat[2290]: Failed

02:31 daemon.err pppd[2267]: Connect script failed

*198f:0220*) echo "Beceem BCSM250 (Sprint) 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.sprint.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 198f -p 0220 -V 198f -P 0220 -M 555342431234567824000000800006bc626563240000000000000000000000 -n 1 -s 20

sleep 10; rmmod usbserial

sleep 3; insmod usbserial vendor=0x198f product=0x0220

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

;;

Edited by StoneWraith
Link to comment
Share on other sites

  • 3 weeks later...

If lsusb shows you this:

Bus 001 Device 005: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem

Remove the usb modeswitching from the script!!!!

Huawei E160E working configuration ( may work for others too! ):

*12d1:1003*) echo "E220 HSDPA 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=wcdma

uci set network.wan2.device=/dev/ttyUSB0

uci set network.wan2.apn=real apn name here

uci set network.wan2.username=real username here

uci set network.wan2.password=password here ( if needed )

uci set network.wan2.defaultroute=1

uci commit network

#Comment out the line below!

#usb_modeswitch -v 12d1 -p 1003 -V 12d1 -P 1003 -M 5553424312345678000000000000061b000000020000000000000000000000 -n 1 -s 20

sleep 10; rmmod usbserial

sleep 3; insmod usbserial vendor=0x12d1 product=0x1003

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

Thanks to everyone for the 3g info :)

- SgtPineapple

Link to comment
Share on other sites

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...