Jump to content

Huawie E160G Modem


Recommended Posts


I am trying to get the E160G Modem ram to function so that I have 1 USB device that functions both as a modem and USB storage device. The E160G operates correctly if pluged into a windows box with the ram formated to fat32, I have reformatted the ram to Ext4 as per the instructions on this forum, but I can't see the ram?

root@Pineapple:~# lsusb
Bus 001 Device 005: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I think I should be seeing 2 USB devices and I only see the Modem

My current config is this

*12d1:1003* | 1d6b:0002) 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=wcdma
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 1003 -V 1d6b -P 0002 -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 -o 3g-wan2 -j MASQUERADE
iptables -A FORWARD -s -o 3g-wan2 -j ACCEPT
iptables -A FORWARD -d -m state --state ESTABLISHED,RELATED -i 3g-wan2 -j ACCEPT


I suspect I need to uncoment out the #usb part, but if I do this I get errors, any suggestions would be most welcome?


Link to comment
Share on other sites

I had that issue too formatting drives on windows for the p-apple, my issue was i didnt create a swap partition on the USB drive and I didnt set the 1st EXT4 partition as primary. Delete your 1 partition, create one for primary and one for swap, and try that out.

Also make sure your fstab looks similar to this:

config global automount
       option from_fstab 1
       option anon_mount 1

config global autoswap
       option from_fstab 1
       option anon_swap 1

config mount
       option target   /usb
       option device   /dev/sda1
       option fstype   ext4
       option options  rw,sync
       option enabled  1
       option enabled_fsck 0

config swap
       option device   /dev/sda2
       option enabled  1

Such as mentioned here

Link to comment
Share on other sites

Thanks for the reply, I did notice after publishing my request for help that there appears to be a few other people still suffering from the same issues in another thread on this forum. My issue in the end after tinkering around with the modem settings was down to the mass-storage part not always wanting to mount. It would always get the main device assigned to the E160G dongle mass-storage device i.e. /dev/sda but would not get the /dev/sda1 & /dev/sda2 partitions assigned to the /USB mount and swap points every time even with the time delays suggested in the modem settings in the other thread.

The other people on this forum have talked about if you try to mount /dev/sda {to any point} /dev/sda1 & /dev/sda2 suddenly appear! So I added the following script to the SSH keep alive timer script which is called every 5 seconds that first checks for the existence of /dev/sda1, and if not found it the checks for the the existence of the main device /dev/sda, if found it touches /dev/sda with a duff mount, this appears enough to kick off some other process that mounts the /dev/sda1 & /dev/sda2 partitions in accordance with the USB options.

if ! [ -f /dev/sda1 ] ; then
logger "/dev/sda not detected."
if [ -f /dev/sda ] ; then
logger "/dev/sda detected, so issuing a kick to the /dev/sda device"
mount /dev/sda /usb

Not very nice but it does the job and ensures my mas-storage on my E160G now always mounts on reboot, would be good though to understand what is really going wrong in the boot process as I hate these work arounds.

Link to comment
Share on other sites

Looking back in my setup I actually put the script at the end of my 3G modem keep alive script and it looked like this and not as previously published.

logger "Keep-Alive Script Executed"
if ! [ -b /dev/sda1 ] ; then
logger "/dev/sda1 not detected."
if [ -b /dev/sda ] ; then
logger "/dev/sda detected, so issuing a kick to the /dev/sda device"
mount /dev/sda /usb

Not the -b's and not -f

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.

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