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.
#
[LOGGER]
LOG_FILE: /tmp/hblink.log
LOG_FILE: ./hblink.log
LOG_HANDLERS: console-timed
LOG_LEVEL: DEBUG
LOG_NAME: HBlink

View File

@ -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()

View File

@ -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

View File

@ -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)')

View File

@ -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