disable dashboard stuff

This commit is contained in:
KF7EEL 2021-02-08 14:46:11 -08:00
parent 74ca23af73
commit bcb55b7d72
5 changed files with 76 additions and 72 deletions

View File

@ -84,7 +84,7 @@ REPORT_CLIENTS: 127.0.0.1
# used. # used.
# #
[LOGGER] [LOGGER]
LOG_FILE: /tmp/hblink.log LOG_FILE: ./hblink.log
LOG_HANDLERS: console-timed LOG_HANDLERS: console-timed
LOG_LEVEL: DEBUG LOG_LEVEL: DEBUG
LOG_NAME: HBlink LOG_NAME: HBlink

View File

@ -158,28 +158,30 @@ def aprs_send(packet):
logger.info('Packet sent to APRS-IS.') logger.info('Packet sent to APRS-IS.')
def dashboard_loc_write(call, lat, lon, time): def dashboard_loc_write(call, lat, lon, time):
#try: pass
dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read()) ## #try:
# except: ## dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read())
# dash_entries = [] ## # except:
dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time}) ## # dash_entries = []
with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: ## dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time})
user_loc_file.write(str(dash_entries[:15])) ## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file:
user_loc_file.close() ## user_loc_file.write(str(dash_entries[:15]))
logger.info('User location saved for dashboard') ## user_loc_file.close()
#logger.info(dash_entries) ## logger.info('User location saved for dashboard')
## #logger.info(dash_entries)
def dashboard_bb_write(call, dmr_id, time, bulletin): def dashboard_bb_write(call, dmr_id, time, bulletin):
#try: pass
dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read()) ## #try:
# except: ## dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read())
# dash_entries = [] ## # except:
dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin}) ## # dash_entries = []
with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: ## dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin})
user_bb_file.write(str(dash_bb[:10])) ## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file:
user_bb_file.close() ## user_bb_file.write(str(dash_bb[:10]))
logger.info('User bulletin entry saved.') ## user_bb_file.close()
#logger.info(dash_bb) ## logger.info('User bulletin entry saved.')
## #logger.info(dash_bb)
# Send email via SMTP function # Send email via SMTP function
def send_email(to_email, email_subject, email_message): 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.write("{1: [{'call': 'N0CALL'}, {'ssid': ''}, {'icon': ''}, {'comment': ''}]}")
user_dict_file.close() user_dict_file.close()
# Check to see if dashboard files exist # Check to see if dashboard files exist
if Path('/tmp/gps_data_user_loc.txt').is_file(): ## if Path('/tmp/gps_data_user_loc.txt').is_file():
pass ## pass
else: ## else:
Path('/tmp/gps_data_user_loc.txt').touch() ## Path('/tmp/gps_data_user_loc.txt').touch()
with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: ## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file:
user_loc_file.write("[]") ## user_loc_file.write("[]")
user_loc_file.close() ## user_loc_file.close()
if Path('/tmp/gps_data_user_bb.txt').is_file(): ## if Path('/tmp/gps_data_user_bb.txt').is_file():
pass ## pass
else: ## else:
Path('/tmp/gps_data_user_bb.txt').touch() ## Path('/tmp/gps_data_user_bb.txt').touch()
with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: ## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file:
user_bb_file.write("[]") ## user_bb_file.write("[]")
user_bb_file.close() ## user_bb_file.close()

View File

@ -84,7 +84,7 @@ REPORT_CLIENTS: 127.0.0.1
# used. # used.
# #
[LOGGER] [LOGGER]
LOG_FILE: /tmp/gps_data.log LOG_FILE: ./gps_data.log
LOG_HANDLERS: console-timed LOG_HANDLERS: console-timed
LOG_LEVEL: DEBUG LOG_LEVEL: DEBUG
LOG_NAME: HBlink3 GPS/Data LOG_NAME: HBlink3 GPS/Data

View File

