3mobile usb modem

Post Reply
Message
Author
boeingng
Posts: 6
Joined: Sun 04 May 2008, 01:05

3mobile usb modem

#1 Post by boeingng »

I am new to linux but want to learn. Has anyone connected a 3mobile usb modem to Puppy (any version)? I used Puppy for my previous broadband and wireless card connections so now would like to wave goodbye to XP for my current set up.

If so could you point me in the right direction to get mine to connect?

All the best to the community.

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#2 Post by HairyWill »

It would probably be sensible to confirm the device id so that we know exactly what hardware we are dealing with.
Puppy 4.00 has HardInfo on the Menu-System-HardInfo-USB Devices-Misc vendor & productID
Other puppies may have lsusb installed.

Many people have connected puppy to the via a mobile so this should be doable if we can get the hardware connected properly.

If you have it, it is probably best to use puppy 4.00, if not state which version you are using.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

boeingng
Posts: 6
Joined: Sun 04 May 2008, 01:05

Modem info

#3 Post by boeingng »

I have not had success with Puppy 4.00, my wireless keyboard does not work. This is the info from Puppy 4.00 Menu-Syst-HardInfo-Usbdevices : No "Misc Vendor" but the following - Ehci Host Controller & Usb 2.0 Hub Controller only - no further info is displayed. So I gatether it does not see my Usb device for the remote mouse and keyboard.

Using Puppy 2.17 the following is displayed in USB DEVICES:

Huawei Mobile
Manufacturer: Huawei Technologies
Speed 12Mb/s(full)
UsbVersion1.10
Device class 00 (>ifc)
Device subclass 00
Device Ptotocol 00
Max Default endpoint size 64
Number of configs 1
Vendor ID 12d1
Product Id 1003
Revision number 0.00

Config Number1
Number of interfaces 3
Attributes a0
Max power needed 500ma

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

huaweiE220 connection script

#4 Post by HairyWill »

I don't have a 3G modem so I am cobbling this script together from stuff I found on the net and some experience using my phone as gprs modem. This script is extremely unlikely to work first time but it might give you a basis for tweaking it to work.
links:
http://wiki.debian.org/Huawei/E220
http://ubuntuforums.org/showthread.php?t=262867&page=8

Code: Select all

#!/bin/sh

echo "/dev/usb/ttyUSB0
460800
noauth
defaultroute
usepeerdns
persist
noipdefault
lock
connect '/usr/sbin/chat -v -f /etc/chatscripts/huawei'" > /etc/ppp/peers/3G
chmod 777 /etc/ppp/peers/3G

mkdir -p /etc/chatscripts/
echo "ABORT ERROR
ABORT RING
ABORT BUSY
ABORT \"NO CARRIER\"
ABORT VOICE
ABORT \"NO DIALTONE\"
ABORT \"NO ANSWER\"
REPORT CONNECT
\"\" \"ATZ\"
OK \"ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0\"
OK ATDT*99***1#
TIMEOUT 60
CONNECT \c" > /etc/chatscripts/huawei
chmod 777 /etc/chatscripts/huawei

#rmmod usb-storage #might need this as well
rmmod usb-serial #unload the module
modprobe usbserial vendor=0x12d1 product=0x1003 #reload it device ids

pppd call 3G
cp /etc/ppp/resolv.conf /etc/resolv.conf
tail /var/log/messages
echo "press return to kill connection"
read
killall pppd
to use this you need to copy it into a new file
click on the home icon on the desktop
right click - new - script
name it fred
now right click on fred and "open as text"
copy the script, paste in and save
now open a console and type
./fred
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

boeingng
Posts: 6
Joined: Sun 04 May 2008, 01:05

#5 Post by boeingng »

Thanks for the guidance. When I have some time I will give it a go.
:idea:

boeingng
Posts: 6
Joined: Sun 04 May 2008, 01:05

Still trying

#6 Post by boeingng »

I tried your script but when I went to run it I got the message "permission denied" or similar.

I tried some scripts for wvdial (modified Vodaphone 3g from other forums)- no success, they all id'd my modem as "ttyUSB0", however this generated a message "unable to locate ttyusb0".

