Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
lrhorer
Posts: 7
Joined: 02 Jan 2010, 21:07

Cricket A600 working - mostly

Post by lrhorer » 02 Jan 2010, 22:15

First of all, Josua, I want to thank you for a really great little applet! So far, it's working really well, but I do have one little issue that I hope may be easy to resolve. I'm not sure. I am using a Cricket A600 modem to access the Cricket Wireless network. From reading the usb_modeswitch web page, I take it you are using a wireless modem on a Linux router? I wish to do the same thing. I am running Debian "Lenny" headless on an old Dell Optiplex 260 mini-desktop system. Booting from a cold restart, everything works just fine. The issue, however, is regaining access if for whatever reason the carrier is lost. A graceful disconnect done by issuing a HUP to the ppp app (wvdial) is recoverable, but otherwise, the modem just gets garbage when it attempts to establish the ppp session. Once the session is downed, attempts to revive the modem fail. Even a warm restart of the router won't clear the issue. One must unplug the modem and plug it back in, or else shut down the machine entirely and then power back up. Obviously shutting down the router can be done under automatic control, but physically unplugging the modem cannot. The start-up script calls the following initialization script:

Cricket:~# cat /usr/sbin/flipflop.sh
/usr/sbin/usb_modeswitch
sleep 10
usb_modeswitch -v 0x1f28 -p 0x0020 -R 1

Before calling the script, we see:

Cricket:~# lsusb
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 1f28:0021
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub


After calling the script (or after just calling usb_modeswitch with no additional parameters), we get:

Cricket:~# lsusb
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 007: ID 1f28:0020
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Clearly, issuing the -R switch does not revert the modem to device 0021. The only way I have found to revert the device to its default condition is to physically unplug it. Is there some other means of getting the device to reboot / switch back to its default condition without having to unplug it?

Here are the active lines from the config file, if it helps:

Cricket:/etc# grep -v "#" usb_modeswitch.conf
;CheckSuccess=2
DefaultVendor = 0x1f28
DefaultProduct = 0x0021
TargetClass = 2
MessageEndpoint = 0x08
MessageContent = "55534243b82e238c24000000800108df200000000000000000000000000000"

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 02 Jan 2010, 23:43

First, AFAIK this device should be using the "cdc_acm" driver and you are doing the connecting through a "ttyACM" device. Is that so?

Anyway, just a carrier loss should clearly not be a problem. The issue might be the driver or your host hardware as well, though. What is your kernel version ("uname -r")? And did you check the behaviour on a different machine?


Second, can you post a "lsusb -v" of the switched device ("lsusb -v -d 1f28:0020")? And a "dmesg" right after switching?
Best to disable the automatics and working manually during testing ...


lrhorer
Posts: 7
Joined: 02 Jan 2010, 21:07

Post by lrhorer » 03 Jan 2010, 02:54

Josh wrote:First, AFAIK this device should be using the "cdc_acm" driver and you are doing the connecting through a "ttyACM" device. Is that so?
Yes, or specifically /dev/ttyACM0.
Josh wrote:Anyway, just a carrier loss should clearly not be a problem.
I don't know that it has ever actually lost carrier, but I am preparing for the eventuality. This system is a gift for my sister, who lives out where landline broadband is not an option. She is not technically inclined. To that end, I have forced the issue several different ways, and while sometimes the modem can recover, sometimes it merely returns gibberish and the ppp driver eventually just disconnects. Once this happens, the little LED indicators on the modem are "stuck" and while the modem responds to commands, it doesn't connect properly.

With luck, the capability may never, or at least very rarely ever, be needed. I can't count on luck, though, and have my sister calling me every other day to have me work through getting the router back up.
Josh wrote:The issue might be the driver or your host hardware as well, though. What is your kernel version ("uname -r")?
2.6.26-2-686
Josh wrote:And did you check the behaviour on a different machine?
Well, no. I don't really have another machine set up as a router. It certainly works on other machines, but I don't really have the luxury of stressing the system on those machines like I do here.
Josh wrote:Second, can you post a "lsusb -v" of the switched device ("lsusb -v -d 1f28:0020")?

Code: Select all

Cricket:~# lsusb -v -d 1f28:0020

