Integration of 3G Wireless Modem Detection - 4.1.2 & 4.2.1

A home for all kinds of Puppy related projects
Message
Author
kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#226 Post by kultex »

I tried with my "new" Toshiba R100 laptop and the huawei E220 and did not succeed. I am a bit confused with the usb-modeswich pet.

Normally, when I insert the E220 I get with dmesg:

Code: Select all

usb 3-2: new full speed USB device using uhci_hcd and address 3
usb 3-2: configuration #1 chosen from 1 choice
usb-storage: probe of 3-2:1.0 failed with error -5
usb-storage: probe of 3-2:1.1 failed with error -5
usb-storage: probe of 3-2:1.2 failed with error -1
usb 3-2: New USB device found, idVendor=12d1, idProduct=1003
usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 3-2: Product: HUAWEI Mobile
usb 3-2: Manufacturer: HUAWEI Technologies
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for GSM modem (1-port)
option 3-2:1.0: GSM modem (1-port) converter detected
usb 3-2: GSM modem (1-port) converter now attached to ttyUSB0
option 3-2:1.1: GSM modem (1-port) converter detected
usb 3-2: GSM modem (1-port) converter now attached to ttyUSB1
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems
but when I put it in puppy, I get with dmesg only the Huawei - CD-Rom device

Code: Select all

scsi  7:0:0:0:  CD-ROM      Huawei   Mass Storage     2.31   PQ:  0  ANSI:  2
sr0:  scsi-1   drive
Uniform CD-ROM driver  Revision:  3.20
sr   7:0:0:0:  Attached scsi  CD_ROM sr0
- in /tmp/usb_modeswitch.log it is recogniced well -

is this ok?
Attachments
usb_modeswitch.txt.zip
(1.02 KiB) Downloaded 458 times

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#227 Post by kultex »

Code: Select all

rmmod usb-storage
modprobe usbserial vendor=0x12d1 product=0x1003
does the job

Code: Select all

usb-storage: waiting for device to settle before scanning
scsi 5:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
sr 5:0:0:0: Attached scsi CD-ROM sr0
usb-storage: device scan complete
usbcore: deregistering interface driver usb-storage
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbserial_generic 1-1:1.0: generic converter detected
usb 1-1: generic converter now attached to ttyUSB0
usbserial_generic 1-1:1.1: generic converter detected
usb 1-1: generic converter now attached to ttyUSB1
usbserial_generic 1-1:1.2: generic converter detected
usb 1-1: generic converter now attached to ttyUSB2
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
:D I am connected now with my portege and the E220 and pgprs :D

one more question - is there any possibility to tell pgprs to reconnect by itself - I am in the train and the modem switches often between GPRS and UMTS and it is quite odd to enter all the times r+enter

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#228 Post by rerwin »

kultex,
Thanks for trying your modem with Puppy and posting here. I wrote the following before I noticed the first quote in your posting, where you use the old "modprobe usbserial" technique. Puppy's 3G PupDial (Internet by analog modem) implementation does not support use of usbserial on its own. It uses newer drivers and does that in its own way. Use of usbserial probably interferes with that process.

Please try with a new pupsave (pfix=ram) setup and let Puppy handle it all.

If you still have problems, please tell me a little more about your situation. Which Puppy version are you using? Was it the standard version or retro, because the 3G stuff is tested only on the standard (kernel 2.6.25.16) version.

Puppys 4.1.2, 4.2 and 4.2.1 require some downloaded .pets. Which dotpets did you take? The usb_modeswitch log shows that it was first run using the configuration file before it was set up for the modem. I assume you ran that, unless Puppy is doing something unexpected. But the log also shows that it tried a mode-switch but failed -- three times. Puppy should handle all of the mode switching, without user commands. (The log does appear to indicate that Puppy ran the mode-switches after the first, and that usb_modeswitch is up to date.)

Some people have found that you need to boot with the modem plugged in, then unplug and replug it once Puppy gets to the desktop.

I am baffled, at the moment, but maybe you can get me more information that will help. Next time, please also attach the file: /tmp/udevtrace-modem.log. Thanks.
Richard

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#229 Post by kultex »

I was using normal puppy 4.2 - but was very unhappy with seamonkey - eg. crashed every time I tried to download something.

I switched now to puppy-413-boxpup-r1.iso (i love the artwork much more and it has no seamonkey, but Opera 10 instead) - kernel is also kernel 2.6.25.16