I am new to puppy linux console commands. I am sure I can sort this out with a little help.
:?:

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#7 Post by Aitch »

@boeingng

Huawei E220/puppy v3.00 working, here;

http://www.murga-linux.com/puppy/viewto ... 9b4d8441cf

and

http://www.murga-linux.com/puppy/viewto ... 4ccbe3f2bf

and

http://www.murga-linux.com/puppy/viewtopic.php?t=12603

@Hairy Will

maybe you can see what was done in 3.00 & modify it/yours for v4?

Aitch :)

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#8 Post by HairyWill »

Doh,I don't think I searched this forum. :oops:
The last link that Aitch posted looks promising, you might want to post there to see in wescht can help as he has the hardware to play with.

Having read that thread though there doesn't seem to be anything specifically different in puppy 4 that would have an effect.

The permission denied error is simply caused by the script not being executable. If you are in the same directory as the the file fred then

Code: Select all

chmod 700 fred
should fix that.

I think the line #rmmod usb-storage will need to have the # at the beginning that comments it out removed to make sure it gets executed.

If it still doesn't work I would try blacklisting the usb_storage module and rebooting. You can do this using Menu - System - Boot manager - black list a module
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

boeingng
Posts: 6
Joined: Sun 04 May 2008, 01:05

#9 Post by boeingng »

Thanks for all the help. I now have plenty try. So far not successful, but I am sure learning a lot. My apologies for not searching the forum with a more specific string, I should have found the reference posts myself. I much appreciate the forum's help.

kjoe
Posts: 27
Joined: Wed 25 Jul 2007, 19:17
Location: Austria

#10 Post by kjoe »

Hi boeingng,

Based on HairyWills script and including information found on http://ubuntu.frankenberger.at/Huawei_E220.html and in some blogs (and certainly after testing several hours :-) ) I've ended up with the following script (be aware that the PIN must be deactivated):

Code: Select all

#!/bin/sh
# modified by kjoe for puppy linux 4.0
# connects huawei E220 HSDPA usb modem to provider
# exchange the following variables in this script according to your needs:

# "UUUUU" = user  (your user name)
# "PPPPP" = password  (your password)
# "XXXX" = pin code (PIN has to be deactivated for using this script)
# "LLLLL" = last part of init string (like  web.yesss.at)
# "@@@@@" = tel number (like *99#)
#  "AAA.AAA.AAA.AAA" = nameserver 1 (like  194.24.128.100)
#  "BBB.BBB.BBB.BBB" = nameserver 2 (like  81.3.216.100)

echo "hide-password
noauth
connect \"/usr/sbin/chat -v -f /etc/ppp/chatscripts/huawei\"
debug
/dev/usb/ttyUSB0
460800
defaultroute
noipdefault
noccp
nobsdcomp
user \"UUUUU\"
password \"PPPPP\"
usepeerdns
connect-delay 10000" > /etc/ppp/peers/provider
chmod 777 /etc/ppp/peers/provider

mkdir -p /etc/ppp/chatscripts/
echo "
# This chatfile was generated automatically by connect_huawei script.
# Please do not delete any of the comments.  Pppconfig needs them.
#
# ispauth PAP
# abortstring
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
'' ATZ
#TIMEOUT 5
#OK AT+CPIN? READY-AT+CPIN=XXXX-OK \"\" #no need to enter the PIN as it has to be deactivited to use this script
# TIMEOUT 20
'' 'AT+cgdcont=1,\"IP\",\"LLLLL\"' OK \"ATDT@@@@@\"
CONNECT \d\c
# prelogin

# ispname
# isppassword
# postlogin

# end of pppconfig stuff
" > /etc/ppp/chatscripts/huawei
chmod 777 /etc/ppp/chatscripts/huawei

mv /etc/resolv.conf /etc/resolv_old.conf
echo "# Generated by connect_huawei script
nameserver AAA.AAA.AAA.AAA
nameserver BBB.BBB.BBB.BBB" > /etc/resolv.conf

echo "#!/bin/sh
echo \"This script will try to connect your huawei modem.\"
echo \"In order to use this script PIN has to be deactivated first. One can do this either within the windows software or by putting the card into a mobile phone and deactivate the PIN code. If PIN is activated the modem LED will not turn into blue!!\"
echo \"Please plug in your modem in case you have not done yet\"
echo \"    \"
echo \"Wait until the modem LED has turned blue,\"
echo \"then press enter\"
read