Bus 001 Device 004: ID 1f28:0020
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1f28
  idProduct          0x0020
  bcdDevice            0.00
  iManufacturer           1 Cal-comp E&CC Limited
  iProduct                2 Cal-comp CDMA USB Modem A600
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          189
    bNumInterfaces          7
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              3 Data Interface
      CDC Header:
        bcdCDC               1.09
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x0f
          connection notifications
          sends break
          line coding and serial state
          get/set/clear comm features
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             128
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x89  EP 9 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x09  EP 9 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               8
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        6
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x08  EP 8 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)
Josh wrote: And a "dmesg" right after switching?
After inserting the modem on the USB port:

Code: Select all

Cricket:~# cat /tmp/usb_modem
[ 1400.624068] usb 1-1: USB disconnect, address 4
[ 1410.260041] usb 1-1: new full speed USB device using uhci_hcd and address 5
[ 1410.424066] usb 1-1: configuration #1 chosen from 1 choice
[ 1410.429796] scsi1 : SCSI emulation for USB Mass Storage devices
[ 1410.436393] usb 1-1: New USB device found, idVendor=1f28, idProduct=0021
[ 1410.436408] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1410.436413] usb 1-1: Product: USB Micro SD Storage
[ 1410.436417] usb 1-1: Manufacturer: Cal-comp E&CC Limited
[ 1410.436421] usb 1-1: SerialNumber: 215991264600
[ 1410.437086] usb-storage: device found at 5
[ 1410.437093] usb-storage: waiting for device to settle before scanning
[ 1415.437862] usb-storage: device scan complete
[ 1415.440752] scsi 1:0:0:0: Direct-Access     Cricket  T-Flash Disk     2.31 PQ: 0 ANSI: 2
[ 1415.440752] scsi 1:0:0:1: CD-ROM            Cal-Comp CD INSTALLER     2.31 PQ: 0 ANSI: 0
[ 1415.489004] sd 1:0:0:0: [sda] Attached SCSI removable disk
[ 1415.713938] Driver 'sr' needs updating - please use bus_type methods
[ 1416.972381] sr0: scsi3-mmc drive: 0x/0x caddy
[ 1416.972381] sr 1:0:0:1: Attached scsi CD-ROM sr0
[ 1417.052206] sd 1:0:0:0: Attached scsi generic sg0 type 0
[ 1417.052265] sr 1:0:0:1: Attached scsi generic sg1 type 5
[ 1417.190377] sr0: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
[ 1417.190406] sr: Sense Key : No Sense [current]
[ 1417.190412] sr: Add. Sense: No additional sense information
[ 1417.372049] usb 1-1: reset full speed USB device using uhci_hcd and address 5
[ 1417.640043] usb 1-1: reset full speed USB device using uhci_hcd and address 5
[ 1417.912041] usb 1-1: reset full speed USB device using uhci_hcd and address 5
After switching:

Code: Select all

[ 1474.032070] usb 1-1: USB disconnect, address 5
[ 1479.228047] usb 1-1: new full speed USB device using uhci_hcd and address 6
[ 1479.388007] usb 1-1: configuration #1 chosen from 1 choice
[ 1479.397275] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[ 1479.425484] scsi2 : SCSI emulation for USB Mass Storage devices
[ 1479.426146] usb-storage: device found at 6
[ 1479.426154] usb-storage: waiting for device to settle before scanning
[ 1479.428505] usb 1-1: New USB device found, idVendor=1f28, idProduct=0020
[ 1479.428525] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1479.428529] usb 1-1: Product: Cal-comp CDMA USB Modem A600
[ 1479.428533] usb 1-1: Manufacturer: Cal-comp E&CC Limited
[ 1484.425866] usb-storage: device scan complete
[ 1484.428417] scsi 2:0:0:0: Direct-Access     Cricket  T-Flash Disk     2.31 PQ: 0 ANSI: 2
[ 1484.475998] sd 2:0:0:0: [sda] Attached SCSI removable disk
[ 1484.476099] sd 2:0:0:0: Attached scsi generic sg0 type 0
Josh wrote:Best to disable the automatics and working manually during testing ...
Well, I'm building and testing the automatics. Manually, everything except forcing the modem back to its pre-switch state is working. If I can get the device to reboot, then I can issue a "restart" command to the network script which resets the modem back to its initial state, issue the switch command, and go from there.

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 03 Jan 2010, 10:33

OK. Just one more posting if you don't mind: a "dmesg" after the reset command to the switched modem ("usb_modeswitch -v 0x1f28 -p 0x0020 -R").

