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