@ -151,28 +151,30 @@ def aprs_send(packet):
logger.info('Packet sent to APRS-IS.') logger.info('Packet sent to APRS-IS.')
def dashboard_loc_write(call, lat, lon, time): def dashboard_loc_write(call, lat, lon, time):
#try: pass
dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read()) ## #try:
# except: ## dash_entries = ast.literal_eval(os.popen('cat /tmp/gps_data_user_loc.txt').read())
# dash_entries = [] ## # except:
dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time}) ## # dash_entries = []
with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: ## dash_entries.insert(0, {'call': call, 'lat': lat, 'lon': lon, 'time':time})
user_loc_file.write(str(dash_entries[:15])) ## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file:
user_loc_file.close() ## user_loc_file.write(str(dash_entries[:15]))
logger.info('User location saved for dashboard') ## user_loc_file.close()
#logger.info(dash_entries) ## logger.info('User location saved for dashboard')
## #logger.info(dash_entries)
def dashboard_bb_write(call, dmr_id, time, bulletin): def dashboard_bb_write(call, dmr_id, time, bulletin):
#try: pass
dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read()) ## #try:
# except: ## dash_bb = ast.literal_eval(os.popen('cat /tmp/gps_data_user_bb.txt').read())
# dash_entries = [] ## # except:
dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin}) ## # dash_entries = []
with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: ## dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin})
user_bb_file.write(str(dash_bb[:10])) ## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file:
user_bb_file.close() ## user_bb_file.write(str(dash_bb[:10]))
logger.info('User bulletin entry saved.') ## user_bb_file.close()
#logger.info(dash_bb) ## logger.info('User bulletin entry saved.')
## #logger.info(dash_bb)
# Send email via SMTP function # Send email via SMTP function
def send_email(to_email, email_subject, email_message): 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: with open("./user_settings.txt", 'w') as user_dict_file:
user_dict_file.write("{1: [{'call': 'N0CALL'}, {'ssid': ''}, {'icon': ''}, {'comment': ''}]}") user_dict_file.write("{1: [{'call': 'N0CALL'}, {'ssid': ''}, {'icon': ''}, {'comment': ''}]}")
user_dict_file.close() user_dict_file.close()
# Check to see if dashboard files exist ## # Check to see if dashboard files exist
if Path('/tmp/gps_data_user_loc.txt').is_file(): ## if Path('/tmp/gps_data_user_loc.txt').is_file():
pass ## pass
else: ## else:
Path('/tmp/gps_data_user_loc.txt').touch() ## Path('/tmp/gps_data_user_loc.txt').touch()
with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file: ## with open("/tmp/gps_data_user_loc.txt", 'w') as user_loc_file:
user_loc_file.write("[]") ## user_loc_file.write("[]")
user_loc_file.close() ## user_loc_file.close()
if Path('/tmp/gps_data_user_bb.txt').is_file(): ## if Path('/tmp/gps_data_user_bb.txt').is_file():
pass ## pass
else: ## else:
Path('/tmp/gps_data_user_bb.txt').touch() ## Path('/tmp/gps_data_user_bb.txt').touch()
with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file: ## with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file:
user_bb_file.write("[]") ## user_bb_file.write("[]")
user_bb_file.close() ## user_bb_file.close()
# CLI argument parser - handles picking up the config file from the command line, and sending a "help" message # CLI argument parser - handles picking up the config file from the command line, and sending a "help" message
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', action='store', dest='CONFIG_FILE', help='/full/path/to/config.file (usually gps_data.cfg)') parser.add_argument('-c', '--config', action='store', dest='CONFIG_FILE', help='/full/path/to/config.file (usually gps_data.cfg)')

View File

@ -84,7 +84,7 @@ REPORT_CLIENTS: 127.0.0.1
# used. # used.
# #
[LOGGER] [LOGGER]
LOG_FILE: /tmp/hblink.log LOG_FILE: ./hblink.log
LOG_HANDLERS: console-timed LOG_HANDLERS: console-timed
LOG_LEVEL: DEBUG LOG_LEVEL: DEBUG
LOG_NAME: HBlink LOG_NAME: HBlink