From bcb55b7d725ddd0ac587aee34289d3c08d5d8eef Mon Sep 17 00:00:00 2001 From: KF7EEL Date: Mon, 8 Feb 2021 14:46:11 -0800 Subject: [PATCH] disable dashboard stuff --- bridge_gps_data-SAMPLE.cfg | 2 +- bridge_gps_data.py | 70 ++++++++++++++++++------------------ gps_data-SAMPLE.cfg | 2 +- gps_data.py | 72 ++++++++++++++++++++------------------ hblink-SAMPLE.cfg | 2 +- 5 files changed, 76 insertions(+), 72 deletions(-) diff --git a/bridge_gps_data-SAMPLE.cfg b/bridge_gps_data-SAMPLE.cfg index aba7999..8338890 100644 --- a/bridge_gps_data-SAMPLE.cfg +++ b/bridge_gps_data-SAMPLE.cfg @@ -84,7 +84,7 @@ REPORT_CLIENTS: 127.0.0.1 # used. # [LOGGER] -LOG_FILE: /tmp/hblink.log +LOG_FILE: ./hblink.log LOG_HANDLERS: console-timed LOG_LEVEL: DEBUG LOG_NAME: HBlink diff --git a/bridge_gps_data.py b/bridge_gps_data.py index 4e17403..4f95983 100755 --- a/bridge_gps_data.py +++ b/bridge_gps_data.py @@ -158,28 +158,30 @@ def aprs_send(packet): logger.info('Packet sent to APRS-IS.') def dashboard_loc_write(call, lat, lon, time): - #try: - dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read()) - # except: - # dash_entries = [] - dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time}) - with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: - user_loc_file.write(str(dash_entries[:15])) - user_loc_file.close() - logger.info('User location saved for dashboard') - #logger.info(dash_entries) + pass +## #try: +## dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read()) +## # except: +## # dash_entries = [] +## dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time}) +## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: +## user_loc_file.write(str(dash_entries[:15])) +## user_loc_file.close() +## logger.info('User location saved for dashboard') +## #logger.info(dash_entries) def dashboard_bb_write(call, dmr_id, time, bulletin): - #try: - dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read()) - # except: - # dash_entries = [] - dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin}) - with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: - user_bb_file.write(str(dash_bb[:10])) - user_bb_file.close() - logger.info('User bulletin entry saved.') - #logger.info(dash_bb) + pass +## #try: +## dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read()) +## # except: +## # dash_entries = [] +## dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin}) +## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: +## user_bb_file.write(str(dash_bb[:10])) +## user_bb_file.close() +## logger.info('User bulletin entry saved.') +## #logger.info(dash_bb) # Send email via SMTP function def send_email(to_email, email_subject, email_message): @@ -1706,20 +1708,20 @@ if __name__ == '__main__': user_dict_file.write("{1: [{'call': 'N0CALL'}, {'ssid': ''}, {'icon': ''}, {'comment': ''}]}") user_dict_file.close() # Check to see if dashboard files exist - if Path('/tmp/gps_data_user_loc.txt').is_file(): - pass - else: - Path('/tmp/gps_data_user_loc.txt').touch() - with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: - user_loc_file.write("[]") - user_loc_file.close() - if Path('/tmp/gps_data_user_bb.txt').is_file(): - pass - else: - Path('/tmp/gps_data_user_bb.txt').touch() - with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: - user_bb_file.write("[]") - user_bb_file.close() +## if Path('/tmp/gps_data_user_loc.txt').is_file(): +## pass +## else: +## Path('/tmp/gps_data_user_loc.txt').touch() +## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: +## user_loc_file.write("[]") +## user_loc_file.close() +## if Path('/tmp/gps_data_user_bb.txt').is_file(): +## pass +## else: +## Path('/tmp/gps_data_user_bb.txt').touch() +## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: +## user_bb_file.write("[]") +## user_bb_file.close() diff --git a/gps_data-SAMPLE.cfg b/gps_data-SAMPLE.cfg index 9fa1fcf..a7f85ce 100644 --- a/gps_data-SAMPLE.cfg +++ b/gps_data-SAMPLE.cfg @@ -84,7 +84,7 @@ REPORT_CLIENTS: 127.0.0.1 # used. # [LOGGER] -LOG_FILE: /tmp/gps_data.log +LOG_FILE: ./gps_data.log LOG_HANDLERS: console-timed LOG_LEVEL: DEBUG LOG_NAME: HBlink3 GPS/Data diff --git a/gps_data.py b/gps_data.py index c2a1c21..a7ca666 100644 --- a/gps_data.py +++ b/gps_data.py @@ -151,28 +151,30 @@ def aprs_send(packet): logger.info('Packet sent to APRS-IS.') def dashboard_loc_write(call, lat, lon, time): - #try: - dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read()) - # except: - # dash_entries = [] - dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time}) - with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: - user_loc_file.write(str(dash_entries[:15])) - user_loc_file.close() - logger.info('User location saved for dashboard') - #logger.info(dash_entries) + pass +## #try: +## dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read()) +## # except: +## # dash_entries = [] +## dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time}) +## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: +## user_loc_file.write(str(dash_entries[:15])) +## user_loc_file.close() +## logger.info('User location saved for dashboard') +## #logger.info(dash_entries) def dashboard_bb_write(call, dmr_id, time, bulletin): - #try: - dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read()) - # except: - # dash_entries = [] - dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin}) - with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: - user_bb_file.write(str(dash_bb[:10])) - user_bb_file.close() - logger.info('User bulletin entry saved.') - #logger.info(dash_bb) + pass +## #try: +## dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read()) +## # except: +## # dash_entries = [] +## dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin}) +## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: +## user_bb_file.write(str(dash_bb[:10])) +## user_bb_file.close() +## logger.info('User bulletin entry saved.') +## #logger.info(dash_bb) # Send email via SMTP function def send_email(to_email, email_subject, email_message): @@ -610,21 +612,21 @@ if __name__ == '__main__': with open("./user_settings.txt", 'w') as user_dict_file: user_dict_file.write("{1: [{'call': 'N0CALL'}, {'ssid': ''}, {'icon': ''}, {'comment': ''}]}") user_dict_file.close() - # Check to see if dashboard files exist - if Path('/tmp/gps_data_user_loc.txt').is_file(): - pass - else: - Path('/tmp/gps_data_user_loc.txt').touch() - with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: - user_loc_file.write("[]") - user_loc_file.close() - if Path('/tmp/gps_data_user_bb.txt').is_file(): - pass - else: - Path('/tmp/gps_data_user_bb.txt').touch() - with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: - user_bb_file.write("[]") - user_bb_file.close() +## # Check to see if dashboard files exist +## if Path('/tmp/gps_data_user_loc.txt').is_file(): +## pass +## else: +## Path('/tmp/gps_data_user_loc.txt').touch() +## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: +## user_loc_file.write("[]") +## user_loc_file.close() +## if Path('/tmp/gps_data_user_bb.txt').is_file(): +## pass +## else: +## Path('/tmp/gps_data_user_bb.txt').touch() +## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: +## user_bb_file.write("[]") +## user_bb_file.close() # CLI argument parser - handles picking up the config file from the command line, and sending a "help" message parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', action='store', dest='CONFIG_FILE', help='/full/path/to/config.file (usually gps_data.cfg)') diff --git a/hblink-SAMPLE.cfg b/hblink-SAMPLE.cfg index d420d29..c95380b 100755 --- a/hblink-SAMPLE.cfg +++ b/hblink-SAMPLE.cfg @@ -84,7 +84,7 @@ REPORT_CLIENTS: 127.0.0.1 # used. # [LOGGER] -LOG_FILE: /tmp/hblink.log +LOG_FILE: ./hblink.log LOG_HANDLERS: console-timed LOG_LEVEL: DEBUG LOG_NAME: HBlink