fix MD-380 and SMS positions

This commit is contained in:
KF7EEL 2021-01-26 08:54:48 -08:00
parent 0b5ecaa04f
commit 2d94dbe045
2 changed files with 15 additions and 11 deletions

View File

@ -12,7 +12,9 @@ Files modified from original master branch of HBLink3:
* pynmea2 * pynmea2
* aprslib * aprslib
* maidenhead * maidenhead
* Flask
#### Optional Modules
* Flask - required for dashboard
This should work for DMR radios that send location data as a UTF-8 NMEA sentence. I am hopping to add support for more radios in the future. This should work for DMR radios that send location data as a UTF-8 NMEA sentence. I am hopping to add support for more radios in the future.
@ -33,6 +35,7 @@ Actually tested
| MD-380 (stock firmware, GPS) | YES | Most likely | | MD-380 (stock firmware, GPS) | YES | Most likely |
| Motorola DP3601| WIP | WIP | | Motorola DP3601| WIP | WIP |
| Retevis RT73 | YES | Likely | | Retevis RT73 | YES | Likely |
| Ailunce HD1 | YES | Likely |
## Highly suspected to work: ## Highly suspected to work:
Not tested yet, but will most likely work. Not tested yet, but will most likely work.
@ -40,21 +43,22 @@ Not tested yet, but will most likely work.
| Radio | GPS | SMS | | Radio | GPS | SMS |
|-------|:---:|:---:| |-------|:---:|:---:|
| Anytone D868 | Most likely | Most likely | | Anytone D868 | Most likely | Most likely |
| Alinco DJ-MD5TGP | Most likely | Most likely |
| TYT MD-390 | Most likely | Likely | | TYT MD-390 | Most likely | Likely |
| TYT MD-2017 | Most likely | Likely | | TYT MD-2017 | Most likely | Likely |
| TYT MD-9600 | Most likely | Likely | | TYT MD-9600 | Most likely | Likely |
| Retevis RT8 | Most likely | Likely | | Retevis RT8 | Most likely | Likely |
## Tested, but with issues
Tested, but with bugs present.
| Radio | GPS | SMS | ## Tested, but with issues.
Tested, but with bugs present.
| Radio | GPS | SMS |
|-------|:---:|:---:| |-------|:---:|:---:|
| Ailunce HD1 | YES | Not tested yet | | Alinco DJ-MD5TGP | Most likely | Most likely |
## Would like to test: ## Would like to test:
Connect Systems GPS enabled radios
## Features ## Features

View File

@ -157,7 +157,7 @@ def dashboard_bb_write(call, dmr_id, time, bulletin):
# dash_entries = [] # dash_entries = []
dash_bb.insert(0, {'call': call, 'dmr_id': dmr_id, 'time': time, 'bulliten':bulletin}) 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: with open("/tmp/gps_data_user_bb.txt", 'w') as user_bb_file:
user_bb_file.write(str(dash_bb[:5])) user_bb_file.write(str(dash_bb[:10]))
user_bb_file.close() user_bb_file.close()
logger.info('User bulletin entry saved.') logger.info('User bulletin entry saved.')
#logger.info(dash_bb) #logger.info(dash_bb)
@ -259,8 +259,8 @@ def process_sms(_rf_src, sms):
lat_dir = 'N' lat_dir = 'N'
#logger.info(lat) #logger.info(lat)
#logger.info(lat_dir) #logger.info(lat_dir)
aprs_lat = str(str(re.sub('\..*|-', '', str(lat[0]))) + str(re.sub('\..*', '', str(lat[1])) + '.').ljust(5) + lat_dir) aprs_lat = str(str(re.sub('\..*|-', '', str(lat[0]))) + str(re.sub('\..*', '', str(lat[1])) + '.').zfill(4).ljust(5) + lat_dir)
aprs_lon = str(str(re.sub('\..*|-', '', str(lon[0]))) + str(re.sub('\..*', '', str(lon[1])) + '.').ljust(5) + lon_dir) aprs_lon = str(str(re.sub('\..*|-', '', str(lon[0]))) + str(re.sub('\..*', '', str(lon[1])) + '.').zfill(5).ljust(5) + lon_dir)
#logger.info(mh.to_location(grid_square)) #logger.info(mh.to_location(grid_square))
#logger.info(str(lat) + ', ' + str(lon)) #logger.info(str(lat) + ', ' + str(lon))
logger.info('Latitude: ' + str(aprs_lat)) logger.info('Latitude: ' + str(aprs_lat))
@ -376,8 +376,8 @@ class DATA_SYSTEM(HBSYSTEM):
lon_deg = ba2num(bptc_decode(_data)[38:46]) lon_deg = ba2num(bptc_decode(_data)[38:46])
lat_min = ba2num(bptc_decode(_data)[18:24]) lat_min = ba2num(bptc_decode(_data)[18:24])
lon_min = ba2num(bptc_decode(_data)[46:52]) lon_min = ba2num(bptc_decode(_data)[46:52])
lat_min_dec = ba2num(bptc_decode(_data)[24:38]) lat_min_dec = str(ba2num(bptc_decode(_data)[24:38])).zfill(4)
lon_min_dec = ba2num(bptc_decode(_data)[52:66]) lon_min_dec = str(ba2num(bptc_decode(_data)[52:66])).zfill(4)
aprs_lat = str(str(lat_deg) + str(lat_min) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir aprs_lat = str(str(lat_deg) + str(lat_min) + '.' + str(lat_min_dec)[0:2]).zfill(7) + lat_dir
aprs_lon = str(str(lon_deg) + str(lon_min) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir aprs_lon = str(str(lon_deg) + str(lon_min) + '.' + str(lon_min_dec)[0:2]).zfill(8) + lon_dir
# Form APRS packet # Form APRS packet