python - how can i connect and send commands to a serial port while another program is using it? -
i using telit he910g card. connected pc directly using minipci slot. using 3g internet connection , a-gps/gps services.
my system running linux mint 17.1, 3g connection handled using network manager app , works great. 3g connection started , handled using module part of program writing. code using in order connect serial port this:
def _connect_to_device(self): """ connect serial port """ try: self._device = serial.serial(self._filename, baudrate=self._baud_rate) except standarderror, e: raise standarderror("couldn't connect gps device. error: %s" % str(e))
when use python program alone works great. when try , use while 3g on cant connect serial device. wierd thing if try connect using program "minicom" while 3g turned on work.
so question is: how can make both run , work together? since mutually exclusive.
thanks help. :)
ok, solved.
the issue telit module has 2 ports /dev/ttyacm0 (high speed) , /dev/ttyacm3 (lower speed). tried connect high speed one, apparently 3g uses 1 , causes contentions. moving use lower speed port in script solved issue.
Comments
Post a Comment