Integration of 3G Wireless Modem Detection - 4.1.2 & 4.2.1

A home for all kinds of Puppy related projects
Message
Author
User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#221 Post by dejan555 »

Hey rerwin, there are some puppy releases now with 2.6.30 kernel, like barry's 417 alpha or dpup, would it be clever testing 626 on those pups? I think i read that kernel has better support for it?
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#222 Post by 01micko »

Hello Richard

Well I've been testing the latest Puppy 417 alpha today and I am happy to report that the Heuwei 169 with Virgin Broadband Australia works almost OOTB. I say almost because I had to add the '-chap' option to /etc/ppp/options file. I read that from a fellow Virgin user earlier in this thread, (thanks :wink: ). I had also read this somewhere on the net when I was trying to get that modem working with the stock xandros OS in this machine. This is on my EEE 701sd pc with Puppy 417 k2.6.25.16.

I did try with the k2.6.30.1 kernel version but I had to try and force the module (option) to load but it wouldn't. Maybe more work needs to be done there. Pupdial would not see the modem.

Posting from the eee pc now. I just accepted most of the defaults in pupdial, except unchecked busy and dial tone, carrier check was already unchecked. I left the baud at 9600. The modem says it is connected at 720000 and it does seem very fast. I entered my APN, no pin, my username (I don't think it was needed), oh, and the isp ph number, left password alone.

After a couple of failures I thought I would try the '-chap' option. That did the trick.

Thankyou for your work.

Mick
Puppy Linux Blog - contact me for access

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

#223 Post by rerwin »

dejan555,
Go for it! Barry has picked up the 3G stuff for his alphas, so you should be able to run under his newest. This assumes he has recompiled all the drivers for 2.6.30.

01micko,
Thanks for that good news! I am considering squeezing in a "No CHAP" check-box between the APN and PIN fields in PupDial. That would avoid adding logic specific to virginbroadband. But that will make those other fields shorter.
Richard

User avatar
zgp152
Posts: 114
Joined: Thu 08 Nov 2007, 19:37

#224 Post by zgp152 »

rerwin wrote:zgp152,
I have seen reports that the entire PIN thing can be disabled in the modem, under Windows, so that the PIN is not needed under Linux. Is that an option for your customer? Or do they need the security of PIN protection?

Maybe there is a better way to implement the PIN issuance. I cannot get to it immediately, but if I can depend on your testing help, I would like to try setting the PIN information before starting wvdial. If that works, I can rip out the logic about reserving Init1 for the PIN. It would certainly be a better technique.
Richard
The PC in question does not have working Windows. It would be necessary to use the dongle with another PC elsewhere. PIN is not a security issue, it just complicates the login and is an inconvenience.

Could you arrange the testing of the improved initilization with someone else, please. The PC is in normal use and I do not wish to disturb the existing condition unless you have a well tested tested pet file to install over the existing one.

Rgds
zgp152

underlines words corrected zgp152
Last edited by zgp152 on Tue 21 Jul 2009, 15:49, edited 1 time in total.

uhhu
Posts: 20
Joined: Sun 24 May 2009, 21:14

#225 Post by uhhu »

zgp152 wrote:
rerwin wrote:zgp152,
I have seen reports that the entire PIN thing can be disabled in the modem, under Windows, so that the PIN is not needed under Linux. Is that an option for your customer? Or do they need the security of PIN protection?
The PC in question does not have working Windows. It would be necessary to use the dongle with another PC elsewhere. PIN is not a security issue, it just complicates the login and is an inconvenience.
I do not know if this works:
  • Remove the SIM from the dongle.
    Insert the SIM into a cell phone.
    Disable the PIN.

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

Post Reply