update help, add option to disable APRS upload

This commit is contained in:
KF7EEL 2021-02-04 10:02:01 -08:00
parent bb381f771d
commit dcd770ff1f
3 changed files with 24 additions and 13 deletions

View File

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

View File

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

View File

@ -60,10 +60,20 @@
<td>Post a bulliten to the web dashboard.</td>
<td><em><code>@BB This is a test bulletin.</code></em></td>
</tr>
<tr>
<td><strong>@[CALLSIGN W/ SSID] A-[MESSAGE]</strong></td>
<td>Send a message to another station via APRS.</td>
<td><em><code>@N0CALL-15 A-This is a test.</code></em></td>
</tr>
<tr>
<td><strong>[EMAIL ADDRESS] E-[MESSAGE]</strong></td>
<td>Send an email to an email address.</td>
<td><em><code>test@example.org E-This is a test.</code></em></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><strong>Commands should be sent in upper case.</strong> Send an SMS to <strong>{{data_call_id}}</strong> as a <strong>{{data_call_type}}</strong> with the desired command followed by the value. For example, to change your icon to a dog, the command would be <code>@ICON /p</code> (see the icon table for values). Changing your SSID is as simple as <code>@SSID 7</code>, and <code>@COM Testing 123</code> will change the comment.</p>
<p><strong>Commands should be in upper case.</strong> Send an SMS to <strong>{{data_call_id}}</strong> as a <strong>{{data_call_type}}</strong> with the desired command followed by the value. For example, to change your icon to a dog, the command would be <code>@ICON /p</code> (see the icon table for values). Changing your SSID is as simple as <code>@SSID 7</code>, and <code>@COM Testing 123</code> will change the comment.</p>
<p>Sending <code>@BB Test</code> will result in a post to the bulletin board with the messaage of "Test".</p>
<p><strong>To remove any of the stored values, just send the appropriate command without any input.</strong> <code>@COM</code> will remove the stored comment, <code>@ICON</code> will remove the stored icon, and <code>@ICON</code> will remove the strored icon. Any position reports sent will have the default settings.</p>
{% include 'footer.html' %}