Discussion:
How to debug USB hardware issues
(too old to reply)
Alberto Mijares
2011-11-04 01:31:22 UTC
Permalink
Hi,

I have a SMS gateway with FreeBSD 8.2 RELEASE on old hardware
(Pentium4). It has plugged a modem Enfora SA-EL, GSM-GPRS, via USB.

The modem has been working fine for years. However, since it's plugged
to this server, the application that manage the modem hangs every one
or two days.

I'd like to know if there is a way to know exactly if the problem is
the USB ports or the modem failing (because has some years now). Some
time I have to reset the USB port (using usbconfig) and it works
again. Tha bad thing is that the application hangs and cannot reset
the modem (using the %RESET AT command).

Thanks in advance for your suggestions.

Regards


Alberto Mijares
Hans Petter Selasky
2011-11-04 08:56:51 UTC
Permalink
Post by Alberto Mijares
Hi,
I have a SMS gateway with FreeBSD 8.2 RELEASE on old hardware
(Pentium4). It has plugged a modem Enfora SA-EL, GSM-GPRS, via USB.
The modem has been working fine for years. However, since it's plugged
to this server, the application that manage the modem hangs every one
or two days.
I'd like to know if there is a way to know exactly if the problem is
the USB ports or the modem failing (because has some years now). Some
time I have to reset the USB port (using usbconfig) and it works
again. Tha bad thing is that the application hangs and cannot reset
the modem (using the %RESET AT command).
Thanks in advance for your suggestions.
Regards
Alberto Mijares
Hi,

What does dmesg say when this failure occurs?

Do you see the following sysctl:

sysctl hw.usb.no_cs_fail

I would start turn on debugging in the modem driver, compile kernel with
options USB_DEBUG, and then see what is printed at the time of failure.

--HPS
Alberto Mijares
2011-11-04 19:25:20 UTC
Permalink
Hi Hans,

dmesg doesn't say anything when the failure occurs.

# sysctl hw.usb.no_cs_fail
sysctl: unknown oid 'hw.usb.no_cs_fail'

I turned on debugging in the modem driver

# sysctl hw.usb.u3g.debug=1
hw.usb.u3g.debug: 0 -> 1

However, I cannot recompile the kernel rigth now for USB_DEBUG.

I hope when the failure occurs again the driver be able to say what is
going on. I'll be posting the results here.

Thanks in advance.

Regards


Alberto Mijares
Post by Hans Petter Selasky
Post by Alberto Mijares
Hi,
I have a SMS gateway with FreeBSD 8.2 RELEASE on old hardware
(Pentium4). It has plugged a modem Enfora SA-EL, GSM-GPRS, via USB.
The modem has been working fine for years. However, since it's plugged
to this server, the application that manage the modem hangs every one
or two days.
I'd like to know if there is a way to know exactly if the problem is
the USB ports or the modem failing (because has some years now). Some
time I have to reset the USB port (using usbconfig) and it works
again. Tha bad thing is that the application hangs and cannot reset
the modem (using the %RESET AT command).
Thanks in advance for your suggestions.
Regards
Alberto Mijares
Hi,
What does dmesg say when this failure occurs?
sysctl hw.usb.no_cs_fail
I would start turn on debugging in the modem driver, compile kernel with
options USB_DEBUG, and then see what is printed at the time of failure.
--HPS
Alberto Mijares
2011-11-05 14:21:34 UTC
Permalink
Post by Hans Petter Selasky
What does dmesg say when this failure occurs?
sysctl hw.usb.no_cs_fail
I would start turn on debugging in the modem driver, compile kernel with
options USB_DEBUG, and then see what is printed at the time of failure.
Hi,

I already have USB_DEBUG option in kernel running and u3g debug. What
info can I send you? I don't see anything relevant.

Thanks


Alberto Mijares
Hans Petter Selasky
2011-11-05 14:45:19 UTC
Permalink
Post by Alberto Mijares
Post by Hans Petter Selasky
What does dmesg say when this failure occurs?
sysctl hw.usb.no_cs_fail
I would start turn on debugging in the modem driver, compile kernel with
options USB_DEBUG, and then see what is printed at the time of failure.
Hi,
I already have USB_DEBUG option in kernel running and u3g debug. What
info can I send you? I don't see anything relevant.
Thanks
Hi,

