Jump to content

Can't add usb interface for Huawei E586 3g USB dongle


PaulK

Recommended Posts

I don't seem to be able to create a ttyUSB0 for my 3g card

I have tried the following and am lost as to what to do next?

root@Pineapple:/# ls /dev/ttyUSB*
ls: /dev/ttyUSB*: No such file or directory
root@Pineapple:/# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 12d1:1c1f Huawei Technologies Co., Ltd.
root@Pineapple:/# insmod usbserial vendor=0x12d1 product=0x1c1f
insmod: can't insert 'usbserial': File exists
Can anyone help? I'm very much still learning.
Thank you
Paul
Link to comment
Share on other sites

Here is the 3g script Im using, I have adapted a script for another huawei modem I found on this forum:

#!/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-PK"
MODEM=$(lsusb | awk '{ print $6 }')
echo $MODEM

case "$MODEM" in

*12d1:11c1f*) echo "Huawei E586"
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=giddgaff.com
uci set network.wan2.username=giffgaff
uci set network.wan2.password=password
uci set network.wan2.defaultroute=1
NoDriverLoading=1
uci commit network
usb_modeswitch -v 12d1 -p 1c1f -V 12d1 -P 1c1f -M 55534243123456780000000000000011062000000100000000000000000000 -n 1 -s 20
sleep 10; rmmod usbserial
sleep 3; insmod usbserial vendor=0x12d1 product=0x1c1f
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

Edited by PaulK
Link to comment
Share on other sites

[ 0.000000] Kernel command line: board=HORNET-UB console=ttyATH0,115200 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware) rootfstype=squashfs,jffs2 noinitrd

[ 0.660000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART

[ 0.660000] console [ttyATH0] enabled, bootconsole disabled
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...