hi guys,
i am having a problem with socket.recv.
I am running this script every 30 seconds and it works the first time, however when it goes to run again it hangs at the first recv. This happens even if I close the socket then reconnect.Code:def readAndSend(): global btSocket data_received = 0 while(data_received == 0): #while there is not data, monitor channel channel = btSocket.recv(1) print u"got socket" buffer = "" while(channel != '\n'): buffer += channel channel = btSocket.recv(1) if(buffer[0:6] == "$GPGGA"): data = buffer.split(",") latitude = data[2]+data[3] longitude = data[4]+data[5] data_received = 1 btSocket.close()
Is there anyway to get round this?
Thanks
docGroup

Reply With Quote

