Skip to main content

Thread: udev rules for Sierra 598u


i have sprint sierra wireless 598u working on 8.10 using wvdial. issue card changes ttyusb# on @ bootup wvdial cant find it. have set out create udev rule device. registers 4 identical ttyusb# devices. want set things whatever gets registered has symbolic link /dev/ttys30 wvdial can merely pointed /dev/ttys30 time. in example below modem put @ ttyusb2 in particular boot up. want ttyusb2 linked /dev/ttys30.

code:
 dmesg | grep tty  [   10.209587] usb 1-1: ftdi usb serial device converter attached ttyusb0  [   10.290005] usb 2-1: pl2303 converter attached ttyusb1  [   12.688059] usb 1-2: sierra usb modem converter attached ttyusb2  [   12.688183] usb 1-2: sierra usb modem converter attached ttyusb3  [   12.688288] usb 1-2: sierra usb modem converter attached ttyusb4  [   12.688395] usb 1-2: sierra usb modem converter attached ttyusb5
my output
udevinfo -a -p $(udevinfo -q path -n /dev/ttyusb2) > ttyusb2.info

code:
udevinfo starts device specified devpath ,  walks chain of parent devices. prints every device  found, possible attributes in udev rules key format.  rule match, can composed attributes of device  , attributes 1 single parent device.      looking @ device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/ttyusb2/tty/ttyusb2':      kernel=="ttyusb2"      subsystem=="tty"      driver==""      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/ttyusb2/tty':      kernels=="tty"      subsystems==""      drivers==""      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/ttyusb2':      kernels=="ttyusb2"      subsystems=="usb-serial"      drivers=="sierra"      attrs{suspend_status}=="0"      attrs{port_number}=="0"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0':      kernels=="1-2:1.0"      subsystems=="usb"      drivers=="sierra"      attrs{binterfacenumber}=="00"      attrs{balternatesetting}==" 0"      attrs{bnumendpoints}=="09"      attrs{binterfaceclass}=="ff"      attrs{binterfacesubclass}=="ff"      attrs{binterfaceprotocol}=="ff"      attrs{modalias}=="usb:v1199p0025d0003dc00dsc00dp00icffiscffipff"      attrs{interface}=="data interface"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2':      kernels=="1-2"      subsystems=="usb"      drivers=="usb"      attrs{configuration}==""      attrs{bnuminterfaces}==" 2"      attrs{bconfigurationvalue}=="1"      attrs{bmattributes}=="a0"      attrs{bmaxpower}=="500ma"      attrs{urbnum}=="3465"      attrs{idvendor}=="1199"      attrs{idproduct}=="0025"      attrs{bcddevice}=="0003"      attrs{bdeviceclass}=="00"      attrs{bdevicesubclass}=="00"      attrs{bdeviceprotocol}=="00"      attrs{bnumconfigurations}=="1"      attrs{bmaxpacketsize0}=="64"      attrs{speed}=="12"      attrs{busnum}=="1"      attrs{devnum}=="7"      attrs{version}==" 1.10"      attrs{maxchild}=="0"      attrs{quirks}=="0x0"      attrs{authorized}=="1"      attrs{manufacturer}=="sierra wireless, incorporated"      attrs{product}=="sierra wireless usb 598"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1':      kernels=="usb1"      subsystems=="usb"      drivers=="usb"      attrs{configuration}==""      attrs{bnuminterfaces}==" 1"      attrs{bconfigurationvalue}=="1"      attrs{bmattributes}=="e0"      attrs{bmaxpower}=="  0ma"      attrs{urbnum}=="110"      attrs{idvendor}=="1d6b"      attrs{idproduct}=="0001"      attrs{bcddevice}=="0206"      attrs{bdeviceclass}=="09"      attrs{bdevicesubclass}=="00"      attrs{bdeviceprotocol}=="00"      attrs{bnumconfigurations}=="1"      attrs{bmaxpacketsize0}=="64"      attrs{speed}=="12"      attrs{busnum}=="1"      attrs{devnum}=="1"      attrs{version}==" 1.10"      attrs{maxchild}=="2"      attrs{quirks}=="0x0"      attrs{authorized}=="1"      attrs{manufacturer}=="linux 2.6.27-14-generic uhci_hcd"      attrs{product}=="uhci host controller"      attrs{serial}=="0000:00:1d.0"      attrs{authorized_default}=="1"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0':      kernels=="0000:00:1d.0"      subsystems=="pci"      drivers=="uhci_hcd"      attrs{vendor}=="0x8086"      attrs{device}=="0x27c8"      attrs{subsystem_vendor}=="0x1462"      attrs{subsystem_device}=="0x7265"      attrs{class}=="0x0c0300"      attrs{irq}=="23"      attrs{local_cpus}=="ffffffff,ffffffff"      attrs{local_cpulist}=="0-63"      attrs{modalias}=="pci:v00008086d000027c8sv00001462sd00007265bc0csc03i00"      attrs{broken_parity_status}=="0"      attrs{msi_bus}==""      looking @ parent device '/devices/pci0000:00':      kernels=="pci0000:00"      subsystems==""      drivers==""
output from
udevinfo -a -p $(udevinfo -q path -n /dev/ttyusb3) > ttyusb3.info