Code: Select all

# uname -a
Linux puppypc 2.6.25.16 #1 Tue Aug 26 10:45:53 GMT-8 2008 i686 GNU/Linux
I installed extra: firefox 3.5, usb_modeswitch-1.0.2 and 3G_pupdial-wireless-11 - nothing else
I only plugged in the huawei once - nothing changed compared to the puppy 4.2 iso - in the attachment are all your required files

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#230 Post by rerwin »

kultex,
Thanks for the additional run and data. I see some interesting things that might be interfering, but also that the modem appears in both its storage-device and modem-device modes, even though the switch did not happen within the 5-second wait for it.

1. Ethernet interface: there have been recommendations that the ethernet interface should be "disabled" to avoid messing up the wireless modem. For good measure, just turn off the interface with the command:
ifconfig eth0 down

2. You seem to have a built-in SL modem, that probably causes the "connect" wizard to show ttySL0 as your modem. The intent is for USB modems plugged in at boot-up to be preferred over built-in or PCI modems. But the delayed startup of the wireless modems (due to the mode switching and hardware delays) may be undermining that concept. I am beginning to suspect I need to suppress/disable the built-in, sound-card-based modem whenever a wireless USB modem is plugged in.

If you are willing to experiment a little, you can inhibit use of the built-in by entering this command only once, to add a line to a configuration file:

Code: Select all

echo "install snd-intel8x0m /bin/true # temporarily disabled by USB modem" >> /etc/modprobe.conf
If you want to re-enable the SL modem later, just delete that line or put a # at its beginning, to make the line a comment. (followed by the probe-ERASE-reboot dance.)

After after appending that line, get into PupDial, either via the connect wizard or just by entering the command:
pupdial
Then click on the probe button, then on the ERASE button and OK on the popup. Then reboot. That should take the built-in modem out of play and let the wireless have a chance.

I hope this makes a difference. If so I will add it to the 3G-project dotpet. At least it will remove that possible conflict from the situation. Thanks for whatever you can do.
Richard

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#231 Post by kultex »

the built-in modem is now away - thanks a lot - but still - the E220 is mounted as CD-Rom device - see attachment.

But what is mounting the device as CD-Rom device - it reminds me to the early days of the E220 (April 2007, when I got it), when I created a /etc/udev/rules.d/50-huawei.rules with the following content:

SUBSYSTEMS=="scsi" ATTRS{vendor}=="HUAWEI ", OPTIONS+="ignore_device"

I did this, but it does not help ....

I thought the Huwaei E220 is recognized since Kernel 2.6.20
Attachments
huawei-E220-2.tar.gz
(3.66 KiB) Downloaded 407 times

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#232 Post by rerwin »

kultex,
I have just provided another thread with a patch for a problem (also with a E220) I have long suspected but only today received confirmation. I posted my attempt at a fix here:http://www.murga-linux.com/puppy/viewto ... 678#328678

Please start fresh and do not improvise, as I can make sense of it all only if things are done as I expect. But disabling the built-in is fine.

Curiously, the E220 seems to start out already switched to modem mode. But the problem is that the modem driver is not getting selected for loading. The patch addresses that -- successfully, I hope. Waiting for results.

Regarding the cdrom issue: These hybrid modems are both a storage device and a modem. The storage looks like a cdrom and auto-loads the windows driver for the modem. But that doesn't help us in linux. The usb_modeswitch utility compensates for that and tells the device to become a modem. Or at least make the modem part accessible. Although it is possible to access both parts concurrently, the modeswitch operation simply substitutes the modem for the storage part.
Richard

User avatar
bitzer
Posts: 3
Joined: Mon 03 Aug 2009, 06:54

#233 Post by bitzer »

Hi all

I’m a relative newcomer to Linux and this is my first post on any forum. I’ve looked at most of the major distros but have always come back to Puppy and intend to stay here now because of its elegance and the fact that with the information on this excellent forum I’ve almost always been able to get things working well.

My apologies if I’m posting this in the wrong place but it does seem to be the main thread on this issue, it’s certainly where I found help.

Hopefully this note will assist some people, particularly those in the UK, who are contemplating mobile internet access with the Vodafone K3565 (Huawei E160) PAYG 3G dongle. It’s a good deal for those who don’t use a lot of bandwidth, £15 for 1G with no expiry date providing it’s used every 180 days. This apparently equates to around 90 hours browsing (no downloads!)

