About 6 months ago, I replaced my Vodafone 3G PCMCIA card with a Sierra Wireless 597 USB EVDO modem (branded by Telecom New Zealand as ‘T-Stick’). Unfortunately there’s a bit more inside it than just a USB modem – the manufacturers also decided to cram in a Micro-SD reader and a pretend CD Rom drive with the software for the device on it. The first time you plug it into a Windows PC, the cdrom appears, its autorun fires off the software installer and the driver gets installed. Then, when you remove and reattach it to your PC, the modem gets detected and you’re able to get online.
Plugging it into the laptop running OpenSolaris, the MicroSD reader and CDRom device were detected by the kernel and appeared in Gnome’s file manager without any issues, however there was no sign of the serial device:
Jan 28 14:09:13 pkunk usba: [ID 912658 kern.info] USB 1.10 device (usb1199,fff) operating at full speed (USB 1.x) on USB 1.10 root hub: storage@2, scsa2usb2 at bus address 3
Jan 28 14:09:13 pkunk usba: [ID 349649 kern.info] Sierra Wireless USB MMC Storage SWOC22905731
Jan 28 14:09:13 pkunk genunix: [ID 936769 kern.info] scsa2usb2 is /pci@0,0/pci1028,188@1d,3/storage@2
Jan 28 14:09:13 pkunk genunix: [ID 408114 kern.info] /pci@0,0/pci1028,188@1d,3/storage@2 (scsa2usb2) online
Jan 28 14:09:14 pkunk scsi: [ID 193665 kern.info] sd4 at scsa2usb2: target 0 lun 0
Jan 28 14:09:14 pkunk genunix: [ID 936769 kern.info] sd4 is /pci@0,0/pci1028,188@1d,3/storage@2/disk@0,0
Jan 28 14:09:14 pkunk genunix: [ID 408114 kern.info] /pci@0,0/pci1028,188@1d,3/storage@2/disk@0,0 (sd4) online
Jan 28 14:09:14 pkunk scsi: [ID 193665 kern.info] sd5 at scsa2usb2: target 0 lun 1
Jan 28 14:09:14 pkunk genunix: [ID 936769 kern.info] sd5 is /pci@0,0/pci1028,188@1d,3/storage@2/disk@0,1
Jan 28 14:09:14 pkunk genunix: [ID 408114 kern.info] /pci@0,0/pci1028,188@1d,3/storage@2/disk@0,1 (sd5) online
Jan 28 14:09:14 pkunk genunix: [ID 314293 kern.info] device pciclass,030000@0(display#0) keeps up device sd@0,0(disk#4), but the latter is not power managed
Jan 28 14:09:14 pkunk genunix: [ID 314293 kern.info] device pciclass,030000@0(display#0) keeps up device sd@0,1(disk#5), but the latter is not power managed
The device can operate in two different modes – by default it’ll put itself in ‘Tru Install’ mode, which hides the modem device and exposes the virtual CDRom drive containing the drivers. The other mode hides the CDRom device and allows the modem to be used to dial out, and it’s up to the driver to perform the switch.
Obviously the Windows driver that comes with the device won’t work under OpenSolaris, but a gent called Patrick Arnoux has written a utility to enable the modem. I found it attached to this mailing list post, but I’ve put up a copy here in case the mailing list archives ever go away.
As the comments at the top of the source file describe, some other configuration needs to be in place before it’ll work. Specifically, you need to tell OpenSolaris which driver to use for the USB devices:
pkunk:~ # update_drv -a -i 'usb1199,fff' ugen
devfsadm: driver failed to attach: ugen
Warning: Driver (ugen) successfully added to system but failed to attach
pkunk:~ # update_drv -a -i 'usb1199,23' usbsacm
devfsadm: driver failed to attach: usbsacm
Warning: Driver (usbsacm) successfully added to system but failed to attach
pkunk:~ #
The first command tells the OS to use the generic USB character device driver for the initial device that gets detected (vendor id 1199, device id 0fff). I’m not entirely sure whether or not this is necessary, but haven’t experimented. It does have the effect of preventing the Micro SD and CDRom devices appearing. The second command ties the USB ACM driver to the modem device (vendor id 1199, device id 0023). This device ID is different from the one in the source code comments, but it will vary from modem to modem. 0023 is the correct value for the Sierra Wireless 597.
After running those two commands, the following lines will appear in /etc/driver_aliases:
pkunk:~ $ grep usb1199 /etc/driver_aliases
ugen "usb1199,fff"
usbsacm "usb1199,23"
pkunk:~ $
At this point I needed to reboot; I imagine because the other driver had already attached itself to the USB device. After rebooting, when the modem is attached dmesg isn’t quite as noisy, and the storage devices will no longer appear in gnome file manager:
Jan 28 14:36:12 pkunk usba: [ID 912658 kern.info] USB 1.10 device (usb1199,fff) operating at full speed (USB 1.x) on USB 1.10 root hub: storage@2, ugen1 at bus address 3
Jan 28 14:36:12 pkunk usba: [ID 349649 kern.info] Sierra Wireless USB MMC Storage SWOC22905731
Jan 28 14:36:12 pkunk genunix: [ID 936769 kern.info] ugen1 is /pci@0,0/pci1028,188@1d,3/storage@2
Jan 28 14:36:12 pkunk genunix: [ID 408114 kern.info] /pci@0,0/pci1028,188@1d,3/storage@2 (ugen1) online
The next step is to build the source. It needs the SUNWusbu (libUSB headers) package installed, and obviously a C compiler. I also found I was missing /usr/sfw/include/usb.h (as described here). The file can be found on src.opensolaris.org; once I’d downloaded it and put it into /usr/sfw/include/ I could run make fine, and build myself a switch2modem binary. Running it looks something like this:
pkunk:~ $ ./switch2modem/switch2modem
Switching Sierra device to Modem mode - Successful !
There should be nothing to release
This is an expected error
pkunk:~ $
And lo, some serial devices appear:
pkunk:~ $ ls -l /dev/cua/
total 2
lrwxrwxrwx 1 root root 52 2009-01-28 14:37 0 -> ../../devices/pci@0,0/pci1028,188@1d,3/device@2:0,cu
lrwxrwxrwx 1 root root 52 2009-01-28 14:37 1 -> ../../devices/pci@0,0/pci1028,188@1d,3/device@2:1,cu
lrwxrwxrwx 1 root root 52 2009-01-28 14:37 2 -> ../../devices/pci@0,0/pci1028,188@1d,3/device@2:2,cu
lrwxrwxrwx 1 root root 52 2009-01-28 14:37 3 -> ../../devices/pci@0,0/pci1028,188@1d,3/device@2:3,cu
pkunk:~ $
It turns out /dev/cua/0 is the modem device in my case; after installing SUNWbnu and adding entries for the four devices to /etc/uucp/Devices, I was able to use cu to talk to it:
sam@pkunk:~$ cu -lcua/0
Connected
AT
OK
ATI
Manufacturer: Sierra Wireless, Inc.
Model: C597 Rev 1.0 (2)
Revision: p2314500,4012 [Mar 06 2008 17:19:08]
[...]
All that remains is to set up PPP! I symlinked /dev/term/0 to /dev/evdo, then copied bits of Andrew McMillan’s configuration and created /etc/ppp/peers/Telecom3G:
nodetach
evdo
230400
noauth
passive
defaultroute
usepeerdns
noccp
novj
user "mobile@jamamobile"
show-password
crtscts
connect '/usr/bin/chat -V -t15 -f /etc/ppp/Telecom3G-chat'
And /etc/ppp/Telecom3G-chat:
'' 'ATZ'
'OK' 'ATE0V1&F&D2&C1&C2S0=0'
'OK' 'ATE0V1'
'OK' 'ATS7=60'
'OK' 'ATDT#777'
CONNECT ''
And added a line to /etc/ppp/pap-secrets:
mobile@jamamobile * telecom
Once that’s done, pppd dials out happily:
pkunk:~ $ sudo pppd call Telecom3G
ATZ
OK
ATE0V1&F&D2&C1&C2S0=0
OK
ATE0V1
OKOK
CONNECTSerial connection established.
Using interface sppp0
Connect: sppp0 <--> /dev/evdo
local IP address 166.179.151.107
remote IP address 166.179.144.1
primary DNS address 202.27.158.40
secondary DNS address 202.27.156.72
And I have a new network interface:
pkunk:~ $ /sbin/ifconfig sppp0
sppp0: flags=10010008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4,FIXEDMTU> mtu 1500 index 3
inet 166.179.151.107 --> 166.179.144.1 netmask ffff0000
pkunk:~ $
Unfortunately pppd seems to be writing its nameservers to /etc/ppp/resolv.conf rather than /etc/resolv.conf; I haven’t looked into how to change this behaviour yet.
Recent Comments