code:
udevinfo starts device specified devpath ,  walks chain of parent devices. prints every device  found, possible attributes in udev rules key format.  rule match, can composed attributes of device  , attributes 1 single parent device.      looking @ device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/ttyusb3/tty/ttyusb3':      kernel=="ttyusb3"      subsystem=="tty"      driver==""      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/ttyusb3/tty':      kernels=="tty"      subsystems==""      drivers==""      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0/ttyusb3':      kernels=="ttyusb3"      subsystems=="usb-serial"      drivers=="sierra"      attrs{suspend_status}=="0"      attrs{port_number}=="1"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2/1-2:1.0':      kernels=="1-2:1.0"      subsystems=="usb"      drivers=="sierra"      attrs{binterfacenumber}=="00"      attrs{balternatesetting}==" 0"      attrs{bnumendpoints}=="09"      attrs{binterfaceclass}=="ff"      attrs{binterfacesubclass}=="ff"      attrs{binterfaceprotocol}=="ff"      attrs{modalias}=="usb:v1199p0025d0003dc00dsc00dp00icffiscffipff"      attrs{interface}=="data interface"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1/1-2':      kernels=="1-2"      subsystems=="usb"      drivers=="usb"      attrs{configuration}==""      attrs{bnuminterfaces}==" 2"      attrs{bconfigurationvalue}=="1"      attrs{bmattributes}=="a0"      attrs{bmaxpower}=="500ma"      attrs{urbnum}=="3495"      attrs{idvendor}=="1199"      attrs{idproduct}=="0025"      attrs{bcddevice}=="0003"      attrs{bdeviceclass}=="00"      attrs{bdevicesubclass}=="00"      attrs{bdeviceprotocol}=="00"      attrs{bnumconfigurations}=="1"      attrs{bmaxpacketsize0}=="64"      attrs{speed}=="12"      attrs{busnum}=="1"      attrs{devnum}=="7"      attrs{version}==" 1.10"      attrs{maxchild}=="0"      attrs{quirks}=="0x0"      attrs{authorized}=="1"      attrs{manufacturer}=="sierra wireless, incorporated"      attrs{product}=="sierra wireless usb 598"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0/usb1':      kernels=="usb1"      subsystems=="usb"      drivers=="usb"      attrs{configuration}==""      attrs{bnuminterfaces}==" 1"      attrs{bconfigurationvalue}=="1"      attrs{bmattributes}=="e0"      attrs{bmaxpower}=="  0ma"      attrs{urbnum}=="110"      attrs{idvendor}=="1d6b"      attrs{idproduct}=="0001"      attrs{bcddevice}=="0206"      attrs{bdeviceclass}=="09"      attrs{bdevicesubclass}=="00"      attrs{bdeviceprotocol}=="00"      attrs{bnumconfigurations}=="1"      attrs{bmaxpacketsize0}=="64"      attrs{speed}=="12"      attrs{busnum}=="1"      attrs{devnum}=="1"      attrs{version}==" 1.10"      attrs{maxchild}=="2"      attrs{quirks}=="0x0"      attrs{authorized}=="1"      attrs{manufacturer}=="linux 2.6.27-14-generic uhci_hcd"      attrs{product}=="uhci host controller"      attrs{serial}=="0000:00:1d.0"      attrs{authorized_default}=="1"      looking @ parent device '/devices/pci0000:00/0000:00:1d.0':      kernels=="0000:00:1d.0"      subsystems=="pci"      drivers=="uhci_hcd"      attrs{vendor}=="0x8086"      attrs{device}=="0x27c8"      attrs{subsystem_vendor}=="0x1462"      attrs{subsystem_device}=="0x7265"      attrs{class}=="0x0c0300"      attrs{irq}=="23"      attrs{local_cpus}=="ffffffff,ffffffff"      attrs{local_cpulist}=="0-63"      attrs{modalias}=="pci:v00008086d000027c8sv00001462sd00007265bc0csc03i00"      attrs{broken_parity_status}=="0"      attrs{msi_bus}==""      looking @ parent device '/devices/pci0000:00':      kernels=="pci0000:00"      subsystems==""      drivers==""
as can see devices same except
kernels
attrs{port_number}
attrs{urbnum}

