Wednesday, February 06, 2013

Vodafone Huawei 3G and Linux

Vodafone Huawei 3G and Linux


  1. Tested on Crunchbang Linux 
  2. sakis3g was working after connecting the vodem in a Virtualbox windows machine.  This was a pain so I finally got the fix to auto switch when inserted.  here it is....
  3. check usb_modeswitch and usb_modeswitch_data is installed
    1. cd /usr/share/usb_modeswitch/
    2. sudo gunzip configPack.tar.gz
    3. sudo tar xf configPack.tar
    4. sudo cp 12d1:1523 12d1:1526
    5. edit 12d1:1526 to reflect 
  4. Insert the stick and run lsusb to get the product and vendor details...
  5. /etc/udev/rules.d/15-huawei-e1550.rules file (any filename is OK)
    1. SUBSYSTEM=="usb",
    2. SYSFS{idProduct}=="1526",
    3. SYSFS{idVendor}=="12d1",
    4. RUN+="/usr/sbin/usb_modeswitch  --default-vendor 0x12d1 --default-product 0x1526 -W -I -c /usr/share/usb_modeswitch/12d1:1526"
  6. edit connections
    1. Mobile Broadband
    2. add
      1. Name: Vodem
      2. Number *99#
      3. apn www.vodafone.net.nz
  7. insert device
  8. check lsusb is switched
    1. initially lsusb will report unswitched device
      1. Bus 002 Device 014: ID 12d1:1526 Huawei Technologies Co., Ltd.
    2. then the rules will kick in and switch after about 10 seconds:
      1. Bus 002 Device 013: ID 12d1:14cf Huawei Technologies Co., Ltd.
  9. connect via network connect icon
  10. remove device when finished
  11. Script to perform the connection
    1. ###To automatically repeat result of last action, use following command line:
      while true;do
        if lsusb |grep Huawei >/dev/null;then
          echo found Huawei
          break
        fi
        echo Waiting for device Huawei
        sleep 1
      done

      ##SUBSYSTEM=="usb",
      ##SYSFS{idProduct}=="1526",
      ##SYSFS{idVendor}=="12d1",
      id
      echo Performing switch
      /usr/sbin/usb_modeswitch  --default-vendor 0x12d1 --default-product 0x1526 -W -I -c /usr/share/usb_modeswitch/12d1:1526
      lsusb |grep Huawei

      while true;do
        if lsusb |grep 12d1:14cf >/dev/null;then
          echo switch complete
          break
        fi
        echo Waiting for device switch
        sleep 1
      done


      echo Connecting....
      /home/dunc3/sakis3g  \
              connect \
              --nostorage \
              APN="www.vodafone.net.nz" \
              APN_USER="user" \
              APN_PASS="pass" \
              USBINTERFACE="0" \
              USBDRIVER="option" \
              USBMODEM="12d1:14cf" \
              OTHER="USBMODEM" \
              MODEM="OTHER" \
              DISPLAY=":0"
       

3 comments:

Anonymous said...

thanks for the post

Duncan Styles said...

test from Duncan

Duncan Styles said...

no capture required