title: Read GPS incoming data in python
body: <p>I'm developing a python script that reads a port and print an answer. The idea is to get data from a gps.</p>
  
  <p>This is the code I'm using.</p>
  
  <pre><code>#!/usr/bin/env python
  import socket
  host = ''       # your IP address
  port = 5000    # pick a port you want to listen on. 
  backlog = 5     # number of clients you could handle at once
  size = 1024     # max size of data packet
  
  # create socket:
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  # connect to host / port:
  s.bind((host,port))
  # start listening:
  s.listen(backlog)
  print "listening on: " + str(port)
  # stay in this loop until ctrl-c is typed at console:
  while 1:
      client, address = s.accept()
      data = client.recv(size)
      if data:
          print data          # echo data to console
          client.send(data)   # echo data to client (may confuse your application, great for browser)
      client.close()
  </code></pre>
  
  <p>Now I can connect via telnet and send a message, I'll get the output in the server. Also I can connect via http: // [ip] : [port] and get the output. But I cannot get any information from the GPS, although it is online, and I've re checked the configuration. I've also tried with other devices. No luck. </p>
  
  <p>My question is: Am I missing something here?</p>