In the end it turned out to be very easy to use (after a great deal of hard work by Rerwin and others!)

This is what I did; it works for 4.1 & 4.1.2 using a clean install booting from a USB memory stick, I haven’t tried it with 4.2 yet.

Install the three pets created by Rerwin:
3G_pupdial-wireless-11.pet
option-patched-01April09-k2.6.25.16.pet
usb_modeswitch-1.0.2.pet

Reboot with dongle inserted, it should be automatically detected at ttyUSB0. I also used the PROBE function in Pupdial to set-up the initialisation strings but this may be unnecessary.

The only setting that seems to be required in Pupdial is the phone number *99# all other settings are default. The modem speed setting seems to be immaterial but I’d be interested to know what others find? Then just click connect, it really is that simple. Don’t make my mistake of spending hours trying to get a connection when the network wasn’t there (no carrier) make sure the dongle LEDs indicate a network is present (I didn’t read the manual!) I live in the sticks and can only get a good GPRS signal upstairs, if I want 3G I have to drive to a hill a few miles away, bring on 900MHz UMTS!

I didn’t need to activate the dongle in Windows before using it although its SIM was put in a Vodafone phone first, as I gleaned this cunning method of checking / topping up the SIM balance from the Ubuntu forum:

To register dongle with Vodafone, put its SIM card into a Vodafone or unlocked phone and dial *#100# to determine the SIM ‘phone number’.

You can then register on the PAYG section of the UK Vodafone website using this number. Leave the SIM in the phone as they will text you a security code which has to be entered into the website within 20 minutes. You can then simply check / top-up your balance on the website using the dongle phone number although I haven’t had to top-up yet.

Kudos to everyone for making Pupdial so easy to use.

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#234 Post by kultex »

sorry for the delay, but I had absolute no time.

There are several things:

I installed also the 3G_pupdial-wireless-11-patch1.pet

The result is, that the modem is detected if I press the probe button in PupDial, but when I try to connect to the internet, the dialog tells: No modem found.

But the result of installing the 3G_pupdial-wireless-11-patch1.pet was, that I do not come to the internet any more with my installed version of puppy. Until now, it was possible, that I connect using "modprobe usbserial vendor=0x12d1 product=0x1003" and pupdial - but only one time - when I try to connect a second time - there is an error with the the pin - here the whole code - first the connection

Code: Select all

--> WvDial: Internet dialer version 1.41
--> Initializing modem.
--> Sending: AT+CPIN=9624
AT+CPIN=9624
OK
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CGDCONT=1,"IP","drei.at"
AT+CGDCONT=1,"IP","drei.at"
OK
--> Modem initialized.
--> Sending: ATDT *99#
--> Waiting for carrier.
ATDT *99#
CONNECT
--> Carrier detected.  Waiting for prompt.
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Mon Aug  3 10:37:55 2009
--> Disconnecting at Mon Aug  3 11:00:50 2009
Caught signal #15!  Attempting to exit gracefully...
and the reconnection:

Code: Select all

--> WvDial: Internet dialer version 1.41
--> Initializing modem.
--> Sending: AT+CPIN=9624
AT+CPIN=9624
+CME ERROR: operation not allowed
--> Bad init string.
Now I get the +CME ERROR immediatly and can only connect from my usbstick.
Attachments
huawei-E220-3.tar.gz
(3.54 KiB) Downloaded 404 times

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

It's Payoff Time for your Feedback!

#235 Post by rerwin »

kultex, uhhu, zgp152, tattrat, grahamcumming, Bill Adam, and others:
In response to several of your postings, I have created another patch to accommodate some of your needs.

1. The module-loading fix from the first patch is included, so that more of the Huawei and Sierra modems get detected, including the E220 and E169.

2. The PIN code is issued only on the first dial-up connection after a boot-up or after "testing" the modem with the "tty---0" button. If a connection gets aborted because the PIN causes a "bad string" error, simply disconnect and connect again. If you eventually need to re-issue the PIN, click on the "tty---0" button and connect to the Internet again.

3. For users who must edit the wvdial.conf file to change the Dial String dial type from DT (tone) to DP (pulse), the setting is now retained. I assume the need for this is rare, but will add it as a PupDial check-box if I receive reports that it is more common.