And here are some ideas, pretty wild brainstorming for now:

- try if the reset (and the switch) works if you "blacklist usb-storage" in /etc/modprobe.conf.

- did you insert a flash card? In the second "dmesg" you posted there is a "Direct-Access Cricket T-Flash Disk" found. If that is not the driver partition again, try removing it.

- there are a lot of other devices beside cdc_acm and storage listed in the "lsusb" output. Try to load the "option" serial driver and see if more usable interfaces are created:
# modprobe -v option
# echo "1f28 0020" > /sys/bus/usb-serial/drivers/option1/new_id
If there are any ttyUSB devices afterwards, try to use them for modem commands ("minicom") or even for connecting.


lrhorer
Posts: 7
Joined: 02 Jan 2010, 21:07

Post by lrhorer » 03 Jan 2010, 12:41

Josh wrote:OK. Just one more posting if you don't mind: a "dmesg" after the reset command to the switched modem ("usb_modeswitch -v 0x1f28 -p 0x0020 -R").
Dmesg only outputs one additional line after the reset command:

Code: Select all

[  199.304036] usb 1-1: reset full speed USB device using uhci_hcd and address 5
(Note: I don't know if I plugged it into a different port, or what, but the addresses are different by one on this run. On the previous test, the addresses were 5 and 6. This time they were 4 and 5. Not that it should make a difference, I don't think, since we are referencing by device ID, not address.)
Josh wrote:And here are some ideas, pretty wild brainstorming for now:
I'll try some of these when I get up later this morning.
Josh wrote:- try if the reset (and the switch) works if you "blacklist usb-storage" in /etc/modprobe.conf.
Do you mean try it after it hangs? Or do you mean try to see if the reset puts the switch back in its default state?
Josh wrote:- did you insert a flash card? In the second "dmesg" you posted there is a "Direct-Access Cricket T-Flash Disk" found. If that is not the driver partition again, try removing it.
It must be. I don't have a card inserted.
Josh wrote:- there are a lot of other devices beside cdc_acm and storage listed in the "lsusb" output. Try to load the "option" serial driver and see if more usable interfaces are created:
# modprobe -v option
# echo "1f28 0020" > /sys/bus/usb-serial/drivers/option1/new_id
If there are any ttyUSB devices afterwards, try to use them for modem commands ("minicom") or even for connecting.
You mean to see if they work when the modem hangs?

Meanwhile, just FYI, here is the output from the dialer when the modem is hung:

Code: Select all

Cricket:/etc/init.d# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT
--> Carrier detected.  Waiting for prompt.
~[7f]}#@!}!}!} }9}"}&} } } } }#}%B#}%}%}&r}'[16]l}'}"}(}"})S~
--> PPP negotiation detected.
--> Starting pppd at Sun Jan  3 02:43:51 2010
--> Pid of pppd: 3520
--> Using interface ppp0
--> pppd: ȇ�[08]���[08]
--> pppd: ȇ�[08]���[08]
--> pppd: ȇ�[08]���[08]
--> pppd: ȇ�[08]���[08]
--> pppd: ȇ�[08]���[08]
--> Disconnecting at Sun Jan  3 02:43:54 2010
--> The PPP daemon has died: Authentication error.
--> We failed to authenticate ourselves to the peer.
--> Maybe bad account or password? (exit code = 19)
--> man pppd explains pppd error codes in more detail.
--> I guess that's it for now, exiting
--> The PPP daemon has died. (exit code = 19)
The output from lsusb is identical when the modem is functional or when it is hung. Here is a dmesg report during a boot with the modem hung:

Code: Select all

