Topic: How to debug 3g connection problems?

Can anyone offer any suggestions on how to debug a 3G modem connection problem?

I've made temporary copies of the chumby_3g_connect.pl and ppp-peer files in the /psp directory, and have been running them with 'pppd file ppp-peer1'.  The /tmp/pppd_3g.log file continuously shows 'Initializing modem/Sending ATZ'.  If I change the baud rate to 115200, start pppd, and then hit the reset button on the modem, some communication begins, and then the pppd service stops.  Then the log file is as follows:

Initializing modem
Sending ATZ
Initializing modem
Sending ATZ
Initializing modem
Sending ATZ
Initializing modem
Sending ATZ
Initializing modem
Sending ATZ
Received: OK
Sending AT+CPIN?
Received: +CPIN: READY
Received: OK
Sending ATH
Received: OK
Sending AT+CGDCONT=1,IP,wap.cingular
Received: OK
Sending AT+CGREG?
Received: +CGREG: 0,4
Stat: +CGREG: 0,4

The strange thing is that I had it working once, (ppp0 showed up in ifconfig), and I was able to ping www.chumby.com after playing with some of the /usr/chumby scripts.

I am also able to connect the modem to a PC and manually get it to register on the AT&T network with AT commands.

Can anyone offer any suggestions on how to get more debug information?  The debug option is already turned on in the ppp-peer file, but I can't find anything of value.

Side note - I was able to make a borrowed Verizon modem work with with a little work.  It reports itself to the system as a 'ttyACM0' device, not ttyUSB0.  Running 'mv ttyACM0 ttyUSB0' from the debug port would allow the normal 3G setup to work.  Perhaps a patch could be made to a future release?

Thanks for any help.
Mark

Re: How to debug 3g connection problems?

Some progress.....

+CGREG:0,4  is unknown network status (still booting).  I patched the perl script to treat this like +CGREG:0,0 which means stil connecting.

I now get a few of the 0,4 responses then I get a 0,5 response and the script bombs again.  0,5 is connected and roaming.  I patched the script to treat the 0,5 like a 0,1 (connected) and the modem will connect and I now get a ppp0 device.

My next hurdle will be to figure how to patch these changes back in and make it boot the whole way through.  Maybe I won't have to reset the modem if the script doesn't hit it at 460800 baud?

Re: How to debug 3g connection problems?

Try running "pppd file ppp-peer1 nodetach" which should give you more information.

I'll modify our version of chumby_3g_connect.pl to accept 0,4 as 0,0, and 0,5 as 0,1.

I'll also modify start_network to accept a "device=" parameter in /psp/3g_config.  It'll default to /dev/ttyUSB0 if you don't specify it.

I believe the baudrate is just negotiation speed.  I say that because I've seen it go much faster after connecting than I had the baudrate set to.

Re: How to debug 3g connection problems?

Thanks ChumbyLurker.

I tried the 'nodtach' option and it gives a lot more information.  Thank you.

The device=  parameter sounds like it will work.  Could it be automatic with if /dev/ttyUSB0 exists, else if /dev/ttyACM0 exists ?

I don't know how common the ACM0 response is.  Maybe it's not worth making it automatic.  The log file with the Verizon modem had the lines:

[   17.130000] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[   17.210000] usbcore: registered new interface driver cdc_acm
[   17.220000] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters

So maybe there are other devices that could benefit from this?

I'll play some more with the baud rate.  My modem documentation say it will autobaud to 230400.  I think it might be grabbing a bad baud, and then won't reconnect at 115200 without a reset.  I'll try some experiments.  There may be a way to get it to rescan for baud with a handshake line toggle.  I'll check the docs.

I don't think the default baud should be changed, but a baud parameter in the .pl file might be nice.

Thanks again for the help,
Mark

Re: How to debug 3g connection problems?

OK, I've had some success, and a new problem.  I've been able to get the Verizon module working, and a development kit PCB with AT&T, and have them each auto-detecting and configuring.

First the userhook0 file was changed to rename /dev/ttyACM0 to ttyUSB0, if it existed.

Next the start_network script was changed to allow a baud entry in the 3g_config file.  (the 460800 was causing one of the modems to lock up)

Lastly, the chumby_3g_connect.pl scripts was changed to allow a few other status messages such as connected, but roaming.  I can post specifics if someone needs them, but I'll spare you the details for now.

Once I convinced myself that this would work using borrowed hardware, I bought a Zoom 4595 usb adapter that accepts SIM cards.  ($110 US - working well under Windows, and added an AT&T SIM card) 


Now I've got a whole new set of problems.  This (and apparently many other newer 3G modems) report themselves as a cdrom at boot to install Windows or Mac drivers.  Once the drivers are loaded, the CD is shut off, and the modem turned on.  At least one manufacturer calls it 'ZeroCD'.  Plugging in gives:

[16915.300000] usb 1-1.2: new high speed USB device using fsl-ehci and address 13
[16915.460000] usb 1-1.2: configuration #1 chosen from 1 choice
[16915.500000] scsi5 : SCSI emulation for USB Mass Storage devices
[16920.550000] scsi 5:0:0:0: CD-ROM            USBModem Disk             2.31 PQ: 0 ANSI: 2
[16920.600000] sr0: scsi-1 drive
[16920.650000] sr 5:0:0:0: Attached scsi generic sg0 type 5

How to deal with this type of modem appears to be a hot topic on the linux forums.  One utility is 'usb-modeswitch', another discussion is scripts for udev, and another utility is 'zerocdoff'.  Some places imply that a SCSI eject command to the CD may also kick it into modem mode, but I can't confirm that for this model.  There appears to be an ARM version of the usb-modeswitch code, but right now I'm not sure where to start on loading it.

Can anyone offer up any suggestions as the the best way to tackle this?

By the way, combining with the start_ap.sh script made for a slick wifi hot spot.

Thanks for any help,
Mark

Re: How to debug 3g connection problems?

Hey Bugman,

I'm not sure if you are still around or if anyone one else has tried this but did you succeed in dealing with the ZeroCD dilemma?

Do you still have the modified scripts readily available?

Thanks.