diff --git a/gps_data-SAMPLE.cfg b/gps_data-SAMPLE.cfg index ca078c2..83b8e15 100644 --- a/gps_data-SAMPLE.cfg +++ b/gps_data-SAMPLE.cfg @@ -119,6 +119,7 @@ DATA_DMR_ID: 9099 CALL_TYPE: unit USER_APRS_SSID: 15 USER_APRS_COMMENT: HBLink3 D-APRS - +# Setting APRS_LOGIN_CALL to N0CALL will cause the gateway to not upload packets to APRS server. APRS_LOGIN_CALL: N0CALL APRS_LOGIN_PASSCODE: 12345 APRS_SERVER: rotate.aprs2.net diff --git a/gps_data.py b/gps_data.py index 6558bdb..eb56a4d 100644 --- a/gps_data.py +++ b/gps_data.py @@ -141,10 +141,15 @@ def header_ID(_data): ## pass def aprs_send(packet): - AIS = aprslib.IS(aprs_callsign, passwd=aprs_passcode,host=aprs_server, port=aprs_port) - AIS.connect() - AIS.sendall(packet) - AIS.close() + if aprs_callsign == 'N0CALL': + logger.info('APRS callsighn set to N0CALL, packet not sent.') + pass + else: + AIS = aprslib.IS(aprs_callsign, passwd=aprs_passcode,host=aprs_server, port=aprs_port) + AIS.connect() + AIS.sendall(packet) + AIS.close() + logger.info('Packet sent to APRS-IS.') def dashboard_loc_write(call, lat, lon, time): #try: @@ -288,13 +293,8 @@ def process_sms(_rf_src, sms): lat_dir = 'N' #logger.info(lat) #logger.info(lat_dir) - #aprs_lat = str(str(re.sub('\..*|-', '', str(lat[0]))) + str(re.sub('\..*', '', str(lat[1])) + '.').ljust(5) + lat_dir) - #aprs_lon = str(str(re.sub('\..*|-', '', str(lon[0]))) + str(re.sub('\..*', '', str(lon[1])) + '.').ljust(5) + lon_dir) - aprs_lat = str(str(re.sub('\..*|-', '', str(lat[0]))) + str(re.sub('\..*', '', str(lat[1])) + '.')).zfill(5) + ' ' + lat_dir aprs_lon = str(str(re.sub('\..*|-', '', str(lon[0]))) + str(re.sub('\..*', '', str(lon[1])) + '.')).zfill(6) + ' ' + lon_dir - #logger.info(mh.to_location(grid_square)) - #logger.info(str(lat) + ', ' + str(lon)) logger.info('Latitude: ' + str(aprs_lat)) logger.info('Longitude: ' + str(aprs_lon)) user_settings = ast.literal_eval(os.popen('cat ./user_settings.txt').read()) @@ -321,7 +321,7 @@ def process_sms(_rf_src, sms): aprslib.parse(aprs_loc_packet) aprs_send(aprs_loc_packet) dashboard_loc_write(str(get_alias(int_id(_rf_src), subscriber_ids)) + '-' + ssid, aprs_lat, aprs_lon, time.strftime('%H:%M:%S - %m/%d/%y')) - logger.info('Sent manual position to APRS') + #logger.info('Sent manual position to APRS') except: logger.info('Exception. Not uploaded') packet_assembly = '' @@ -342,7 +342,7 @@ def process_sms(_rf_src, sms): try: aprslib.parse(aprs_msg_pkt) aprs_send(aprs_msg_pkt) - logger.info('Packet sent.') + #logger.info('Packet sent.') except: logger.info('Error uploading MSG packet.') try: @@ -445,7 +445,7 @@ class DATA_SYSTEM(HBSYSTEM): float(lon_deg) < 121 aprs_send(aprs_loc_packet) dashboard_loc_write(str(get_alias(int_id(_rf_src), subscriber_ids)) + '-' + ssid, aprs_lat, aprs_lon, time.strftime('%H:%M:%S - %m/%d/%y')) - logger.info('Sent APRS packet') + #logger.info('Sent APRS packet') except: logger.info('Error. Failed to send packet. Packet may be malformed.') udt_block = 1 diff --git a/scripts/dashboard/templates/help.html b/scripts/dashboard/templates/help.html index ca551bc..d71f290 100644 --- a/scripts/dashboard/templates/help.html +++ b/scripts/dashboard/templates/help.html @@ -60,10 +60,20 @@ Post a bulliten to the web dashboard. @BB This is a test bulletin. + +@[CALLSIGN W/ SSID] A-[MESSAGE] +Send a message to another station via APRS. +@N0CALL-15 A-This is a test. + + +[EMAIL ADDRESS] E-[MESSAGE] +Send an email to an email address. +test@example.org E-This is a test. +

 

-

Commands should be sent in upper case. Send an SMS to {{data_call_id}} as a {{data_call_type}} with the desired command followed by the value. For example, to change your icon to a dog, the command would be @ICON /p (see the icon table for values). Changing your SSID is as simple as @SSID 7, and @COM Testing 123 will change the comment.

+

Commands should be in upper case. Send an SMS to {{data_call_id}} as a {{data_call_type}} with the desired command followed by the value. For example, to change your icon to a dog, the command would be @ICON /p (see the icon table for values). Changing your SSID is as simple as @SSID 7, and @COM Testing 123 will change the comment.

Sending @BB Test will result in a post to the bulletin board with the messaage of "Test".

To remove any of the stored values, just send the appropriate command without any input. @COM will remove the stored comment, @ICON will remove the stored icon, and @ICON will remove the strored icon. Any position reports sent will have the default settings.

{% include 'footer.html' %}