...
[    2.465030] usbcore: registered new interface driver usbfs
[    2.465140] usbcore: registered new interface driver hub
[    2.465251] usbcore: registered new device driver usb
[    2.475917] USB Universal Host Controller Interface driver v3.0
[    2.476094] ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 16 (level, low) -> IRQ 16
[    2.476213] PCI: Setting latency timer of device 0000:00:1d.0 to 64
[    2.476219] uhci_hcd 0000:00:1d.0: UHCI Host Controller
[    2.476432] uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 1
[    2.476539] uhci_hcd 0000:00:1d.0: irq 16, io base 0x0000ff80
[    2.476725] usb usb1: configuration #1 chosen from 1 choice
[    2.476829] hub 1-0:1.0: USB hub found
[    2.476893] hub 1-0:1.0: 2 ports detected
[    2.580245] usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
[    2.580312] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.580381] usb usb1: Product: UHCI Host Controller
[    2.580436] usb usb1: Manufacturer: Linux 2.6.26-2-686 uhci_hcd
[    2.580492] usb usb1: SerialNumber: 0000:00:1d.0
[    2.580590] ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19
[    2.580708] PCI: Setting latency timer of device 0000:00:1d.1 to 64
[    2.580714] uhci_hcd 0000:00:1d.1: UHCI Host Controller
[    2.580809] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 2
[    2.580917] uhci_hcd 0000:00:1d.1: irq 19, io base 0x0000ff60
[    2.581105] usb usb2: configuration #1 chosen from 1 choice
[    2.581208] hub 2-0:1.0: USB hub found
[    2.581274] hub 2-0:1.0: 2 ports detected
[    2.684206] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    2.684273] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.684342] usb usb2: Product: UHCI Host Controller
[    2.684397] usb usb2: Manufacturer: Linux 2.6.26-2-686 uhci_hcd
[    2.684452] usb usb2: SerialNumber: 0000:00:1d.1
[    2.684549] ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 18
[    2.684666] PCI: Setting latency timer of device 0000:00:1d.2 to 64
[    2.684671] uhci_hcd 0000:00:1d.2: UHCI Host Controller
[    2.684767] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 3
[    2.684872] uhci_hcd 0000:00:1d.2: irq 18, io base 0x0000ff40
[    2.685052] usb usb3: configuration #1 chosen from 1 choice
[    2.685153] hub 3-0:1.0: USB hub found
[    2.685216] hub 3-0:1.0: 2 ports detected
[    2.788236] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
[    2.788305] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.788375] usb usb3: Product: UHCI Host Controller
[    2.788431] usb usb3: Manufacturer: Linux 2.6.26-2-686 uhci_hcd
[    2.788487] usb usb3: SerialNumber: 0000:00:1d.2
[    2.820060] usb 1-1: new full speed USB device using uhci_hcd and address 2
[    2.907153] ACPI: PCI Interrupt 0000:00:1d.7[D] -> GSI 23 (level, low) -> IRQ 23
[    2.907283] PCI: Setting latency timer of device 0000:00:1d.7 to 64
[    2.907290] ehci_hcd 0000:00:1d.7: EHCI Host Controller
[    2.907401] ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 4
[    2.911383] ehci_hcd 0000:00:1d.7: debug port 1
[    2.911444] PCI: cache line size of 128 is not supported by device 0000:00:1d.7
[    2.911465] ehci_hcd 0000:00:1d.7: irq 23, io mem 0xffa00800
[    2.936713] No dock devices found.
[    2.968940] ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
[    2.969166] usb usb4: configuration #1 chosen from 1 choice
[    2.969272] hub 4-0:1.0: USB hub found
[    2.969338] hub 4-0:1.0: 6 ports detected
[    2.971537] usb 1-1: unable to read config index 0 descriptor/all
[    2.971604] usb 1-1: can't read configurations, error -71
[    3.004500] SCSI subsystem initialized
[    3.028071] hub 1-0:1.0: unable to enumerate USB device on port 1
[    3.067664] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
[    3.067732] Copyright (c) 1999-2006 Intel Corporation.
[    3.067841] libata version 3.00 loaded.
[    3.072223] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002
[    3.072289] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.072359] usb usb4: Product: EHCI Host Controller
[    3.072413] usb usb4: Manufacturer: Linux 2.6.26-2-686 ehci_hcd
[    3.072468] usb usb4: SerialNumber: 0000:00:1d.7
...
[    3.864025] usb 1-1: new full speed USB device using uhci_hcd and address 4
[    4.024270] usb 1-1: configuration #1 chosen from 1 choice
[    4.042485] usb 1-1: New USB device found, idVendor=1f28, idProduct=0020
[    4.042554] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.042615] usb 1-1: Product: Cal-comp CDMA USB Modem A600  
[    4.042674] usb 1-1: Manufacturer: Cal-comp E&CC Limited 
[    4.199408] Initializing USB Mass Storage driver...
[    4.199631] scsi0 : SCSI emulation for USB Mass Storage devices
[    4.199841] usbcore: registered new interface driver usb-storage
[    4.199901] USB Mass Storage support registered.
[    4.202559] usb-storage: device found at 4
[    4.202564] usb-storage: waiting for device to settle before scanning
...
[    9.201226] usb-storage: device scan complete
[    9.210998] scsi 0:0:0:0: Direct-Access     Cricket  T-Flash Disk     2.31 PQ: 0 ANSI: 2
[   10.155144] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[   10.162856] usbcore: registered new interface driver cdc_acm
[   10.162922] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
...
[   12.655564] Driver 'sd' needs updating - please use bus_type methods
[   12.661544] sd 0:0:0:0: [sda] Attached SCSI removable disk
...

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 03 Jan 2010, 15:03