first variable original problem, not useful rule making. if use port_number rule, machine locks when reset udev. attrs{urbnum} seems randomly assigned value, not useful rule making. think need make bash script pass name, cannot find unique amongst sierra devices find 1 actual modem. have found examples ls

here current rules. first 2 work great. last 1 doesnt useful since symbolic link location still changes different ttyusb# numbers.

code:
cat /etc/udev/rules.d/50-local.rules  kernel=="ttyusb?", attrs{idproduct}=="6001", attrs{manufacturer}=="ftdi", symlink+="ttys20"  kernel=="ttyusb?", attrs{idproduct}=="2303", attrs{manufacturer}=="prolific technology inc.", symlink+="ttys21"  kernel=="ttyusb*", attrs{product}=="sierra wireless usb 598", symlink+="ttys3%n"
code:
ls -l /dev/ttys*  crw-rw---- 1 root dialout 4, 64 2009-10-27 14:47 /dev/ttys0  crw-rw---- 1 root dialout 4, 65 2009-10-27 14:47 /dev/ttys1  crw-rw---- 1 root dialout 4, 66 2009-10-27 14:47 /dev/ttys2  lrwxrwxrwx 1 root root        7 2009-10-27 14:47 /dev/ttys20 -> ttyusb0  lrwxrwxrwx 1 root root        7 2009-10-27 15:14 /dev/ttys21 -> ttyusb1  crw-rw---- 1 root dialout 4, 67 2009-10-27 14:47 /dev/ttys3  lrwxrwxrwx 1 root root        7 2009-10-27 15:07 /dev/ttys32 -> ttyusb2  lrwxrwxrwx 1 root root        7 2009-10-27 15:07 /dev/ttys33 -> ttyusb3  lrwxrwxrwx 1 root root        7 2009-10-27 15:07 /dev/ttys34 -> ttyusb4  lrwxrwxrwx 1 root root        7 2009-10-27 15:07 /dev/ttys35 -> ttyusb5

i unable fix using udev. attempted write bash script passed udev number symbolic links, didnt work. put script in /etc/rc.local ,

rc.local
code:
#create symbolic links modem  /usr/bin/findsierramodem.sh &    # connect cell network  ifdown eth1  #open wvdial in screen  screen -d -m wvdial  ifup eth1
i have ifdown , ifup here otherwise ppo connection doesnt work. things appear routed through ethernet connection instead.

heres findsierramodem.sh

code:
#!/bin/bash    dir=/sys/bus/usb-serial/drivers/sierra  search=$dir/tty*    let num=0    file in $search   #create symbolic links modem starting @ ttys30  echo `ln -s /dev/${file##/*/} /dev/ttys3$num`  #increment counter  let num=num+1  done    exit 0
this isnt best way this, works enough now.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] udev rules for Sierra 598u


Ubuntu

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code