Friday 12 April 2013

Huawei E160 USB Modem

I need to be able to use a USB / 3G dongle to connect the Pi to network in remote location....  This post documents trying to get this working.

1. - Install usb_modeswitch as the dongle at first appears as a CD device.

sudo apt-get install usb-modeswitch

lsusb shows the modem:-

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

So, now I've unpacked the driver file in /usr/share/usb_modeswitch - Unsure yet where this is used, but pretty sure it needs to be unpacked from the archive therein.


pi@raspberrypi /usr/share/usb_modeswitch $ sudo tar zxvf configPack.tar.gz "12d1:1003"

Added the following into /etc/usb_modeswitch.conf

# choose one of these:
#DetachStorageOnly=1

DefaultVendor=0x12d1
DefaultProduct=0x1003
#TargetClass=0xff
CheckSuccess=20
HuaweiMode=1

OK - So actually I don't think I needed the usb_modeswitch as I think it's built into 'sakis3g'.

wget http://www.sakis3g.org/versions/latest/armv4t/sakis3g.gz

(See http://shkspr.mobi/blog/2012/07/3g-internet-on-raspberry-pi-success/)
(Also http://shkspr.mobi/blog/2012/06/raspberry-pi-python-and-3g-dongles-oh-my/ for SMS).

sudo pip install pyserial
Then try sms.py from the above page.  ( This worked on T-Mobile SIM - hurray.)

sudo apt-get install ppp

 T-mobile works on network manager under Ubuntu with :-
*99#
general.t-mobile.uk
user web
pass web

I did get this working under sakis3g with apn=general.t-mobile.uk / user=t-mobile / pass=..

I did get connected on the Pi with the dongle with O2 using Sakis, but only once.... Will try powered USB hub.  Having re-installed raspian, it keeps dropping out the modem.



./sakis3g connect FORCE_APN="general.t-mobile.uk::t-mobile:.." MODEM="OTHER" OTHER="USBMODEM" USBMODEM="12d1:1003" DIAL="*99#" LOGFILE="/home/pi/3G/sakis.log"

3/4/13 - My powered hub arrived - yay.  Testing again with the above command, and it seems to work for a few minutes at least. - Managed to install lynx, and then browse using that for some time over the modem.


OK - so I've been running for some time. - I cron'd a script which brings up the connection every hour, sends a mail and drops the connection - pretty much what I need it to do remotely. - All good.









No comments:

Post a Comment

Note: only a member of this blog may post a comment.