lrhorer wrote: Dmesg only outputs one additional line after the reset command:
That is the indication that the device cannot be hard-reset by the device reset command. So we need to concentrate on avoiding the ppp problem, which is clearly an error somewhere (driver/host/device).
lrhorer wrote:
Josh wrote:- try if the reset (and the switch) works if you "blacklist usb-storage" in /etc/modprobe.conf.
Do you mean try it after it hangs? Or do you mean try to see if the reset puts the switch back in its default state?
This is to see if the overall behaviour changes in any way. BTW, did you ever try removing the reset line from this "flipflop.sh"? I'm not at all sure it is needed or even helpful ...
lrhorer wrote:
Josh wrote:- there are a lot of other devices beside cdc_acm and storage listed in the "lsusb" output. Try to load the "option" serial driver and see if more usable interfaces are created:
# modprobe -v option
# echo "1f28 0020" > /sys/bus/usb-serial/drivers/option1/new_id
If there are any ttyUSB devices afterwards, try to use them for modem commands ("minicom") or even for connecting.
You mean to see if they work when the modem hangs?
No, to see if you can use them as a workaround to ttyACM which obviously has problems. Or to try and control the modem from there with AT commands ...
lrhorer wrote:Meanwhile, just FYI, here is the output from the dialer when the modem is hung:
Can you talk to the modem afterwards with a terminal program ("minicom")? Sending AT commands?


lrhorer
Posts: 7
Joined: 02 Jan 2010, 21:07

Post by lrhorer » 03 Jan 2010, 23:09

Josh wrote:That is the indication that the device cannot be hard-reset by the device reset command. So we need to concentrate on avoiding the ppp problem, which is clearly an error somewhere (driver/host/device).
My money is on the device. Everything seems to work up to and including the interface with the device. The modem responds normally to all the command codes. It just reports gibberish back when connecting. The fact the little status lights - which presumably are not under direct control of the PC - hang when this happens also rather strongly suggests the issue lies beyond the PC / Modem interface.
Josh wrote:
lrhorer wrote:
Josh wrote:- try if the reset (and the switch) works if you "blacklist usb-storage" in /etc/modprobe.conf.
Do you mean try it after it hangs? Or do you mean try to see if the reset puts the switch back in its default state?
This is to see if the overall behaviour changes in any way. BTW, did you ever try removing the reset line from this "flipflop.sh"? I'm not at all sure it is needed or even helpful ...
Yeah, the references from the web page and elsewhere were unsure it made any difference. I removed it, and it doesn't seem to make any difference. I also tried blacklisting the usb-storage driver. Neither made any difference at all to the listings from lsusb or dmesg.
Josh wrote:No, to see if you can use them as a workaround to ttyACM which obviously has problems. Or to try and control the modem from there with AT commands ...
Hmm. I'm not sure ttyACM is having problems. That is to say, obviously the modem is receiving commands and responding intelligently using the ttyACM0 device. I'll see if I have some time to play around with this. My sister will be here tomorrow to pick up the unit. Right now I have a daemon running which senses a loss of connectivity to the internet and after five minutes shuts down the dialer and starts beeping until the modem is unplugged and added back. Once the modem is plugged back in, the daemon stops beeping and starts the network script again. Of course this is rather Draconian, and will effect the same response whether the modem is hung or if carrier is simply lost. Obviously, it would be better if I could programmatically determine which is actually the case or else simply reboot the modem when such an issue arises, but so far we don't seem to have come across anything which allows either one, so the system has to fly blind.
Josh wrote:
lrhorer wrote:Meanwhile, just FYI, here is the output from the dialer when the modem is hung:
Can you talk to the modem afterwards with a terminal program ("minicom")? Sending AT commands?
Well, as you can see above, one can talk to the modem afterwards even through the ttyACM0 interface, so I'm highly skeptical using any other interface would make any difference. I'll give it a shot.