Have you tried:

sysctl hw.usb.u3g.debug=15

--HPS
Alberto Mijares
2011-11-14 23:26:33 UTC
Permalink
Post by Hans Petter Selasky
Post by Alberto Mijares
Post by Hans Petter Selasky
What does dmesg say when this failure occurs?
sysctl hw.usb.no_cs_fail
I would start turn on debugging in the modem driver, compile kernel with
options USB_DEBUG, and then see what is printed at the time of failure.
Hi,
I already have USB_DEBUG option in kernel running and u3g debug. What
info can I send you? I don't see anything relevant.
Thanks
Hi,
sysctl hw.usb.u3g.debug=15
--HPS
Hi,

I have the problem rigth now... so:


# sysctl hw.usb.u3g.debug
hw.usb.u3g.debug: 15

and USB_DEBUG is in actual kernel config.

bearerbox process (Kannel 1.5.0) hangs, since it cannot talk to the
modem anymore. I killed it with signal -9 and tried to connect with
cu:

# cu -l /dev/cuaU0 -s 150200
connected


but it doesn't response.

At this very moment, how could I determine if there is a problem with
the modem or with the USB port/bus?

My only choice now is to reset the USB port with usbconfig -d 0.2 reset.

Thanks in advance

Regards


Alberto Mijares
Alberto Mijares
2011-11-16 00:53:04 UTC
Permalink
Post by Hans Petter Selasky
I would start turn on debugging in the modem driver, compile kernel with
options USB_DEBUG, and then see what is printed at the time of failure.
Hi list,

I read usb_debug.c and found that I had to turn on debugging with

# sysctl hw.usb.debug=1

So, I did it.

Then, I started the application (the service is still down since my
first post in this thread) and many messages showed in dmesg and
/var/log/messages.

Tha app didn't work, so I opened one terminal with tail -f
/var/log/messages and from another terminal tried to connect to the
modem with cu -l /dev/cuaU0 -s 115200. This was the output:

Jan 6 10:19:59 kannel kernel: usbd_transfer_submit: xfer=0xc48bb968,
endpoint=0xc4b5e800, nframes=1, dir=read
Jan 6 10:19:59 kannel kernel: usb_dump_endpoint: endpoint=0xc4b5e800
edesc=0xc42f9032 isoc_next=0 toggle_next=1 bEndpointAddress=0x81
Jan 6 10:19:59 kannel kernel: usb_dump_queue: endpoint=0xc4b5e800 xfer:
Jan 6 10:19:59 kannel kernel: usbd_transfer_submit: open
Jan 6 10:19:59 kannel kernel: usbd_pipe_enter: enter
Jan 6 10:19:59 kannel kernel: usbd_pipe_start: start
Jan 6 10:20:00 kannel kernel: usbd_do_request_flags: Handle Request
function is set
Jan 6 10:20:32 kannel last message repeated 96 times
Jan 6 10:22:33 kannel last message repeated 366 times

Even so, the modem is still dead. No response.

Finally, after a while, I killed the cu process and this message showed

usbd_do_request_flags: Handle Request function is set
usbd_transfer_stop: close
usbd_transfer_done: err=USB_ERR_CANCELLED
usbd_transfer_done: err=USB_ERR_NORMAL_COMPLETION
usbd_callback_wrapper_sub: xfer=0xc48bb968 endpoint=0xc4b5e800 sts=5
alen=0, slen=2048, afrm=0, nfrm=1
usbd_do_request_flags: Handle Request function is set

u3g debug is on and no message appears.

Any hint about this? I'm about to buy a PCI->USB card, unless anyone
can say there's no problem with USB hardware. So I have to bye another
modem.

Thank you very mucho in advance.

Regards


Alberto Mijares
Hans Petter Selasky
2011-11-16 08:13:32 UTC
Permalink
Post by Alberto Mijares
USB_ERR
Look for:

USB_ERR_STALLED
USB_ERR_TIMEOUT

--HPS

Loading...