Monthly Archives: December 2010

Huawei E1750 3G USB modem on OpenWRT Kamikaze

I recently configured a Netgear WGT634U access point running OpenWRT Kamikaze 8.09.2 to use a HUAWEI E1750 3G modem.

The HUAWEI E1750 is sold under different names, some people report it as E220 or E1752. You should check in /proc/bus/usb/devices what is the vendor and product id of your 3G modem. You should see the following values:
vendor=0x12d1 product=0x1446

This howto should apply to all 3G USB modems with the same vendor and product id and any AP running OpenWRT Kamikaze 8.09.2.
Here is how I got the whole thing running:

1. Install the required kernel modules and utilities:

# opkg update
# opkg install kmod-usb-acm kmod-usb-core kmod-usb-ohci kmod-usb-serial comgt \
kmod-usb-serial-option kmod-usb-storage kmod-usb-uhci kmod-usb2 usb-modeswitch

2. Create or edit the file /etc/modules.d/60-usb-serial so that it only contains the following line:

usbserial vendor=0x12d1 product=0x1446

3. Create or edit the file/etc/usb_modeswitch.conf so that it looks as follows:

DefaultVendor= 0x12d1
TargetVendor= 0x12d1

4. Add the following section to /etc/config/network:

WARNING!!! Depending on the model of your 3G modem you may need to replace ttyUSB0 with ttyUSB1, ttyUSB2, etc. Check the output of “dmesg” to know which is the correct port. If you are unsure, find out by trial-and-error.

config 'interface' 'ppp0'
option 'ifname' 'ppp0'
option 'proto' '3g'
option 'device' '/dev/ttyUSB0'
option 'apn' 'YOURAPNHERE'
option 'pincode' 'YOURPINCODEHERE'

Replace YOURAPNHERE with the name of your APN (e.g. “” for H3G Italy) and YOURPINCODEHERE with the PIN code of your SIM.

WARNING!!! If you have disabled PIN code verification for your SIM, you can omit the pincode option but you’ll need to workaround a bug in /lib/network/ Open /lib/network/ in your editor and comment out the following lines:

# PINCODE="$pincode" gcom -d "$device" -s /etc/gcom/setpin.gcom || {
# echo "$cfg(3g): Failed to set the PIN code."
# set_3g_led 0 0 0
# return 1
# }

5. Reboot your OpenWRT device.

6. Manually run the following commands and after a minute verify that your 3G connection is working:

ifup ppp0

7. Add the following lines to the top of /etc/rc.local:

sleep 3
sleep 3
/sbin/ifup ppp0

8. Log on the web interface of your OpenWRT device and click on Administration/Networks/Interfaces/ppp0 and add it to the WAN zone.

You may need to adjust the DNS settings manually.

Credits: Peter Andersson