Hmm. I just thought of something. The modem clearly responds to at least some portion of the AT command set. I wonder if there is some query there which can lend a clue? It's been well over a decade since I monkeyed with the AT command set, so I'll have to dig it up and take a look.

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Post by Josh » 04 Jan 2010, 01:15

lrhorer wrote:Hmm. I just thought of something. The modem clearly responds to at least some portion of the AT command set. I wonder if there is some query there which can lend a clue? It's been well over a decade since I monkeyed with the AT command set, so I'll have to dig it up and take a look.
There was that general reset of ATZ and also commands to factory-reset (AT&F1 if I remember correctly).

Ah, those were the times of my first mailbox connection with the help of a 300 baud acoustic coupler ...

The new set of AT commands has been greatly extended though. Maybe you find one to bring the device into a defined state.

Here is a link to a command collection:
CDMA_AT_Commands.pdf in the hope that it is of any help.

Other than that, if the device is still commandable on the firmware side, I suspect the reception component may be faulty ...

Good luck !!!


lrhorer
Posts: 7
Joined: 02 Jan 2010, 21:07

Post by lrhorer » 04 Jan 2010, 01:27

Josh wrote:- there are a lot of other devices beside cdc_acm and storage listed in the "lsusb" output. Try to load the "option" serial driver and see if more usable interfaces are created:
# modprobe -v option
# echo "1f28 0020" > /sys/bus/usb-serial/drivers/option1/new_id
If there are any ttyUSB devices afterwards, try to use them for modem commands ("minicom") or even for connecting.
Indeed it does create four additional ports, ttyUSB0 - ttyUSB3. I'm going to play around with them.

lrhorer
Posts: 7
Joined: 02 Jan 2010, 21:07

Post by lrhorer » 04 Jan 2010, 01:47

Nah, no joy... ttyUSB0 periodically puts up a couple of different characters, but doesn't respond to commands at all. The others are completely silent.

lrhorer
Posts: 7
Joined: 02 Jan 2010, 21:07

Post by lrhorer » 14 Jan 2010, 05:32

Hey Josh,

I'm still puttering about for a solution to this issue, and I've decided to take a "sledgehammer" approach, at least in the most difficult lock-up scenarios. Sometimes the device disappears entirely. The /dev/ttyACM0 device is gone, and lsusb doesn't even show the device to be plugged in. In such a case, the only real allternative is to unplug the device and plug it back in. Of course, doing so physically is really not the best solution, especially since in this case there may not be anyone physically near the modem. Indeed, we may all be miles away. Having the router shut off the power to the modem and bring it back up is the best solution in such a case. I thought about controlling a powered hub via the RS-232 port, but a much slicker solution is to control the power on the USB port itself directly. It looks like this machine may support that, or else perhaps I can use an external hub.

Anyway, I know this rather off topic here, but I was hoping you might agree to lend a brief hand to someone who has only done a very small amount of programming in C to help compile a program to control the USB port. In particular, I downloaded hub-ctrl-2-1.c, a USB port control program. It required the headers usb.h and mod_devicetable.h, so I downloaded them, as well, placing usb.h in usr/include/ and placing mod_devicetable.h in /usr/include/linux. When I tied to compile the program, it complained about, "expected specifier-qualifier-list before ‘xxxx`", so I added "#include <inttypes.h>" to the hub-ctrl-2-1.c source file. When that didn't work, I also tried adding it to mod_devicetable.h. I still get the same sorts of errors, however, and I was hoping you might point me in the right direction:

Code: Select all

AlarmClock:/Downloads# gcc -o hub-ctrl hub-ctrl-2-1.c -lusb
In file included from /usr/include/usb.h:4,
                 from hub-ctrl-2-1.c:12:
