Hi all,
I was recently asked to get a 3G ZTE 633 modem (not in stores) to connect to the internet whenever it was plugged in. I had it successfully working on my Ubuntu Gutsy Gibbon machine but it does not work on Fedora 10 which is where it is required to work.
When the 3G modem is plugged in I use a Udev rule to run usb_modeswitch which changes it from being in usb storage mode to being in modem mode. This part works fine.
I then run a second udev rule (on the modem device), this should run a script which connects to the internet. Unfortunately it falls over here. The script does run but it will not connect. However if I run the script manually from root it works fine. I guess that it is a permissions issue.
The device permissions are:
crw-rw---- 1 root uucp 188, 0 2009-04-26 11:31 ttyUSB0
crw-rw---- 1 root uucp 188, 1 2009-04-26 11:31 ttyUSB1
crw-rw---- 1 root uucp 188, 2 2009-04-26 11:31 ttyUSB2
The script and script folders permissions are:
drwxrwxrwx 2 root root 4.0K 2009-04-26 11:46 .
drwxr-xr-x 23 root root 4.0K 2009-04-26 11:13 ..
-rwxr-xr-x 1 root root 95 2009-04-26 11:46 run_internet
One thing to note is that there are three udev devices associated with the modem. They are ttyUSB0, ttyUSB1 and ttyUSB2. I use ttyUSB2 to talk to the modem when connecting.
Here are the files you may need to help me. If you require any more let me know:
The first udev rule:
SUBSYSTEM=="usb", SYSFS{idProduct}=="2000", SYSFS{idVendor}=="19d2", RUN+="/usr/bin/usb_modeswitch"
The second udev rule:
SUBSYSTEM=="usb", SYSFS{idProduct}=="0031", SYSFS{idVendor}=="19d2", MODE="0666", RUN+="/outputs/run_internet"
The script:
#!/bin/bash
/bin/echo script
/usr/bin/wvdial &
cp -f /etc/telstra_resolv.conf /etc/resolv.conf
The wvdial config file:
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = ATS7=60 S30=0 S0=0
Init4 = AT+CGDCONT=1,"IP","telstra.internet"
Modem Type = Analog Modem
Baud = 9600
New PPPD = no
Modem = /dev/ttyUSB2
ISDN = 0
Dial Command=ATD
Phone = *99#
Password =
user@bigpond.com
Username = password
Stupid Mode = 1
So what am I missing? I suppose it is related to device permissions. Why does the "mode" command not work? With what rights do udev rules run?
Thanks for your help
Jared