3

I'm running Ubuntu 11.04 and a ZTE 3G modem.

The modem is dialed with WvDial

When the modem is not in use by WvDial I can send AT commands to the modem, and get information like signal strength:

AT+ZCSQ
+ZCSQ: 1,  -87 

OK

But when WvDial is using the modem, /dev/ttyUSB0 is locked and I can't query it. Am I missing something obvious? Is there any way I can configure the modem, WvDial, or pyserial so I can send AT commands to the modem while it's connected?

Matt Sweeney
  • 2,060
  • 1
  • 14
  • 19

1 Answers1

4

Ah. Apparently this modem exposes a couple of ttys to work with. I was able to use /dev/ttyUSB1 to sent AT commands while WvDial was connected on /dev/ttyUSB0:

import serial

ser = serial.Serial('/dev/ttyUSB1', 9600, timeout=2)

at_command = 'AT+ZCSQ\r\n'
ser.write(at_command)
ser.sendBreak()

line = ser.read(ser.inWaiting())
ser.close

print line
Matt Sweeney
  • 2,060
  • 1
  • 14
  • 19
  • 1
    Interesting, but what if there is only a single TTY? In this case, Wvdial probably has to be stopped. – BMiner Sep 16 '13 at 18:54