4. I have been concerned that the APN gets used for both dialup accounts. In case different connections use different APNs, or one account does not. I have moved the APN field into each of the account boxes. I envision using a wire-line analog modem when possible, but sometimes using a wireless modem when traveling. This change allows you to set up both accounts and simply plug or unplug the wireless modem, probe-ERASE, and reboot.

My intent is to submit this patch for the next puppy beta release; so please get back to me quickly with any difficulties or successes with the patch. Thanks.

Regarding rebooting to switch modems: I am working on an improvement so that the wireless modem will prevail if there is also an active built-in modem present. Currently, the built-in modem may need to be disabled in the BIOS, to have the wireless modem be detected. My planned fix should make it simpler to switch back and forth.
Richard
Attachments
3G_pupdial-wireless-11-patch2.pet
Fixes for wireless-modem module loading, PINs, and APNs, as well as pulse-dialing.
(13.53 KiB) Downloaded 480 times

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#236 Post by kultex »

nothing changed - see attachment, but I found a line in the usb_modeswich.log, which cached my interest:

Code: Select all

DetachStorageOnly=0
because when I mounted the device with ivman, it was: /usr/local/bin/usb_modeswitch -v 12d1 -p 1003 -d 1

and if you look to the usb_modeswich.conf, there is also:

# Huawei E220 (aka "Vodafone EasyBox II", aka "T-Mobile wnw Box Micro")
# Huawei E230
# Huawei E270
# Huawei E870
# and probably most other Huawei devices (just adapt product ID)
#
# Two options: 1. removal of "usb-storage" 2. the special control

# message found by Miroslav Bobovsky
#
# Contributor: Hans Kurent, Denis Sutter, Vincent Teoh

;DefaultVendor= 0x12d1;
;DefaultProduct= 0x1003

# choose one of these:
;DetachStorageOnly=1
;HuaweiMode=1

it is described: Two options: 1. removal of "usb-storage" 2. the special control - if you do not do the removal of "usb-storage", then the special control is not working - as long as the cdrom is mounted, it will not work - but I did not find, what is doing this DetachStorageOnly=0
Attachments
huawei-E220-4.tar.gz
(3.82 KiB) Downloaded 411 times

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#237 Post by rerwin »

kultex,
nothing changed
That sounds good, considering that the new patch has the same module-loading fix as in patch1 (except that the "MODULES" line is no longer logged). The differences I expect you to see is a different appearance to the pupdial window and better behavior with the PIN. The PIN should work the first time you connect after boot-up, but should not cause trouble on subsequent connections to the Internet. Did you notice either of those changes?

BTW, the logs show that you were using the new patch. But I rely on your report as to what happened with pupdial.

Regarding
# choose one of these:
;DetachStorageOnly=1
;HuaweiMode=1
I take that to mean that either is sufficient and both are not recommended. I chose the HuaweiMode because it is specifically for the Huawei modems and probably includes the detachment. Since it appeared to work for you as-is, I see no further problem. Right?

Thanks for continuing to help me with my refinements.
Richard

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#238 Post by mikeb »

Hey Rewin

just to say thanks on behalf of the many that your hard work on this project has helped :)

mike

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#239 Post by kultex »

nothing changed means, that I can not connect to the Internet with usb_modswitch and your patches - I only can connect with my usb-stick and

rmmod usb-storage
modprobe usbserial vendor=0x12d1 product=0x1003

with or without the patch, the modem is not switching. No detection of the modem.

In ivman I had to do both, that the modem worked with usb_modeswitch - the whole script was:

Code: Select all

if [ "`/usr/sbin/lsusb | grep 12d1 | cut -d : -f3 | cut -b -4`" = "1003" ]; then
/usr/local/bin/usb_modeswitch -v 12d1 -p 1003 -d 1
/usr/local/bin/usb_modeswitch -v 12d1 -p 1003 -H 1
fi 
original posted here: http://fluxflux.net/fluxflux-eee/umts.html

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#240 Post by rerwin »

kultex,
Sorry, I misunderstood. My interpretation of the logs is that the modem is initially already switched, evidenced by the trace lines showing the parameter "icff", where the ff means modem mode. Later I see traces for the non-modem (storage) mode. The sequence baffles me. Your log with the MODULES line tells me that the modem driver, option, must have been loaded. Otherwise we would see the line in an earlier log showing both option and usb_storage in the same MODULES line.

