import socket
import serial
import time

TCP_IP = '192.168.1.5'
TCP_PORT = 51717
BUFFER_SIZE = 1024
MESSAGE = "sprava"

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
ser = serial.Serial('/dev/ttyAMA0', 38400, timeout=1)
while True:
    response=ser.readline()
    #if response != "": 
		#print (response)
    s.send(response)
s.close()
ser.close()
