From 5cba18d5f04fee84844e334f9a3154251a589b8d Mon Sep 17 00:00:00 2001 From: acn Date: Fri, 1 Jun 2018 13:09:23 +0200 Subject: [PATCH] miniBtx-Handling verbessert, es werden nun Neuverbindungen (nach Disconnect) richtig erkannt --- config.py | 2 +- rtx.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 4dcc172..9c973fb 100644 --- a/config.py +++ b/config.py @@ -20,7 +20,7 @@ LOGLEVEL=logging.DEBUG ## serial port settings: #PORT="/dev/pts/5" -PORT="/dev/ttyUSB3" +PORT="/dev/ttyUSB1" BAUDRATE="1200" # if the system is connected directly (null-modem): MODE=direct # if the system is connected via a modem: MODE=modem diff --git a/rtx.py b/rtx.py index cb5082e..4f3002d 100755 --- a/rtx.py +++ b/rtx.py @@ -89,16 +89,23 @@ while True: rtxModem.init_modem() rtxModem.wait_for_caller() rtxHelpers.send_welcome_page() - elif glob.mode == "minibtx": - minibtx.wait_for_minibtx() - rtxHelpers.send_welcome_page() # main loop to read data from client while True: in_byte = glob.ser.read(1) + + if glob.mode == "minibtx": + if in_byte == b'\x01': + logging.info("miniBtx starts connection... waiting for connection...") + minibtx.wait_for_minibtx() + rtxHelpers.send_welcome_page() + break + rtxHelpers.process_byte(in_byte) + if glob.mode == "modem": if glob.ser.getCD() == False: + logging.info("modem hangup.") break