I infer from the log that the switch does not occur because it is already done. I believe both patches address the problem I suspected. You could verify that by doing a "lsmod" to see if the "option" module is listed (as being loaded), even if the modem is not shown as detected. Maybe there is yet another bug somewhere. Just to be sure there is a real problem, please reboot after the first nondetection. I suspect a timing issue, where things don't get set up in a timely manner the first time, but things straighten out the second bootup. Do this without any command line activity.

I am assuming no other modem is getting detected. However, I do see a sound card modem in the logs. If you haven't already done so, try disabling the built-in modem in the BIOS, then retry your tests.

I am out of time for the next few days, so we will need to resume this effort on Monday. And I thought we were so close! Thanks for persevering.
Richard

mikeb,
Thank you for your encouragement. R

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#241 Post by kultex »

there is no possibility in the bios to disable the modem and the other modem is not detected, when I press probe of pubdial - I also do not see it in dmesg

I did reboot several times with doing something and noting, before I took the logs.

and here is the output of lsmod:

Code: Select all

# lsmod
Module                  Size  Used by
snd_pcm_oss            40992  0 
snd_seq_dummy           3844  0 
snd_seq_oss            31360  0 
snd_seq_midi_event      7168  1 snd_seq_oss
snd_seq                47952  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device          8204  3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_mixer_oss          16640  1 snd_pcm_oss
serio_raw               6788  0 
ipw2100                71344  0 
e100                   34828  0 
ieee80211              33992  1 ipw2100
mii                     5504  1 e100
ieee80211_crypt         5632  1 ieee80211
snd_intel8x0           32796  0 
snd_ac97_codec         97952  1 snd_intel8x0
pcspkr                  2944  0 
ac97_bus                1920  1 snd_ac97_codec
snd_pcm                73736  3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec
snd_timer              22276  2 snd_seq,snd_pcm
snd                    52772  9 snd_pcm_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer
video                  19472  0 
soundcore               7520  1 snd
output                  3840  1 video
snd_page_alloc         10376  2 snd_intel8x0,snd_pcm
intel_agp              26812  1 
agpgart                33584  1 intel_agp
fan                     5508  0 
evdev                  11776  1 
battery                12932  0 
thermal                18716  0 
ac                      5892  0 
processor              32816  2 thermal
button                  8080  0 
fuse                   48284  0 
aufs                  150040  1 
nls_iso8859_1           4096  0 
nls_cp437               5760  0 
usbhid                 29696  0 
usb_storage            85952  0 
ehci_hcd               33932  0 
uhci_hcd               23820  0 
usbcore               136560  5 usbhid,usb_storage,ehci_hcd,uhci_hcd
squashfs               45960  1 
sqlzma                  3972  1 squashfs
unlzma                  4736  1 sqlzma
yenta_socket           26252  1 
rsrc_nonstatic         12928  1 yenta_socket
and believe me - DetachStorageOnly must be 1

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#242 Post by kultex »

I found something: did you reed this?

http://www.draisberghof.de/usb_modeswitch/#trouble

kultex
Posts: 39
Joined: Sat 17 Nov 2007, 19:46

#243 Post by kultex »

I found the udev rule where I could change to usb_modeswitch -v 12d1 -p 1003 -d 1 - no difference - the device is still mounted as cdrom - as desicribed in the troubleshooting, I think it is a kernel problem - did you alredy ask in the modswich forum - you are more in than me .....

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#244 Post by rerwin »

kultex,
Thanks for following up on this. I am about to leave for the weekend and will be out of touch.

Now that you have found the udev rule, you might try in separate tests (1) putting both -d 1 and -H 1 in that rule, and (2) duplicating the rule and making the first use -d and the second -H. The first would be most elegant, if it works. Also, try unplugging and replugging the modem after the second bootup. Also try using pupdial probe-ERASE before a reboot, just to clean things up.

I am discouraged that you don't see option in the lsmod. This is going to take some rethinking -- next week.
Richard

User avatar
droope
Posts: 801
Joined: Fri 01 Aug 2008, 00:17
Location: Uruguay, Mercedes

#245 Post by droope »

Hi.

My modem is a ZTE MF 636, which is not in the listing. Do you reckon that if I installed all the pets on this thread it will be detected as a modem?

Cheers,
Droope

I'll start googling, in the meantime you enjoy the weekend ;)
What seems hard is actually easy, while what looks like impossible is in fact hard.

“Hard things take time to do. Impossible things take a little longer.â€￾ –Percy Cerutty

[url=http://droope.wordpress.com/]Mi blog[/url] (Spanish)

Post Reply