Skip to content

Commit

Permalink
hack para tratar envio duplo de dados
Browse files Browse the repository at this point in the history
  • Loading branch information
ielson committed Jul 27, 2018
1 parent a2e7a67 commit 48c537c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# port = int(input("Enter the port number that you would like to connect: "))
sensor = input("Enter the sensor id to send: ")
print("Connecting to the localhost at port 5000")
server_address = ('localhost', 5000)
server_address = ('192.168.0.108', 5000)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(server_address)
print("Connected to the server")
Expand All @@ -17,4 +17,4 @@
sock.sendall(msg.encode('utf-8'))
data = sock.recv(16)
print("The server answered: {answer}".format(answer=data))
time.sleep(2)
time.sleep(2)
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self, socket):
self.number = ""

def log_temperature(self, temp):
self.temps.append(float(temp))
self.temps.append(float(temp.decode("utf-8")[:5]))

def check_and_notify(self, serial, temp):
if float(temp) > MAX_TEMP:
Expand Down

0 comments on commit 48c537c

Please sign in to comment.