#rmmod usb-storage #might need this as well
#rmmod usbserial #unload the module
modprobe usbserial vendor=0x12d1 product=0x1003
modprobe -r uhci_hcd
sleep 2
modprobe uhci_hcd

echo \"Press enter after modem LED has turned blue again\"
read
modprobe usbserial vendor=0x12d1 product=0x1003
mknod /dev/usb/ttyUSB0 c 188 0

ifconfig eth0 down  #maybe this line can be left or has to be adapted
pppd call provider
pause 5
echo \"   \"
echo \"   \"
echo \"Now connecting (watch Modem LED).\"
echo \"In case the modem does not connect (=keeps flashing)\"
echo \"kill the connection and restart script.\"
echo \"   \"
echo \"Keep this window open to stay connected.\"
echo \"Press return if you want to kill the connection\"
read
killall pppd
rm /etc/resolv.conf
rm ./Huawei
rm /etc/ppp/chatscripts/huawei
rm /etc/ppp/peers/provider
mv -f /etc/resolv_old.conf /etc/resolv.conf" > ./Huawei
chmod 777 ./Huawei

xterm -bg green -e ./Huawei 
Like HairyWill has described above to use this you need to copy it into a new file
click on the home icon on the desktop
right click - new - script
name it "connect_huawei"
now right click on connect_huawei and "open as text"
copy the script, paste in
exchange the variables in this script according to your needs
(user, password, phone number, ...) and save.

Start the script by clicking on it with the mouse
or open a console and type ./connect_huawei.
Then follow the instructions.

Some times I have to stop the process and start the script a second time until it works !!
I do not know why this is necessary.

I know, the script is far from being perfect, but at least it works for me.

Info: The really important lines to get it work were:
modprobe -r uhci_hcd
modprobe uhci_hcd
and
mknod /dev/usb/ttyUSB0 c 188 0

I hope it may be helpful

Good luck

kjoe
Last edited by kjoe on Sun 29 Jun 2008, 11:41, edited 2 times in total.

whooa
Posts: 3
Joined: Tue 27 May 2008, 11:25

#11 Post by whooa »

Good work kjoe, your patience impresses. I gave up puppy for a while a go.
May I suggest these lines to your script, ripped from oozies hua wei script for ubuntu(I made my own based on that), usually I have to wait more than 2 seconds at modprobe, up to 10/15 seconds noramlly(DSL only 2 seconds).

sudo modprobe -r uhci_hcd
sudo modprobe uhci_hcd
echo "Waiting kernel to detect modem device"
# Wait till the kernel recognizes our E220
while [ ! -c /dev/ttyUSB1 ]; do
sleep 1
done
# Start dialing
sudo wvdial $DIALER

I might have a new walk with puppy now since you were successfull.
//Peter, sweden.

EDIT !! oouups, was a bit to quick, in puppy you have to adress usb by /dev/usb/ttyUSBx.
sorry. /p

kjoe
Posts: 27
Joined: Wed 25 Jul 2007, 19:17
Location: Austria

#12 Post by kjoe »

@ whooa

thanks for your suggestion. I've already tried this before but without success. It seems not to work in puppy (or work different).
But I have to admit that I am not really into Linux. So maybe I did it wrong and someone could check on that.

Maybe this someone could also figure out, why most time the script has to be run two times to get a connection. ....

kjoe

zackbam
Posts: 1
Joined: Mon 04 May 2009, 08:37

easy guide to connect through wour mobile

#13 Post by zackbam »

connect your phone through usb

Code: Select all

su
wvdialconfig
geany /etc/wvdial.config
provide the file with your appropriate username and password. For GR Cosmote the username is "user" and the password "pass".
close geany.

Code: Select all

cp /etc/ppp/wvdial /etc/ppp/peers/
cp /etc/ppp/wvdial-pipe /etc/ppp/peers/
Now everytime you want to get connected, type on console:

Code: Select all

wvdial
Of course you can make a script on the desktop ;)
It works for me using sony ericsson k770

Post Reply