/usr/include/linux/mod_devicetable.h:18: error: expected specifier-qualifier-list before ‘__u32’
/usr/include/linux/mod_devicetable.h:31: error: expected specifier-qualifier-list before ‘__u32’
/usr/include/linux/mod_devicetable.h:100: error: expected specifier-qualifier-list before ‘__u16’
/usr/include/linux/mod_devicetable.h:137: error: expected specifier-qualifier-list before ‘__u16’
/usr/include/linux/mod_devicetable.h:147: error: expected specifier-qualifier-list before ‘__u16’
/usr/include/linux/mod_devicetable.h:164: error: expected specifier-qualifier-list before ‘__u16’
/usr/include/linux/mod_devicetable.h:175: error: expected specifier-qualifier-list before ‘__u8’
/usr/include/linux/mod_devicetable.h:186: error: expected specifier-qualifier-list before ‘__u8’
/usr/include/linux/mod_devicetable.h:194: error: expected specifier-qualifier-list before ‘__u8’
/usr/include/linux/mod_devicetable.h:199: error: expected specifier-qualifier-list before ‘__u8’
/usr/include/linux/mod_devicetable.h:210: error: expected specifier-qualifier-list before ‘__u8’
/usr/include/linux/mod_devicetable.h:227: error: expected specifier-qualifier-list before ‘kernel_ulong_t’
/usr/include/linux/mod_devicetable.h:240: error: expected specifier-qualifier-list before ‘__u16’
/usr/include/linux/mod_devicetable.h:314: error: expected specifier-qualifier-list before ‘kernel_ulong_t’
/usr/include/linux/mod_devicetable.h:341: error: expected specifier-qualifier-list before ‘kernel_ulong_t’
/usr/include/linux/mod_devicetable.h:347: error: expected specifier-qualifier-list before ‘__u8’
/usr/include/linux/mod_devicetable.h:363: error: expected specifier-qualifier-list before ‘__u8’
/usr/include/linux/mod_devicetable.h:372: error: expected specifier-qualifier-list before ‘__u16’
/usr/include/linux/mod_devicetable.h:386: error: expected specifier-qualifier-list before ‘__u32’
/usr/include/linux/mod_devicetable.h:398: error: expected specifier-qualifier-list before ‘kernel_ulong_t’
/usr/include/linux/mod_devicetable.h:409: error: expected specifier-qualifier-list before ‘kernel_ulong_t’
/usr/include/linux/mod_devicetable.h:444: error: expected specifier-qualifier-list before ‘kernel_ulong_t’
/usr/include/linux/mod_devicetable.h:473: error: expected specifier-qualifier-list before ‘kernel_ulong_t’
hub-ctrl-2-1.c: In function ‘main’:
hub-ctrl-2-1.c:64: warning: incompatible implicit declaration of built-in function ‘exit’
hub-ctrl-2-1.c:73: warning: incompatible implicit declaration of built-in function ‘exit’
hub-ctrl-2-1.c:82: warning: incompatible implicit declaration of built-in function ‘exit’
hub-ctrl-2-1.c:105: warning: incompatible implicit declaration of built-in function ‘exit’
hub-ctrl-2-1.c:112: warning: assignment makes pointer from integer without a cast
hub-ctrl-2-1.c:116: warning: incompatible implicit declaration of built-in function ‘exit’
hub-ctrl-2-1.c:119: error: dereferencing pointer to incomplete type
hub-ctrl-2-1.c:120: error: dereferencing pointer to incomplete type
hub-ctrl-2-1.c:123: error: ‘usb_dev_handle’ undeclared (first use in this function)
hub-ctrl-2-1.c:123: error: (Each undeclared identifier is reported only once
hub-ctrl-2-1.c:123: error: for each function it appears in.)
hub-ctrl-2-1.c:123: error: ‘uh’ undeclared (first use in this function)
hub-ctrl-2-1.c:127: error: dereferencing pointer to incomplete type
hub-ctrl-2-1.c:130: error: dereferencing pointer to incomplete type
hub-ctrl-2-1.c:130: error: dereferencing pointer to incomplete type
hub-ctrl-2-1.c:132: error: dereferencing pointer to incomplete type
hub-ctrl-2-1.c:135: error: dereferencing pointer to incomplete type
hub-ctrl-2-1.c:138: warning: incompatible implicit declaration of built-in function ‘exit’
hub-ctrl-2-1.c:151: error: ‘USB_DT_HUB’ undeclared (first use in this function)
hub-ctrl-2-1.c:195: warning: incompatible implicit declaration of built-in function ‘exit’
hub-ctrl-2-1.c:200: warning: incompatible implicit declaration of built-in function ‘exit’

Post Reply