You are not logged in.

#1 2009-06-16 06:39:05

teMplaryum
Member
From: Serbia
Registered: 2007-09-11
Posts: 30
Website

[SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

I followed the instructions on the wiki on how to setup this modem (it was recognized as is, I just modified hal and udev rules). I set the wvdial.conf and tried to connect first as a normal, then as superuser. I get the famous:

> > Cannot open /dev/ttyUSB0: Device or resource busy

message. Any ideas? I tried changing permissions on /dev/tts/USB0 (/dev/ttyUSB0 links there), but in vain. I'll put more info if needed (typing this from my Win XP installation, as this is the only way to get the net running sad ).[SOL

Last edited by teMplaryum (2009-06-18 11:38:24)


Online at:
Twit | Facebook | Blog

Registered Linux user #469726

Offline

#2 2009-06-16 08:12:06

metromini
Member
From: Jakarta, Indonesia
Registered: 2005-08-02
Posts: 39

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Do you see /dev/ttyUSB0 and /dev/ttyUSB1 ?

This is my wvdial.conf for huawei E220 for comparing..

[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 3600000
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 =
Area Code =
Phone = *99#
Username = [your username here]
Password = [your password here]
Dial Command = ATDT
Stupid Mode = 1
Force Address =

Offline

#3 2009-06-16 09:38:07

ijanos
Member
From: Budapest, Hungary
Registered: 2008-03-30
Posts: 443
Website

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Also, you could try umtsmon. It works well with that modem.

Offline

#4 2009-06-16 09:45:30

teMplaryum
Member
From: Serbia
Registered: 2007-09-11
Posts: 30
Website

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Yeah, I have ttyUSB1 and ttyUSB2 as well. I don't think the problem is within wvdial.conf, because modem won't even initialize, it's more probable it's some kind of permission issue. It's worth to mention, I also tried wvdialconf, and it fails to detect any modems, the same error appears (device or resource busy).

@ijanos: I'll try that one, thanks.


Online at:
Twit | Facebook | Blog

Registered Linux user #469726

Offline

#5 2009-06-16 14:48:32

Wittfella
Member
From: Australia
Registered: 2008-05-27
Posts: 462

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Hey, I just recently went through this and it nearly drove me nuts, had the 'device busy' problem even for root.  After many, many days and several aneurysms I finally found my problem, maybe this will help you too.

It turned out that wvdial tries to create a lock file for the usb device in '/var/lock', but for some reason when I looked in '/var' I had no 'lock' directory. I checked my other Arch machine and it has a '/var/lock' directory, so I'm not sure where this one disappeared to. 

Soon as I created '/var/lock' wvdial worked perfectly.  Hope this helps you out.

Cheers,
Wittfella

Last edited by Wittfella (2009-06-16 15:45:48)

Offline

#6 2009-06-18 09:17:00

teMplaryum
Member
From: Serbia
Registered: 2007-09-11
Posts: 30
Website

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Wittfella wrote:

Hey, I just recently went through this and it nearly drove me nuts, had the 'device busy' problem even for root.  After many, many days and several aneurysms I finally found my problem, maybe this will help you too.

It turned out that wvdial tries to create a lock file for the usb device in '/var/lock', but for some reason when I looked in '/var' I had no 'lock' directory. I checked my other Arch machine and it has a '/var/lock' directory, so I'm not sure where this one disappeared to. 

Soon as I created '/var/lock' wvdial worked perfectly.  Hope this helps you out.

Cheers,
Wittfella

Cheers to you, mate! It worked like a charm, typing from my Arch box! You've got yourself a free beer (if you ever find yourself in Serbia, that is big_smile). I'd never think of that, you are probably the only one who can understand the amount of work you got me rid of.

Ok, now I only have to find out how to run it as a regular user. ls -Al /dev/tts yields:

total 0
crw-rw---- 1 root uucp   4, 64 2009-06-18 11:04 0
crw-rw---- 1 root uucp   4, 65 2009-06-18 11:04 1
crw-rw---- 1 root uucp   4, 66 2009-06-18 11:04 2
crw-rw---- 1 root uucp   4, 67 2009-06-18 11:04 3
crw-rw---- 1 root uucp 188,  0 2009-06-18 11:05 USB0
crw-rw---- 1 root uucp 188,  1 2009-06-18 11:04 USB1
crw-rw---- 1 root uucp 188,  2 2009-06-18 11:04 USB2

ls -Al /dev/ttyU*

lrwxrwxrwx 1 root root 8 2009-06-18 11:04 /dev/ttyUSB0 -> tts/USB0
lrwxrwxrwx 1 root root 8 2009-06-18 11:04 /dev/ttyUSB1 -> tts/USB1
lrwxrwxrwx 1 root root 8 2009-06-18 11:04 /dev/ttyUSB2 -> tts/USB2

I changed the group for /etc/resolv.conf, thought it may help, but it didn't. ls -Al /etc/resolv.conf:

-rw-r--r-- 1 root uucp 30 2009-06-12 13:37 /etc/resolv.conf

(the group changes back to default root group as soon as I use wvdial as a root). And, finally, my id:

uid=1000(templaryum) gid=100(users) groups=7(lp),10(wheel),14(uucp),33(http),50(games),90(network),91(video),92(audio),93(optical),95(storage),97(camera),98(power),100(users),108(vboxusers)

and yet I get this when I wvdial as a normal user:

--> WvDial: Internet dialer version 1.60
--> Cannot open /dev/ttyUSB0: Device or resource busy
--> Cannot open /dev/ttyUSB0: Device or resource busy
--> Cannot open /dev/ttyUSB0: Device or resource busy

Any ideas?

Last edited by teMplaryum (2009-06-18 10:22:14)


Online at:
Twit | Facebook | Blog

Registered Linux user #469726

Offline

#7 2009-06-18 11:37:40

teMplaryum
Member
From: Serbia
Registered: 2007-09-11
Posts: 30
Website

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Ok, I have finally solved all the problems and I have no trouble connecting now.

Here's what I had to do:

- As Wittfella suggested, wvdial could not write to /var/lock since it did not exist at all. So I had to:

# mkdir /var/lock

- Now wvdial (supplied with correct /etc/wvdial.conf, of course) could estabilish a connection when run as root. I wanted to use wvdial as a regular user, so I googled a bit, and found a better sollution. I could use NetworkManager 0.7 to manage my connection, all I had to do was to ensure NetworkManager detects the modem right (which is where HAL jumps in) and set up a Mobile Broadband connection under System -> Preferences -> Network Connections (GNOME). Modem detection is done via HAL, which scans /usr/share/hal/fdi/information/10freedesktop/10-modem.fdi to identify the vendor and the model. This is the relevant part:

 <!-- E220,E220bis -->
        <match key="@info.parent:usb.product_id" int_outof="0x1003;0x1004">
          <match key="@info.parent:usb.interface.number" int="0">
            <match key="@info.parent:usb.interface.class" int="0xff">
              <match key="@info.parent:usb.interface.subclass" int="0xff">
                <match key="@info.parent:usb.interface.protocol" int="0xff">
                  <append key="modem.command_sets" type="strlist">GSM-07.07</append>
                  <append key="modem.command_sets" type="strlist">GSM-07.05</append>
                </match>
              </match>
            </match>
          </match>
        </match>

So, HAL fills the key modem.command_sets with appropriate strings once my type of modem has been found. Obviously, my modem was not detected right, because lshal output did not show modem.command_sets key at all.

- After spending some time looking for culprits, I had found out that two files included in the tar archive from the wiki setup guide (http://wiki.archlinux.org/index.php/Huawei_E220) were to blame, 10-huawei-e220.fdi and 50-huawei-e220.rules specifically. The setup script (also included in the archive) installs the HAL and Udev rules which help identify the modem right, and, in a way, these two prevent HAL from setting the modem.command_sets key. I found out my Huawei E220 is detected with no problems even without these two files, so I simply deleted them, which resulted in correct key, like the lshal output shows:

modem.command_sets = {'GSM-07.07', 'GSM-07.05'} (string list)

In a moment, I had a working Internet connection with NetworkManager big_smile (with no permission issues at all).

I will update the wiki with these additional information on how to set up a Huawei E220 with NetworkManager once I had more free time (you can also update it yourselves if you feel like it).

Thank you for your suggestions! I love this community smile.


Online at:
Twit | Facebook | Blog

Registered Linux user #469726

Offline

#8 2010-06-09 00:50:19

dejavu
Member
Registered: 2008-05-26
Posts: 103

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

It seems that it isn't fixed..., a year later?!

I had also to create just an empty folder /var/lock and now the hsdpa modem is working...

Last edited by dejavu (2010-06-09 00:52:41)

Offline

#9 2010-06-09 17:06:01

Cape
Member
From: Mogliano Veneto, Italy
Registered: 2008-11-15
Posts: 103

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Have you installed modemmanager?  (opt depends of networkmanager)

extra/modemmanager 0.3-2 [0.12 MB]
    Mobile broadband modem management service

It's one of those little daemon started by networkmanager-dispatcher that automatically create the lock file and set up modem specific parameters alone. With that i had 100% out-of-the-box compatibility with both huawei and ZTE MF627.

Last edited by Cape (2010-06-09 17:14:29)

Offline

#10 2010-06-10 01:53:44

hume's doona
Member
Registered: 2009-12-11
Posts: 206

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

from the wiki

As normal users can't use wvdial to dial a ppp conection by default, change permissions:

chmod u+s /usr/bin/wvdial

You should see the following permissions:

ls -l /usr/bin/wvdial
-rwsr-xr-x  1 root root 114368 2005-12-07 19:21 /usr/bin/wvdial

/etc/wvdial.conf

[dialer defaults]
Modem = /dev/ttyUSB0
 Baud = 460800
 Init2 = ATZ 
 Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
 ISDN = 0 
 Modem Type = Analog Modem
Phone = *99#
 Username = *
 Password = *
 New PPPD = yes
Stupid Mode = yes

mine works on netbook and macbook pro [64 bit] without super user rights needed

Offline

#11 2010-06-10 16:08:57

dejavu
Member
Registered: 2008-05-26
Posts: 103

Re: [SOLVED] HSDPA Huawei E220 and wvdial: Device or resource busy

Cape wrote:

Have you installed modemmanager?  (opt depends of networkmanager)

Sure, I have installed it.

It has annoyed me a little bit, just cause an empty folder. ;-)

Offline

Board footer

Powered by FluxBB