# Failing to open serial port in gps\_demo

**URL:** <https://forums.digi.com/t/failing-to-open-serial-port-in-gps-demo/2819>\
**Category:** Python\
**Created:** [January 24, 2012, 2:07pm UTC](https://forums.digi.com/t/failing-to-open-serial-port-in-gps-demo/2819 "2012-01-24T14:07:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nester](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@nester](https://forums.digi.com/u/nester)\
**Post date:** [January 24, 2012, 2:07pm UTC](https://forums.digi.com/t/failing-to-open-serial-port-in-gps-demo/2819/1 "2012-01-24T14:07:25Z")

</div>

When I run gps\_demo on a ConnectPort LTS 32 MEI, the program exits with the error:

```auto
#&gt; python gps_demo2.py
Traceback (most recent call last):
  File "/usr2/pyscripts/gps_demo.py", line 154, in 
    serialfd = os.open(serialport, os.O_RDWR | os.O_NONBLOCK)
OSError: [Errno 2] No such file or directory: '/com/0'

```

The port is configured to use the RealPort profile.  
What can be the problem?

---

<div class="post-metadata">

**Author:** ![nester](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@nester](https://forums.digi.com/u/nester)\
**Post date:** [January 26, 2012, 5:50am UTC](https://forums.digi.com/t/failing-to-open-serial-port-in-gps-demo/2819/2 "2012-01-26T05:50:01Z")

</div>

John,  
Yes, I’m overwhelmed with all the responses.  
What I’ve figured out (so far) is that I had to use /dev/ttyC0 for the first serial port name to get it working. I don’t know why and it isn’t documented anywhere.  
I hope it helps!

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [March 3, 2012, 1:10am UTC](https://forums.digi.com/t/failing-to-open-serial-port-in-gps-demo/2819/3 "2012-03-03T01:10:15Z")

</div>

I think you cannot open the serial port directly. I am pretty sure the LTS32 has 32 tasks which ALREADY own those ports. So you may need to use a TCP/IP socket on localhost (“127.0.0.1”) to TCP port 2101 to 2132.

This doesn’t give you access to the control signals, but you can read/write the serial port via this.

(I haven’t written Python on the LTS, but I did have to port a Linux C++ program to it, and I was told to change all of the serial port access to TCP on localhost).
