diff --git a/data_handler.py b/data_handler.py index fe9aa066..c85d58f6 100644 --- a/data_handler.py +++ b/data_handler.py @@ -275,7 +275,7 @@ def arq_transmit(data_out): # --------------------------- START TIMER FOR WAITING FOR ACK ---> IF TIMEOUT REACHED, ACK_TIMEOUT = 1 - logging.info("ARQ | RX | WAITING FOR BURST ACK") + logging.debug("ARQ | RX | WAITING FOR BURST ACK") static.CHANNEL_STATE = 'RECEIVING_SIGNALLING' helpers.arq_reset_timeout(False) @@ -316,7 +316,7 @@ def arq_transmit(data_out): while static.ARQ_ACK_RECEIVED == False and static.ARQ_FRAME_ACK_RECEIVED == False and static.ARQ_RX_RPT_TIMEOUT == False: time.sleep(0.01) # lets reduce CPU load a little bit - logging.debug(static.ARQ_STATE) + logging.info(static.ARQ_STATE) if static.ARQ_ACK_RECEIVED == True: @@ -334,7 +334,7 @@ def arq_transmit(data_out): # -------------------------------------------------------------------------------------------------------------- - elif static.ARQ_ACK_RECEIVED == True and static.ARQ_RX_ACK_TIMEOUT == 1: + elif static.ARQ_ACK_RECEIVED == False and static.ARQ_RX_ACK_TIMEOUT == True: logging.warning("ARQ | RX | ACK TIMEOUT!") pass # no break here so we can continue with the next try of repeating the burst @@ -356,7 +356,9 @@ def arq_transmit(data_out): break else: - logging.debug("------------------------------->NO RULE MATCHED!") + logging.info("------------------------------->NO RULE MATCHED!") + print("ARQ_ACK_RECEIVED " + str(static.ARQ_ACK_RECEIVED)) + print("ARQ_RX_ACK_TIMEOUT " + str(static.ARQ_RX_ACK_TIMEOUT)) break # --------------------------------WAITING AREA FOR FRAME ACKs diff --git a/helpers.py b/helpers.py index 02806b63..fce512f2 100644 --- a/helpers.py +++ b/helpers.py @@ -62,14 +62,23 @@ def data_channel_keep_alive_watchdog(): if static.ARQ_STATE == 'DATA' and static.TNC_STATE == 'BUSY': # and not static.ARQ_SEND_KEEP_ALIVE: time.sleep(0.01) - if static.ARQ_DATA_CHANNEL_LAST_RECEIVED + 10 > time.time(): + if static.ARQ_DATA_CHANNEL_LAST_RECEIVED + 30 > time.time(): pass else: static.ARQ_DATA_CHANNEL_LAST_RECEIVED = 0 - logging.info("DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]<< >>[" + str(static.DXCALLSIGN, 'utf-8') + "] [BER." + str(static.BER) + "]") + logging.info("DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]<>[" + str(static.DXCALLSIGN, 'utf-8') + "] [BER." + str(static.BER) + "]") arq_reset_frame_machine() +#async def set_after_timeout(): +# """ +# Author: DJ2LS +# """ +# while True: +# time.sleep(1) +# static.ARQ_RX_ACK_TIMEOUT = True +# await asyncio.sleep(1.1) + def arq_ack_timeout(): """ diff --git a/static.py b/static.py index 9f9ede2f..1db58497 100644 --- a/static.py +++ b/static.py @@ -135,10 +135,7 @@ ARQ_N_SENT_FRAMES = 0 # counter for already sent frames # SENDING_ACK # ACK_RECEIVED -# CONNECTED -# DISCONNECTED -# CONNECTING -# DISCONNECTING +# DATA ARQ_STATE = 'IDLE' # RECEIVING_SIGNALLING @@ -156,10 +153,6 @@ ARQ_READY_FOR_DATA = False ARQ_DATA_CHANNEL_MODE = 12 ARQ_DATA_CHANNEL_LAST_RECEIVED = 0 -# SEND KEEP ALIVE ONLY IF WE WANT -ARQ_SEND_KEEP_ALIVE = True -ARQ_CONNECTION_KEEP_ALIVE_RECEIVED = 0 -#ARQ_WAIT_FOR_DISCONNECT = False # ------- TX BUFFER TX_BUFFER_SIZE = 0