diff --git a/Examples/Filetransfer.py b/Examples/Filetransfer.py index 7fd12ac..9530176 100644 --- a/Examples/Filetransfer.py +++ b/Examples/Filetransfer.py @@ -20,7 +20,7 @@ import RNS.vendor.umsgpack as umsgpack APP_NAME = "example_utilitites" # We'll also define a default timeout, in seconds -APP_TIMEOUT = 10.0 +APP_TIMEOUT = 15.0 ########################################################## #### Server Part ######################################### diff --git a/RNS/Interfaces/RNodeInterface.py b/RNS/Interfaces/RNodeInterface.py index 5ddd9b3..240e23c 100644 --- a/RNS/Interfaces/RNodeInterface.py +++ b/RNS/Interfaces/RNodeInterface.py @@ -259,6 +259,7 @@ class RNodeInterface(Interface): def process_queue(self): if len(self.packet_queue) > 0: + sleep(0.5) data = self.packet_queue.pop(0) self.interface_ready = True self.processOutgoing(data) @@ -282,6 +283,8 @@ class RNodeInterface(Interface): if (in_frame and byte == KISS.FEND and command == KISS.CMD_DATA): in_frame = False self.processIncoming(data_buffer) + data_buffer = "" + command_buffer = "" elif (byte == KISS.FEND): in_frame = True command = KISS.CMD_UNKNOWN @@ -391,6 +394,7 @@ class RNodeInterface(Interface): else: time_since_last = int(time.time()*1000) - last_read_ms if len(data_buffer) > 0 and time_since_last > self.timeout: + RNS.log(str(self)+" serial read timeout", RNS.LOG_EXTREME) data_buffer = "" in_frame = False command = KISS.CMD_UNKNOWN diff --git a/RNS/Link.py b/RNS/Link.py index 4819e23..dc868b3 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -191,6 +191,8 @@ class Link: RNS.log("Link "+str(self)+" established with "+str(self.destination)+", RTT is "+str(self.rtt), RNS.LOG_VERBOSE) rtt_data = umsgpack.packb(self.rtt) rtt_packet = RNS.Packet(self, rtt_data, context=RNS.Packet.LRRTT) + # TODO: remove + RNS.log("Sending RTT packet", RNS.LOG_EXTREME) rtt_packet.send() self.status = Link.ACTIVE @@ -290,7 +292,7 @@ class Link: next_check = self.request_time + self.proof_timeout sleep_time = next_check - time.time() if time.time() >= self.request_time + self.proof_timeout: - #RNS.log("Timeout waiting for RTT packet from link initiator", RNS.LOG_DEBUG) + RNS.log("Timeout waiting for RTT packet from link initiator", RNS.LOG_DEBUG) self.status = Link.CLOSED self.teardown_reason = Link.TIMEOUT self.link_closed() diff --git a/RNS/Transport.py b/RNS/Transport.py index c4bc631..72b629a 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -112,7 +112,9 @@ class Transport: should_transmit = False if should_transmit: - RNS.log("Transmitting "+str(len(packet.raw))+" bytes via: "+str(interface), RNS.LOG_DEBUG) + # TODO: Remove + RNS.log("Transmitting "+str(len(packet.raw))+" bytes via: "+str(interface), RNS.LOG_EXTREME) + RNS.log("Hash is "+RNS.prettyhexrep(packet.packet_hash), RNS.LOG_EXTREME) interface.processOutgoing(packet.raw) sent = True