I am having trouble connecting to a 3G usb modem using python.
when I try, in python interpreter:
import serial
ser = serial.Serial("/dev/ttyUSB1", timeout=2)
I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 236, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 286, in open
self._update_dtr_state()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 612, in _update_dtr_state
fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_DTR_str)
IOError: [Errno 32] Broken pipe
but running
cu -l /dev/ttyUSB1
is able to connect just fine. And I am able to send AT commands and get responses.
Serial object printed out is:
Serial<id=0x76add9b0, open=True>(port='/dev/ttyUSB1', baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=2, xonxoff=False, rtscts=False, dsrdtr=False)