shell=False) time.sleep(3) checkSubprocesses.checkmultimon() else: logging.warning('! Test-Mode: multimon-ng not started !') except: logging.critical('cannot start multimon-ng') logging.debug('cannot start multimon-ng', exc_info=True) exit(1) if not args.test: logging.debug('start decoding') while True: decoded = multimon_ng.stdout.readline() from includes import decoder decoder.decode(args.freq, decoded.decode('utf-8')) else: logging.debug('start testing') testFile = open(globals.script_path+"/testdata/testdata.txt", "r") for testData in testFile: if (len(testData.rstrip(' \t\n\r')) > 1) and ("#" not in testData[0]): logging.info("Testdata: %s", testData.rstrip(' \t\n\r')) from includes import decoder decoder.decode(args.freq, testData) time.sleep(1) logging.debug("test finished") except KeyboardInterrupt: logging.warning('Keyboard Interrupt') except SystemExit: logging.warning('SystemExit recieved')
logging.warning("!!! Test-Mode: multimon-ng not started !!!") except: # we couldn't work without multimon-ng -> exit logging.critical("cannot start multimon-ng") logging.debug("cannot start multimon-ng", exc_info=True) exit(1) # # Get decoded data from multimon-ng and call BOSWatch-decoder # if not args.test: logging.debug("start decoding") while True: decoded = str(multimon_ng.stdout.readline()) #Get line data from multimon stdout from includes import decoder decoder.decode(converter.freqToHz(args.freq), decoded) else: logging.debug("start testing") testFile = open(globals.script_path+"/testdata/testdata.txt","r") for testData in testFile: if (len(testData.rstrip(' \t\n\r')) > 1) and ("#" not in testData[0]): logging.info("Testdata: %s", testData.rstrip(' \t\n\r')) from includes import decoder decoder.decode(converter.freqToHz(args.freq), testData) time.sleep(1) logging.debug("test finished") except KeyboardInterrupt: logging.warning("Keyboard Interrupt") except SystemExit:
# FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST2=III(mit NA,ohneSIGNAL)) CRC correct\n' # POCSAG1200: Address: 1234567 Function: 1 Alpha: Hello World decoded = str(multimon_ng.stdout.readline()) #Get line data from multimon stdout # Test-strings only for develop #decoded = "ZVEI2: 25832" #decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct\n'" #decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=I (ohneNA,ohneSIGNAL)) CRC correct\n'" #decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=II (ohneNA,mit SIGNAL)) CRC correct\n'" #decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct\n'" #decoded = "FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct\n'" #decoded = "POCSAG1200: Address: 1234567 Function: 1 Alpha: Hello World" #time.sleep(1) from includes import decoder decoder.decode(freqToHz(args.freq), decoded) except KeyboardInterrupt: logging.warning("Keyboard Interrupt") except: logging.exception("unknown error") finally: try: logging.debug("BOSWatch shuting down") rtl_fm.terminate() logging.debug("rtl_fm terminated") multimon_ng.terminate() logging.debug("multimon-ng terminated") logging.debug("exiting BOSWatch") except: logging.warning("failed in clean-up routine")