Compare commits

..

186 Commits

Author SHA1 Message Date
KF7EEL
be1c306af8
Update README.md 2021-09-05 19:24:34 -07:00
KF7EEL
421a0ddc49
Update README.md 2021-04-29 11:55:38 -07:00
KF7EEL
e97e5cff32 fix dashboard logging bug 2021-03-11 17:54:38 -08:00
KF7EEL
7f46a19749 improve PIN write to user_settings 2021-03-11 08:40:55 -08:00
KF7EEL
e6ace9e72d fix missing code from bridge_gps_data.py 2021-03-11 08:02:24 -08:00
KF7EEL
1fb22d01c6 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2021-03-11 07:52:43 -08:00
KF7EEL
4e0c87dac9 fix config.py, add editing of user settings to dashboard, limit number of stored locations per user 2021-03-11 07:52:06 -08:00
KF7EEL
ef850596d1
cap positions on map at 15 for station view 2021-03-05 08:15:42 -08:00
KF7EEL
247168d567
fix typo 2021-03-05 07:27:25 -08:00
KF7EEL
6a6fdf367a
correct condition 2021-03-05 07:20:07 -08:00
KF7EEL
b860dc75ba
pass on blank addrersse messages 2021-03-05 07:15:58 -08:00
KF7EEL
6cc6f7fc81
fix exception 2021-03-04 17:15:37 -08:00
KF7EEL
873bbb6ce7
fix bug again 2021-03-04 16:55:17 -08:00
KF7EEL
2e5dec5cac fix bugs 2021-03-04 16:31:54 -08:00
KF7EEL
239c0730c0 fix incorrect config 2021-03-04 15:17:51 -08:00
KF7EEL
fcff610fd3 fix bugs, add user settings to config 2021-03-04 15:16:03 -08:00
KF7EEL
6a1476af51
Update gps_data-SAMPLE.cfg 2021-03-04 13:57:10 -08:00
KF7EEL
295dfbda1f rewrite dahboard config, update APRS receive 2021-03-04 12:36:45 -08:00
KF7EEL
e61f90fcfd initial untested receive script 2021-03-03 16:42:01 -08:00
KF7EEL
599f549ab9 add dashboard APRS message hook 2021-03-03 16:36:25 -08:00
KF7EEL
65ab256b7f fix dashboard SOS bug 2021-03-02 14:04:42 -08:00
KF7EEL
104cab1c29 fix typo 2021-03-02 13:46:12 -08:00
KF7EEL
eded346f91 fix typo 2021-03-02 13:41:40 -08:00
KF7EEL
a91eb65273 make mailbox file persistent 2021-03-02 13:40:03 -08:00
KF7EEL
5b1e250d57 fix exception in map view 2021-03-02 12:56:24 -08:00
KF7EEL
d332604f26 add comment to map plots 2021-03-02 12:41:03 -08:00
KF7EEL
888d8c19b7 fix typos 2021-03-01 20:24:37 -08:00
KF7EEL
cb47556205 switch to UNIX time 2021-03-01 20:11:32 -08:00
KF7EEL
f8cdf8fead minor improvement, remove user_settings.html 2021-03-01 18:16:49 -08:00
KF7EEL
d0e90531c6 fix mailbox parsing 2021-03-01 16:50:55 -08:00
KF7EEL
dccf561e3d add generic template 2021-03-01 16:41:36 -08:00
KF7EEL
751af20357 update help 2021-03-01 16:39:48 -08:00
KF7EEL
12dc612c2e add mailbox feature 2021-03-01 15:58:09 -08:00
KF7EEL
dfedf9eade add generic template to dashboard 2021-03-01 14:18:51 -08:00
KF7EEL
ee7c7eccf1 add user setting query, improve dashboard 2021-03-01 13:52:22 -08:00
KF7EEL
f4010939dc increase number of BB entries in RSS 2021-02-28 20:01:29 -08:00
KF7EEL
9b19a09eac limit map size on track screen 2021-02-28 19:48:42 -08:00
KF7EEL
89176e922c add option for map theme 2021-02-28 17:27:08 -08:00
KF7EEL
7febe66a76 add notice function as an alternative to emergency 2021-02-28 17:01:32 -08:00
KF7EEL
ce36850621 use internal map rather than aprs.fi 2021-02-28 16:17:58 -08:00
KF7EEL
3368683a1f update emergency function 2021-02-28 14:37:23 -08:00
KF7EEL
d84e937c1f add emergency feature 2021-02-28 13:47:02 -08:00
KF7EEL
ec82ce8b24 add bulletin board rss, correct spelling of bulletin 2021-02-28 12:25:19 -08:00
KF7EEL
40a3030694 update map look and feel 2021-02-28 10:51:39 -08:00
KF7EEL
f68c5d0691 improve map 2021-02-27 15:44:14 -08:00
KF7EEL
bf9b45d44f fix map template 2021-02-27 15:11:09 -08:00
KF7EEL
fb9226e04f add tracking to map 2021-02-27 14:57:48 -08:00
KF7EEL
b00ba9ea62 improve map plotting 2021-02-27 06:55:48 -08:00
KF7EEL
9b14982abe improve map and dashboard 2021-02-26 23:30:49 -08:00
KF7EEL
61fd13514b increase positions logged 2021-02-26 21:51:42 -08:00
KF7EEL
77309d5ca6 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2021-02-26 21:17:33 -08:00
KF7EEL
db77a165b4 add map to dashboard 2021-02-26 21:17:06 -08:00
KF7EEL
83274856a3
Update README.md 2021-02-26 18:50:02 -08:00
KF7EEL
72ed9f2d2b
remove aprs_upload calls
Accidentally added aprs calls from aprs_features branch
2021-02-26 13:45:06 -08:00
KF7EEL
1b904e9af7 improve regexp for APRS messages 2021-02-26 13:40:44 -08:00
KF7EEL
db068d859e add exception logging 2021-02-26 10:49:54 -08:00
KF7EEL
74ca23af73 add example config for combined application 2021-02-08 12:38:45 -08:00
KF7EEL
76cadf01a4 fix typo 2021-02-07 15:02:52 -08:00
KF7EEL
ccd197a8c1 add combined bridge/D-APRS 2021-02-07 13:52:03 -08:00
KF7EEL
1a96434c78 fix typo 2021-02-04 12:58:16 -08:00
KF7EEL
3047b55bcc add 14FRS2013 contributions, add both option for call type 2021-02-04 12:45:14 -08:00
KF7EEL
21a0c95ad3 add option to disable APRS upload 2021-02-04 10:06:09 -08:00
Roby
08f53ee1a4
Update help.html (#22)
Add new commands
2021-02-03 13:37:54 -08:00
KF7EEL
82ce4995ae Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2021-02-02 12:04:19 -08:00
KF7EEL
dc5dbc0f7f fix typo for GNRMC 2021-02-02 12:04:03 -08:00
KF7EEL
85d085d563
Update README.md 2021-02-02 11:57:24 -08:00
KF7EEL
5e349a9705 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2021-02-02 11:36:17 -08:00
KF7EEL
664cc46b63 potential fix for RT73 2021-02-02 11:35:56 -08:00
KF7EEL
45dca64490
Update README.md 2021-02-01 17:31:19 -08:00
KF7EEL
bc8bb8b298
Update README.md 2021-02-01 17:29:35 -08:00
KF7EEL
40fa5372ce
change email syntax, bug fix 2021-02-01 17:28:11 -08:00
KF7EEL
586533ac4c
Update README.md 2021-02-01 07:32:55 -08:00
KF7EEL
f99451b0a4
Update gps_data-SAMPLE.cfg 2021-01-31 12:56:48 -08:00
KF7EEL
afb249c418 fix bugs 2021-01-31 12:45:43 -08:00
KF7EEL
a750dedab0 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2021-01-31 12:36:35 -08:00
KF7EEL
84f7baf9b4
Update requirements.txt 2021-01-31 12:35:22 -08:00
KF7EEL
fccbdc908c
Update README.md 2021-01-31 12:34:58 -08:00
KF7EEL
2affa319d4
Update README.md 2021-01-31 12:33:57 -08:00
KF7EEL
54f4ad799e imrove email template 2021-01-31 11:55:09 -08:00
KF7EEL
372bb845b2 add email sending 2021-01-31 11:42:15 -08:00
KF7EEL
fcb0f1bd05 fix manual positions 2021-01-31 09:17:45 -08:00
KF7EEL
14f4eafa6e
Update footer.html 2021-01-30 11:22:53 -08:00
KF7EEL
bebf487936
Update help.html 2021-01-30 11:18:28 -08:00
KF7EEL
9def4fbfec
Update help.html 2021-01-30 09:58:10 -08:00
KF7EEL
33f499a32a
Update gps_data.py 2021-01-30 09:15:18 -08:00
KF7EEL
2d94dbe045 fix MD-380 and SMS positions 2021-01-26 08:54:48 -08:00
KF7EEL
0b5ecaa04f
Update README.md 2021-01-21 15:50:47 -08:00
KF7EEL
becbffed8e
Update README.md 2021-01-12 14:23:54 -08:00
KF7EEL
24e5329ac7 add sending messages to APRS 2021-01-12 13:54:53 -08:00
KF7EEL
e7b76acaff fix typo 2021-01-12 10:00:38 -08:00
KF7EEL
c9b9c307d6 add GNRMC to filter to allow RT73 compatability 2021-01-12 09:56:17 -08:00
M0GLJ
22d371a8f6
Update README.md (#19)
Model Correction
2021-01-10 10:01:49 -08:00
KF7EEL
f81e5dae78
Update README.md 2021-01-08 10:19:28 -08:00
KF7EEL
bd4bb0b611
Change example to allow D-APRS out of the box 2021-01-07 15:10:34 -08:00
KF7EEL
d76a808e4a
Update gps_data.py 2021-01-06 11:31:22 -08:00
KF7EEL
e6e9600e73 fix grammar 2021-01-02 18:13:35 -08:00
KF7EEL
22e04f6ff3 fix dash width 2021-01-02 18:02:55 -08:00
KF7EEL
a943748c94 fix missing templates 2021-01-02 16:17:34 -08:00
KF7EEL
674f9102d1 improve dash 2021-01-02 15:58:45 -08:00
KF7EEL
3dde015e5d Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2021-01-02 14:58:58 -08:00
KF7EEL
3b36b44c5d add page, split header and footer 2021-01-02 14:58:38 -08:00
KF7EEL
e4ef4383fe
Update gps_data-SAMPLE.cfg 2021-01-02 08:46:56 -08:00
KF7EEL
f2675d885c clean up pages 2021-01-01 15:10:12 -08:00
KF7EEL
105f4bdc7a fix html 2021-01-01 14:46:05 -08:00
KF7EEL
1df3026a59 update dashboard theme 2021-01-01 14:44:08 -08:00
KF7EEL
79fe60fc3f add about page 2021-01-01 14:35:15 -08:00
KF7EEL
3a3f4719a0 fix description yet again 2021-01-01 14:16:57 -08:00
KF7EEL
dcc1b4ff40 fix description again 2021-01-01 14:15:43 -08:00
KF7EEL
e753f4f56b fix description location 2021-01-01 14:12:38 -08:00
KF7EEL
215af2ea6c add description to dashboard 2021-01-01 14:09:14 -08:00
KF7EEL
944e3bf1af
Update requirements.txt 2021-01-01 13:51:45 -08:00
M0GLJ
ecba8f75bd
Added install.sh and appended requirements.txt (#16)
* Create install.sh

* Update requirements.txt

Add additional for gps operation
2021-01-01 13:51:20 -08:00
M0GLJ
1af61d184a
Update README.md (#17) 2021-01-01 13:50:21 -08:00
KF7EEL
f411531bd0 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2021-01-01 09:58:33 -08:00
KF7EEL
15111563ed fix bug, improve index template 2021-01-01 09:58:13 -08:00
KF7EEL
b6adc461c6
Update README.md 2021-01-01 09:43:19 -08:00
KF7EEL
6fc4dcfe27
Update README.md 2021-01-01 09:37:22 -08:00
KF7EEL
8cb40cbe2c add host to dashboard 2020-12-30 16:41:51 -08:00
KF7EEL
7cd73740b4 add port settings 2020-12-30 09:35:25 -08:00
KF7EEL
6da1c4de0d update web dashboard, add template 2020-12-30 09:10:23 -08:00
KF7EEL
e4b55b05fe basic functioning web dashboard 2020-12-29 20:36:07 -08:00
KF7EEL
54bdbd72e8 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps
add backend code for upcoming web dashboard
2020-12-27 20:39:42 -08:00
KF7EEL
3a8e111443 add backend code for upcoming web dashboard 2020-12-27 20:39:17 -08:00
KF7EEL
a04f8e8cc3
Update README.md 2020-12-27 08:33:02 -08:00
KF7EEL
350b366ffd
Update README.md 2020-12-26 15:30:58 -08:00
KF7EEL
636246c664
Update README.md 2020-12-26 14:47:52 -08:00
KF7EEL
2a752487d0 add UDT SAP requirement to reduce fake packets 2020-12-26 14:31:11 -08:00
KF7EEL
c6ebf86b0f add UDT UAB criteria to reduce inaccurate packets 2020-12-26 13:43:19 -08:00
KF7EEL
4900f859f8 fix parse bug, md-380 working again 2020-12-26 12:53:50 -08:00
KF7EEL
17999eb3f4 fix typo 2020-12-26 10:38:03 -08:00
KF7EEL
c09d2ea734 fix hdr_type error for non MD-380 radios 2020-12-26 09:59:08 -08:00
KF7EEL
84eaaf70f7 remove code from accidental commit 2020-12-24 13:53:44 -08:00
KF7EEL
a0d49b5175
Update README.md 2020-12-23 22:59:52 -08:00
KF7EEL
423d269e78
Update README.md 2020-12-23 22:53:23 -08:00
KF7EEL
9c73c70d71 fix typo in gps_data.py 2020-12-23 16:09:45 -08:00
KF7EEL
11e5aba3fc fix typo 2020-12-23 15:27:59 -08:00
KF7EEL
f6a501a42e initial commit for MD-380 type radios 2020-12-23 15:19:10 -08:00
KF7EEL
6902b3bd4c fix beacon time to minutes 2020-12-11 13:05:59 -08:00
KF7EEL
fe1daeb406 add APRS beacon script for gps_data 2020-12-11 12:49:34 -08:00
KF7EEL
76ad6adea4 add APRS beacon script for gps_data 2020-12-11 12:47:43 -08:00
KF7EEL
542e7496ca fix import time 2020-12-06 16:39:05 -08:00
KF7EEL
05a90944e2 add official tocall, add timestamp, and hook for MD-380 GPS 2020-12-06 12:30:20 -08:00
KF7EEL
804cb1c025
Update README.md 2020-12-01 13:35:32 -08:00
KF7EEL
b2fda94746
Update README.md 2020-12-01 13:34:39 -08:00
KF7EEL
6d934096aa
Update README.md 2020-12-01 13:21:26 -08:00
KF7EEL
a583ff92d2 parse all SMS for command string instead of header 2020-12-01 12:15:17 -08:00
KF7EEL
43e6e6d6b1 change handling of unknown SMS 2020-12-01 09:15:57 -08:00
KF7EEL
579ba3d282 add ETSI like SMS 2020-11-30 17:25:33 -08:00
KF7EEL
5c8be7c177 add debug statements 2020-11-30 14:08:33 -08:00
KF7EEL
28a2e7ba70 APRS position via SMS for grid square 2020-11-30 12:38:50 -08:00
KF7EEL
b47d70142d
Update README.md 2020-11-30 10:03:59 -08:00
KF7EEL
896ba4fbae change file read, move global declaration 2020-11-30 09:59:15 -08:00
KF7EEL
d202f4d0ce fix group SMS for Motorola, fix typo 2020-11-29 15:36:44 -08:00
KF7EEL
4beaf3000d added blank variables to attempt to fix bug 2020-11-29 15:08:53 -08:00
KF7EEL
7e19e705ef
Update README.md 2020-11-28 23:53:53 -08:00
KF7EEL
821c57b381
Update README.md 2020-11-28 19:57:37 -08:00
KF7EEL
ffdfe55cb8 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2020-11-28 09:15:26 -08:00
KF7EEL
9e40195161 attempt to fix bug with assembled packets 2020-11-28 09:14:26 -08:00
KF7EEL
7fd8500105
Update README.md 2020-11-27 23:53:22 -08:00
KF7EEL
d9e5085765
Update README.md 2020-11-27 09:39:18 -08:00
KF7EEL
d7afa94a5a added user settings, added speed and course 2020-11-27 09:31:38 -08:00
KF7EEL
00e3ea840c update readme, sample, and functions 2020-11-26 19:40:43 -08:00
KF7EEL
9dc7ce12e1 fix another bug 2020-11-26 17:44:19 -08:00
KF7EEL
a21393313f revert change, remove UNIT_MAP changes 2020-11-26 15:23:33 -08:00
KF7EEL
e736893543 time for static unit now generated at start 2020-11-26 11:50:28 -08:00
KF7EEL
e88d545955 add hooks in code for shell commands 2020-11-25 15:53:42 -08:00
KF7EEL
eca8619153 Merge branch 'gps' of https://github.com/kf7eel/hblink3 into gps 2020-11-25 14:52:41 -08:00
KF7EEL
8e8836057b fix typo for unit calls 2020-11-25 14:50:49 -08:00
KF7EEL
471feee9c3 implement static routes for unit calls 2020-11-25 14:39:28 -08:00
KF7EEL
d4e1ebd4ec
Update README.md 2020-11-25 12:35:06 -08:00
KF7EEL
ee40ad1e34
Update README.md 2020-11-25 12:17:51 -08:00
KF7EEL
37521fc7f1 implement custom UNIT time 2020-11-25 12:02:58 -08:00
KF7EEL
64ee23788a
Update README.md 2020-11-24 11:56:40 -08:00
KF7EEL
c07edcdc91 ensure lat and lon are float 2020-11-23 13:43:54 -08:00
KF7EEL
29fb602fcb
Update README.md 2020-11-23 13:19:04 -08:00
KF7EEL
6b9ae44256 add info to README 2020-11-23 13:15:22 -08:00
KF7EEL
72a9bd015b fix typo again 2020-11-23 12:54:44 -08:00
KF7EEL
0ffd119994 implement basic SMS processing 2020-11-23 12:52:40 -08:00
KF7EEL
0056e1e09e moved config to file 2020-11-23 10:08:31 -08:00
KF7EEL
84dee59b37 fix typo 2020-11-22 22:03:02 -08:00
KF7EEL
696e0bc128 fix typo 2020-11-22 21:58:45 -08:00
KF7EEL
f233e50516 fix old data bug 2020-11-22 20:39:45 -08:00
KF7EEL
6293497b61 decode motorola type sms 2020-11-22 18:51:46 -08:00
KF7EEL
6c3cab0827 added debug stuff 2020-11-22 13:55:06 -08:00
KF7EEL
0c6912c55f fix typo 2020-11-22 12:44:52 -08:00
KF7EEL
e838fc3423 now using NMEA parser 2020-11-22 12:43:38 -08:00
10 changed files with 212 additions and 238 deletions

176
README.md
View File

@ -1,13 +1,177 @@
### This project has morphed into HBNet. It is still under heavy development and not ready for production. You can see it [here](https://github.com/kf7eel/hblink3/tree/hbnet). The example/development server can be found at [https://demo.hbnet.xyz](https://demo.hbnet.xyz).
# "Fully Featured" HBLink3
# GPS/Data Application
This is my version of HBLink3 that I use in "production." I have merged the private-call branch here. I have also merged a modified implementation of uploading APRS locations for connected peers here (modified to "per master" configuration. APRS peer implementation originally by **IU7IGU**). Finally, I have included the GPS/Data Application here to support APRS position reports from some GPS enabled radios. All of this leads to the following features:
This repository contains everything needed to decode DMR GPS packets and SMS for HBLink3. This application can act as a master or peer and receive data as a group call or private call. It is designed to work in a multi system/user network.
* Working Unit calls (private calls)
* APRS position upload for connected repeaters and hotspots
* APRS position upload from some GPS enabled radios
Files modified from original master branch of HBLink3:
**The same stuff (commands, settings, etc.) in the gps branch apply here as well.**
* bridge.py
* config.py
#### Required modules
* pynmea2
* aprslib
* maidenhead
#### Optional Modules
* Flask - Required for dashboard
* smtplib - Required for sending email. If pip fails to install module, it may already be installed as most Linux distributions have this module by default.
* traceback - If pip fails to install module, it may already be installed as most Linux distrobutions have this module by default.
* slixmpp - Required for upcoming XMPP gateway.
* folium - Required for mapping on 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.
### Differences in branches
* **GPS**: Contains the GPS/Data Application.
* **aprs_features**: Contains the GPS/Data Application and a modified version of the APRS implementation for repeaters and hotspots by **IU7IGU**. (See [https://github.com/iu7igu/hblink3-aprs](https://github.com/iu7igu/hblink3-aprs) for his work). I combined these for convenience.
## Confirmed working:
Actually tested
| Radio | GPS | SMS |
|-------|:---:|:---:|
| Anytone D878| YES | YES |
| Anytone D578| YES | YES |
| BTech DMR-6x2 | YES | Most likely |
| MD-380 (MD380tools, no GPS) | - | YES |
| MD-380 (stock firmware, GPS) | YES | Most likely |
| MD-390 (stock firmware) | YES | YES |
| Retevis RT73* | YES | YES |
| Ailunce HD1 | YES | YES |
*RT73 must have unconfirmed data setting enabled.
## Highly suspected to work:
Not tested yet, but will most likely work.
| Radio | GPS | SMS |
|-------|:---:|:---:|
| Anytone D868 | Most likely | Most likely |
| TYT MD-2017 | Most likely | Likely |
| TYT MD-9600 | Most likely | Likely |
| Retevis RT8 | Most likely | Likely |
## Tested, but with issues.
Tested, but with bugs present.
| Radio | GPS | SMS |
|-------|:---:|:---:|
| Alinco DJ-MD5TGP | WIP | Most likely |
| Motorola DP3601| WIP | WIP |
## Would like to test:
Connect Systems GPS enabled radios
## Features
* Decode GPS locations and upload APRS position packets
* Each user/DMR ID can customize APRS position
* Ability to receive data as a private call or group call
* Trigger a command or script via DMR SMS
* Optional web dashboard to show APRS packets uploaded
* Display bulletins sent via SMS on web dashboard
## How it works
A user should configure their radio for the DMR ID of the application and private or group call. When a position is received by the application, it will extract the coordinates and create an APRS position packet. The application will find the callsign of the user based on the sending radio's DMR ID. It is essential to have an up to date subscriber_ids file for this to work. A predefined APRS SSID is appended to the callsign. The APRS location packet is then uploaded to APRS-IS. No setup is required beforehand on the part of the user. This is pretty much "plug and play."
For example, N0CALL has a DMR ID of 1234567. N0CALL's radio sends a position to the application. The application will query the subscriber_ids file for DMR ID 1234567. The result will be N0CALL. An APRS location pack is created and uploaded to APRS-IS.
## Individual user/DMR ID APRS settings
By default, all APRS positions will have an SSID of 15, a default comment, and the callsign of the DMR user. These default settings can be changed.
The comment, SSID, and icon can be set for each individual user/DMR ID the application sees. The application stores all the setting in a file. You may have different SSIDs, icons, and comments for different DMR IDs. This is done via DMR SMS using the following commands:
| Command | Description | Example |
|-------|:---:|:---:|
|**@SSID**|Change SSID of user callsign.|`@SSID 7`|
|**@ICON**|Change the icon of the APRS position. *See [http://aprs.net/vm/DOS/SYMBOLS.HTM](http://aprs.net/vm/DOS/SYMBOLS.HTM) for icon list.|`@icon /p`|
|**@COM**|Change the comment of the APRS.|`@COM This is a test comment.`|
|**@MH**|Set you location by maidenhead grid square. Designed for radios with no GPS or that are not compatable yet.|`@MH DN97uk`|
|**@BB**|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.`|
Send a DMR SMS to the configured dmr_data_id in the application 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 `@COM` will remove the strored comment. Any position now reports sent will have the default settings.
## Web Dashboard
The web dashboard is completely optional. Python module flask is required for this to work. The web dashboard will display the last 15 positions of radios sent to APRS-IS. The dashboard will also sh user bulletin. A bulletin is a message sent via SMS that will display on the web dashboard. There are several uses for this, including: testing SMS functionality of radio, announcements, and moire. It is a novel feature. The page will automatically reload every 2 minutes. Setup is rather simple. Just modify the example config in the dashboard directory and rename it to dashboard_settings.py. Then start dashboard.py.
## APRS messaging
**At this time, only sending of messages from DMR SMS to APRS-IS is supported.** I find this feature very pointless because it will only go one way, but someone else may find it important. **Messages from sent from APRS-IS to DMR SMS will not work.** I have not written the code for this yet. It will likley be a long time before this is a possibility.
## APRS TOCALL
The project was granted a [tocall](http://www.aprs.org/aprs11/tocalls.txt) of **APHBLx** by Bob Bruniga, WB4APR. This will identify that your APRS position came from HBLink. The x on the end can be any letter/number. Here are the current designations of APHBLx:
* **APHBL3** - HBlink3 D-APRS gateway
* **APHBLD** - DMRlink D-APRS gateway (the IPSC version of the project)
* **_APHBLS_** - Planned, but not in use: HBLink3 via KISS TNC
## Configuration
See hblink_SAMPLE.cfg, rules_SAMPLE.py, and gps_data_SAMPLE.cfg for examples.
## Special thanks to:
**N0MJS** - For creating HBLink and dmr_utils. This project not possible without him.
**IU7IGU** - For creating APRS position beaconing for PEER connections.
**IV3JDV** - For helping debug SMS in Anytone radios.
**KD7LMN** - For pointing out a critical bug.
**KB5PBM** - For helping implement support for MD-380 type radios.
**EI7IG** - For writing the page explaining MD-380 type GPS packets.
**M0GLJ** - For assisting with Motorola testing.
## Resources for DMR data
I spent many hours looking at the following for this project. You may find these links useful.
https://github.com/travisgoodspeed/md380tools/issues/160
https://jpronans.github.io/ei7ig/dmr.html
http://cloud.dstar.su/files/G4KLX/MMDVM/MMDVM%20Specification%2020150922.pdf
https://wiki.brandmeister.network/index.php/NMEA_Location_Reporting
https://forums.radioreference.com/threads/motorola-lrrp-protocol.370081/
https://forums.radioreference.com/threads/lrrp-decoding.359575/
https://github.com/polkabana/go-dmr
https://github.com/nonoo/dmrshark
https://wiki.brandmeister.network/index.php/Compressed_Location_Reporting
All of the ETSI DMR documents (ETSI 102 361-1 through 361-4).
The Shark RF forums.
---
### FOR SUPPORT, DISCUSSION, GETTING INVOLVED ###

View File

@ -42,7 +42,7 @@ from twisted.protocols.basic import NetstringReceiver
from twisted.internet import reactor, task
# Things we import from the main hblink module
from hblink import HBSYSTEM, OPENBRIDGE, systems, hblink_handler, reportFactory, REPORT_OPCODES, mk_aliases, aprs_upload
from hblink import HBSYSTEM, OPENBRIDGE, systems, hblink_handler, reportFactory, REPORT_OPCODES, mk_aliases
from dmr_utils3.utils import bytes_3, int_id, get_alias
from dmr_utils3 import decode, bptc, const
import config
@ -1183,8 +1183,6 @@ if __name__ == '__main__':
logger.info('(REPORT) TCP Socket reporting not configured')
# HBlink instance creation
# Run aprs_upload loop
aprs_upload(CONFIG)
logger.info('(GLOBAL) HBlink \'bridge.py\' -- SYSTEM STARTING...')
for system in CONFIG['SYSTEMS']:
if CONFIG['SYSTEMS'][system]['ENABLED']:

View File

@ -46,7 +46,7 @@ from twisted.protocols.basic import NetstringReceiver
from twisted.internet import reactor, task
# Things we import from the main hblink module
from hblink import HBSYSTEM, OPENBRIDGE, systems, hblink_handler, reportFactory, REPORT_OPCODES, config_reports, mk_aliases, acl_check, aprs_upload
from hblink import HBSYSTEM, OPENBRIDGE, systems, hblink_handler, reportFactory, REPORT_OPCODES, config_reports, mk_aliases, acl_check
from dmr_utils3.utils import bytes_3, int_id, get_alias
from dmr_utils3 import decode, bptc, const
import config
@ -281,8 +281,6 @@ if __name__ == '__main__':
report_server = config_reports(CONFIG, reportFactory)
# HBlink instance creation
# Run aprs_upload loop
aprs_upload(CONFIG)
logger.info('HBlink \'bridge_all.py\' -- SYSTEM STARTING...')
for system in CONFIG['SYSTEMS']:
if CONFIG['SYSTEMS'][system]['ENABLED']:

13
bridge_gps_data.py Normal file → Executable file
View File

@ -44,7 +44,7 @@ from twisted.protocols.basic import NetstringReceiver
from twisted.internet import reactor, task
# Things we import from the main hblink module
from hblink import HBSYSTEM, OPENBRIDGE, systems, hblink_handler, reportFactory, REPORT_OPCODES, mk_aliases, aprs_upload, sendAprs
from hblink import HBSYSTEM, OPENBRIDGE, systems, hblink_handler, reportFactory, REPORT_OPCODES, mk_aliases
from dmr_utils3.utils import bytes_3, int_id, get_alias
from dmr_utils3 import decode, bptc, const
import config
@ -184,7 +184,7 @@ def dashboard_loc_write(call, lat, lon, time, comment):
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 ' + bb_file).read())
@ -289,7 +289,8 @@ def user_setting_write(dmr_id, setting, value):
user_dict_file.close()
logger.info('User setting saved')
f.close()
packet_assembly = ''
packet_assembly = ''
# Process SMS, do something bases on message
def process_sms(_rf_src, sms):
@ -304,7 +305,7 @@ def process_sms(_rf_src, sms):
elif '@COM' in sms:
user_setting_write(int_id(_rf_src), re.sub(' .*|@','',sms), re.sub('@COM |@COM','',sms))
elif '@PIN' in sms:
user_setting_write(int_id(_rf_src), re.sub(' .*|@','',sms), int(re.sub('@PIN |@PIN','',sms)))
user_setting_write(int_id(_rf_src), re.sub(' .*|@','',sms), int(re.sub('@PIN |@PIN','',sms)))
# Write blank entry to cause APRS receive to look for packets for this station.
elif '@APRS' in sms:
user_setting_write(int_id(_rf_src), 'APRS', '')
@ -1826,8 +1827,6 @@ if __name__ == '__main__':
loc_file = CONFIG['GPS_DATA']['LOCATION_FILE']
the_mailbox_file = CONFIG['GPS_DATA']['MAILBOX_FILE']
emergency_sos_file = CONFIG['GPS_DATA']['EMERGENCY_SOS_FILE']
# User APRS settings
user_settings_file = CONFIG['GPS_DATA']['USER_SETTINGS_FILE']
# Check if user_settings (for APRS settings of users) exists. Creat it if not.
if Path(user_settings_file).is_file():
@ -1917,7 +1916,7 @@ if __name__ == '__main__':
systems[system] = routerHBP(system, CONFIG, report_server)
reactor.listenUDP(CONFIG['SYSTEMS'][system]['PORT'], systems[system], interface=CONFIG['SYSTEMS'][system]['IP'])
logger.debug('(GLOBAL) %s instance created: %s, %s', CONFIG['SYSTEMS'][system]['MODE'], system, systems[system])
aprs_upload(CONFIG)
#aprs_upload(CONFIG)
def loopingErrHandle(failure):
logger.error('(GLOBAL) STOPPING REACTOR TO AVOID MEMORY LEAK: Unhandled error in timed loop.\n %s', failure)

11
config.py Normal file → Executable file
View File

@ -106,7 +106,6 @@ def build_config(_config_file):
CONFIG['GLOBAL'] = {}
CONFIG['REPORTS'] = {}
CONFIG['LOGGER'] = {}
CONFIG['APRS'] = {}
CONFIG['GPS_DATA'] = {}
CONFIG['ALIASES'] = {}
CONFIG['SYSTEMS'] = {}
@ -184,15 +183,6 @@ def build_config(_config_file):
'STALE_TIME': config.getint(section, 'STALE_DAYS') * 86400,
})
elif section == 'APRS':
CONFIG['APRS'].update({
'ENABLED': config.getboolean(section, 'ENABLED'),
'CALLSIGN': config.get(section, 'CALLSIGN'),
'REPORT_INTERVAL': config.getint(section, 'REPORT_INTERVAL'),
'SERVER': config.get(section, 'SERVER'),
'MESSAGE': config.get(section, 'MESSAGE')
})
elif config.getboolean(section, 'ENABLED'):
if config.get(section, 'MODE') == 'PEER':
CONFIG['SYSTEMS'].update({section: {
@ -289,7 +279,6 @@ def build_config(_config_file):
CONFIG['SYSTEMS'].update({section: {
'MODE': config.get(section, 'MODE'),
'ENABLED': config.getboolean(section, 'ENABLED'),
'APRS': config.getboolean(section, 'APRS'),
'REPEAT': config.getboolean(section, 'REPEAT'),
'MAX_PEERS': config.getint(section, 'MAX_PEERS'),
'IP': gethostbyname(config.get(section, 'IP')),

View File

@ -151,6 +151,14 @@ EMAIL_PASSWORD: letmein
SMTP_SERVER: smtp.gmail.com
SMTP_PORT: 465
# The options below are required for operation of the dashboard and will cause errors in gps_data.py
# if configured wrong. Leave them as default unless you know what you are doing.
# If you do change, you must use absolute paths.
LOCATION_FILE: /tmp/gps_data_user_loc.txt
BULLETIN_BOARD_FILE: /tmp/gps_data_user_bb.txt
MAILBOX_FILE: /tmp/gps_data_user_mailbox.txt
EMERGENCY_SOS_FILE: /tmp/gps_data_user_sos.txt
# The following options are used for the dashboard. The dashboard is optional.
# Title of the Dashboard
DASHBOARD_TITLE: HBLink3 D-APRS Dashboard

View File

@ -1,9 +1,11 @@
# Various configurable options used in the GPS/Data application.
# SMS message that triggers command
cmd_list = {
'LS' : 'ls -lsh',
'COMMAND' : 'echo "command to execute"',
'UPTIME' : 'uptime'
}

16
hblink-SAMPLE.cfg Normal file → Executable file
View File

@ -46,19 +46,6 @@ SUB_ACL: DENY:1
TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
# APRS - BY IU7IGU
# Enabling "APRS" will configure APRS-Beaconing of Master's connection
# like repeater and hotspots.
# REPORT_INTERVAL in Minute (ALLOW only > 3 Minutes)
# CALLSIGN: Callsign that will pubblish data on aprs server
# MESSAGE: This message will print on APRS description together RX and TX Frequency
[APRS]
ENABLED: False
REPORT_INTERVAL: 15
CALLSIGN:HB1LNK-11
SERVER:euro.aprs2.net
MESSAGE:Connesso ad HBLINK
# NOT YET WORKING: NETWORK REPORTING CONFIGURATION
# Enabling "REPORT" will configure a socket-based reporting
@ -167,9 +154,6 @@ TGID_ACL: PERMIT:ALL
[MASTER-1]
MODE: MASTER
ENABLED: True
# The APRS setting below has to do with the beaconing of PEER conections, and not GPS positions
# from radios. This setting will not affect gps_data.py
APRS: False
REPEAT: True
MAX_PEERS: 10
EXPORT_AMBE: False

209
hblink.py
View File

@ -27,9 +27,6 @@ works stand-alone before troubleshooting any applications that use it. It has
sufficient logging to be used standalone as a troubleshooting application.
'''
# Added config option for APRS in the master config section. Will only send packets to APRS-IS if each master is enabled.
# Modified by KF7EEL - 10-15-2020
# Specifig functions from modules we need
from binascii import b2a_hex as ahex
from binascii import a2b_hex as bhex
@ -38,9 +35,6 @@ from hashlib import sha256, sha1
from hmac import new as hmac_new, compare_digest
from time import time
from collections import deque
import aprslib
import os
# Twisted is pretty important, so I keep it separate
from twisted.internet.protocol import DatagramProtocol, Factory, Protocol
@ -72,124 +66,6 @@ __email__ = 'n0mjs@me.com'
# Global variables used whether we are a module or __main__
systems = {}
open("nom_aprs","w").close
file_config=config.build_config('hblink.cfg')
#CONFIG = ''
def sendAprs():
AIS = aprslib.IS(str(file_config['APRS']['CALLSIGN']), passwd=aprslib.passcode(str(file_config['APRS']['CALLSIGN'])), host=str(file_config['APRS']['SERVER']), port=14580)
AIS.connect()
f = open('nom_aprs', 'r')
lines = f.readlines()
if lines:
for line in lines:
if line != ' ':
lat_verso = ''
lon_verso = ''
dati = line.split(":")
d1_c = int(float(dati[4]))
d2_c = int(float(dati[5]))
if d1_c < 0:
d1 = abs(d1_c)
dm1=abs(float(dati[4])) - d1
dm1_s= float(dm1) * 60
dm1_u="{:.4f}".format(dm1_s)
if int(str(dm1_s).split(".")[0]) < 10:
if d1 < 10 and d1 > -10:
lat_utile='0'+str(d1)+'0'+str(dm1_u)
else:
lat_utile = str(d1)+'0'+str(dm1_u)
else:
if d1 < 10 and d1 > -10:
lat_utile='0'+str(d1)+str(dm1_u)
else:
lat_utile = str(d1)+str(dm1_u)
lat_verso = 'S'
else:
d1 = int(float(dati[4]))
dm1=float(dati[4]) - d1
dm1_s= float(dm1) * 60
dm1_u="{:.4f}".format(dm1_s)
if int(str(dm1_s).split(".")[0]) < 10:
if int(str(dm1_s).split(".")[0]) < 10:
if d1 < 10 and d1 > -10:
lat_utile='0'+str(d1)+'0'+str(dm1_u)
else:
lat_utile = str(d1)+'0'+str(dm1_u)
else:
if d1 < 10 and d1 > -10:
lat_utile='0'+str(d1)+str(dm1_u)
else:
lat_utile = str(d1)+str(dm1_u)
lat_verso = 'N'
if d2_c < 0:
d2=abs(d2_c)
dm2=abs(float(dati[5])) - d2
dm2_s= float(dm2) * 60
dm2_u="{:.3f}".format(dm2_s)
if int(str(dm2_s).split(".")[0]) < 10:
if d2 < 10 and d2 > -10:
lon_utile = '00'+str(d2)+'0'+str(dm2_u)
elif d2 < 100:
lon_utile = '0'+str(d2)+'0'+str(dm2_u)
else:
lon_utile = str(d2)+'0'+str(dm2_s)
else:
if d2 < 10 and d2 > -10:
lon_utile = '00'+str(d2)+str(dm2_u)
elif d2 < 100:
lon_utile = '0'+str(d2)+str(dm2_u)
else:
lon_utile = str(d2)+str(dm2_u)
lon_verso = 'W'
else:
d2=int(float(dati[5]))
dm2=float(dati[5]) - d2
dm2_s= float(dm2) * 60
dm2_u="{:.3f}".format(dm2_s)
if int(str(dm2_s).split(".")[0]) < 10:
if d2 < 10 and d2 > -10:
lon_utile = '00'+str(d2)+'0'+str(dm2_u)
elif d2 < 100:
lon_utile = '0'+str(d2)+'0'+str(dm2_u)
else:
lon_utile = str(d2)+'0'+str(dm2_s)
else:
if d2 < 10 and d2 > -10:
lon_utile = '00'+str(d2)+str(dm2_u)
elif d2 < 100:
lon_utile = '0'+str(d2)+str(dm2_u)
else:
lon_utile = str(d2)+str(dm2_u)
lon_verso = 'E'
rx_utile = dati[2][0:3]+'.'+dati[2][3:]
tx_utile = dati[3][0:3]+'.'+dati[3][3:]
#AIS.sendall(str(dati[0])+">APRS,TCPIP*,qAC,"+str(file_config['APRS']['CALLSIGN'])+":!"+str(lat_utile)[:-2]+lat_verso+"/"+str(lon_utile)[:-1]+lon_verso+"r"+str(file_config['APRS']['MESSAGE'])+' RX: '+str(rx_utile)+' TX: '+str(tx_utile))
AIS.sendall(str(dati[0])+">APRS,TCPIP*,qAC,"+str(file_config['APRS']['CALLSIGN'])+":!"+str(lat_utile)[:7]+lat_verso+"/"+str(lon_utile)[:8]+lon_verso+"r"+str(file_config['APRS']['MESSAGE'])+' RX: '+str(rx_utile)[:8]+' TX: '+str(tx_utile)[:8]) # + ' CC: ' + str(_this_peer['COLORCODE']).decode('UTF-8'))
logging.info('APRS INVIATO/APRS Sent')
def aprs_upload(config):
if config['APRS']['ENABLED']:
if int(config['APRS']['REPORT_INTERVAL']) >= 10:
l=task.LoopingCall(sendAprs)
interval_time = int(int(config['APRS']['REPORT_INTERVAL'])*60)
l.start(interval_time)
else:
l=task.LoopingCall(sendAprs)
l.start(15*60)
logger.info('Report Time APRS to short')
# Timed loop used for reporting HBP status
def config_reports(_config, _factory):
def reporting_loop(_logger, _server):
@ -204,8 +80,8 @@ def config_reports(_config, _factory):
reporting = task.LoopingCall(reporting_loop, logger, report_server)
reporting.start(_config['REPORTS']['REPORT_INTERVAL'])
return report_server
return report_server
# Shut ourselves down gracefully by disconnecting from the masters and peers.
@ -228,7 +104,6 @@ def acl_check(_id, _acl):
# OPENBRIDGE CLASS
#************************************************
class OPENBRIDGE(DatagramProtocol):
def __init__(self, _name, _config, _report):
# Define a few shortcuts to make the rest of the class more readable
@ -237,9 +112,7 @@ class OPENBRIDGE(DatagramProtocol):
self._report = _report
self._config = self._CONFIG['SYSTEMS'][self._system]
self._laststrid = deque([], 20)
def dereg(self):
logger.info('(%s) is mode OPENBRIDGE. No De-Registration required, continuing shutdown', self._system)
@ -601,19 +474,8 @@ class HBSYSTEM(DatagramProtocol):
and self._peers[_peer_id]['SOCKADDR'] == _sockaddr:
logger.info('(%s) Peer is closing down: %s (%s)', self._system, self._peers[_peer_id]['CALLSIGN'], int_id(_peer_id))
self.transport.write(b''.join([MSTNAK, _peer_id]), _sockaddr)
if self._CONFIG['SYSTEMS'][self._system]['APRS']:
#if self._config['APRS_ENABLED'] == True:
fn = 'nom_aprs'
f = open(fn)
output = []
for line in f:
if not str(int_id(_peer_id)) in line:
output.append(line)
f.close()
f = open(fn, 'w')
f.writelines(output)
f.close()
del self._peers[_peer_id]
else:
_peer_id = _data[4:8] # Configure Command
if _peer_id in self._peers \
@ -640,48 +502,6 @@ class HBSYSTEM(DatagramProtocol):
self.send_peer(_peer_id, b''.join([RPTACK, _peer_id]))
logger.info('(%s) Peer %s (%s) has sent repeater configuration', self._system, _this_peer['CALLSIGN'], _this_peer['RADIO_ID'])
#APRS IMPLEMENTATION
conta = 0
lista_blocco=['ysf', 'xlx', 'nxdn', 'dstar', 'echolink','p25', 'svx', 'l1nk']
#if self._CONFIG['SYSTEMS']['APRS_ENABLED']['ENABLED'] and self._CONFIG['APRS']['ENABLED'] and not str(_this_peer['CALLSIGN'].decode('UTF-8')).replace(' ', '').isalpha() :
# Check if master has APRS enabled instead of global.
if self._CONFIG['SYSTEMS'][self._system]['APRS'] and not str(_this_peer['CALLSIGN'].decode('UTF-8')).replace(' ', '').isalpha() :
file = open("nom_aprs","r")
linee = file.readlines()
file.close()
for link in lista_blocco:
if int(str(_this_peer['CALLSIGN'].decode('UTF-8')).replace(' ', '').find(link.upper())) == 0:
conta = conta + 1
if len(linee) > 0:
logging.info('Leggo')
for linea in linee:
dati_l = linea.split(':')
if str(_this_peer['RADIO_ID']) == str(dati_l[1]):
conta = conta + 1
if conta == 0:
file=open("nom_aprs",'a')
if len(str(_this_peer['RADIO_ID'])) > 7:
id_pr=int(str(_this_peer['RADIO_ID'])[-2:])
callsign_u=str(_this_peer['CALLSIGN'].decode('UTF-8'))+"-"+str(id_pr)
file.write(callsign_u.replace(' ', '')+ ":"+ str(_this_peer['RADIO_ID']) +":"+ str(_this_peer['RX_FREQ'].decode('UTF-8')) + ":" + str(_this_peer['TX_FREQ'].decode('UTF-8'))+ ":" + str(_this_peer['LATITUDE'].decode('UTF-8')) + ":" + str(_this_peer['LONGITUDE'].decode('UTF-8')) + "\n")
file.close()
else:
file.write(str(_this_peer['CALLSIGN'].decode('UTF-8')).replace(' ', '')+ ":"+ str(_this_peer['RADIO_ID']) +":"+ str(_this_peer['RX_FREQ'].decode('UTF-8')) + ":" + str(_this_peer['TX_FREQ'].decode('UTF-8'))+ ":" + str(_this_peer['LATITUDE'].decode('UTF-8')) + ":" + str(_this_peer['LONGITUDE'].decode('UTF-8')) + "\n")
file.close()
else:
if conta == 0:
file=open("nom_aprs",'a')
if len(str(_this_peer['RADIO_ID'])) > 7:
id_pr=int(str(_this_peer['RADIO_ID'])[-2:])
callsign_u=str(_this_peer['CALLSIGN'].decode('UTF-8'))+"-"+str(id_pr)
file.write(callsign_u.replace(' ', '')+ ":"+ str(_this_peer['RADIO_ID']) +":"+ str(_this_peer['RX_FREQ'].decode('UTF-8')) + ":" + str(_this_peer['TX_FREQ'].decode('UTF-8'))+ ":" + str(_this_peer['LATITUDE'].decode('UTF-8')) + ":" + str(_this_peer['LONGITUDE'].decode('UTF-8')) + "\n")
file.close()
else:
file.write(str(_this_peer['CALLSIGN'].decode('UTF-8')).replace(' ', '')+ ":"+ str(_this_peer['RADIO_ID']) +":"+ str(_this_peer['RX_FREQ'].decode('UTF-8')) + ":" + str(_this_peer['TX_FREQ'].decode('UTF-8'))+ ":" + str(_this_peer['LATITUDE'].decode('UTF-8')) + ":" + str(_this_peer['LONGITUDE'].decode('UTF-8')) + "\n")
file.close()
else:
self.transport.write(b''.join([MSTNAK, _peer_id]), _sockaddr)
logger.warning('(%s) Peer info from Radio ID that has not logged in: %s', self._system, int_id(_peer_id))
@ -699,6 +519,18 @@ class HBSYSTEM(DatagramProtocol):
self.transport.write(b''.join([MSTNAK, _peer_id]), _sockaddr)
logger.warning('(%s) Ping from Radio ID that is not logged in: %s', self._system, int_id(_peer_id))
elif _command == RPTO:
_peer_id = _data[4:8]
if _peer_id in self._peers \
and self._peers[_peer_id]['CONNECTION'] == 'YES' \
and self._peers[_peer_id]['SOCKADDR'] == _sockaddr:
logger.info('(%s) Peer %s (%s) has send options: %s', self._system, self._peers[_peer_id]['CALLSIGN'], int_id(_peer_id), _data[8:])
self.transport.write(b''.join([RPTACK, _peer_id]), _sockaddr)
elif _command == DMRA:
_peer_id = _data[4:8]
logger.info('(%s) Recieved DMR Talker Alias from peer %s, subscriber %s', self._system, self._peers[_peer_id]['CALLSIGN'], int_id(_rf_src))
else:
logger.error('(%s) Unrecognized command. Raw HBP PDU: %s', self._system, ahex(_data))
@ -828,6 +660,7 @@ class HBSYSTEM(DatagramProtocol):
self._stats['CONNECTION'] = 'YES'
self._stats['CONNECTED'] = time()
logger.info('(%s) Connection to Master Completed', self._system)
# If we are an XLX, send the XLX module request here.
if self._config['MODE'] == 'XLXPEER':
self.send_xlxmaster(self._config['RADIO_ID'], int(4000), self._config['MASTER_SOCKADDR'])
@ -948,8 +781,6 @@ if __name__ == '__main__':
import sys
import os
import signal
import aprslib
import threading
# Change the current directory to the location of the application
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))
@ -971,12 +802,12 @@ if __name__ == '__main__':
if cli_args.LOG_LEVEL:
CONFIG['LOGGER']['LOG_LEVEL'] = cli_args.LOG_LEVEL
logger = log.config_logging(CONFIG['LOGGER'])
logger.info('APRS IMPLEMENTATION BY IU7IGU email: iu7igu@yahoo.com \n APRS per master config by KF7EEL - KF7EEL@qsl.net \n\nCopyright (c) 2013, 2014, 2015, 2016, 2018, 2019, 2020\n\tThe Regents of the K0USY Group. All rights reserved.')
logger.info('\n\nCopyright (c) 2013, 2014, 2015, 2016, 2018, 2019, 2020\n\tThe Regents of the K0USY Group. All rights reserved.\n')
logger.debug('(GLOBAL) Logging system started, anything from here on gets logged')
# Set up the signal handler
def sig_handler(_signal, _frame):
logger.info('(GLOBAL) SHUTDOWN: HBLINK IS TERMINATING WITH SIGNAL %s', str(_signal))
logger.info('(GLOBAL) SHUTDOWN: HBLINK IS TERMINATING WITH SIGNAL %s', str(_signal))
hblink_handler(_signal, _frame)
logger.info('(GLOBAL) SHUTDOWN: ALL SYSTEM HANDLERS EXECUTED - STOPPING REACTOR')
reactor.stop()
@ -995,8 +826,6 @@ if __name__ == '__main__':
logger.info('(REPORT) TCP Socket reporting not configured')
# HBlink instance creation
# Run aprs_upload loop
aprs_upload(CONFIG)
logger.info('(GLOBAL) HBlink \'HBlink.py\' -- SYSTEM STARTING...')
for system in CONFIG['SYSTEMS']:
if CONFIG['SYSTEMS'][system]['ENABLED']:
@ -1008,5 +837,3 @@ if __name__ == '__main__':
logger.debug('(GLOBAL) %s instance created: %s, %s', CONFIG['SYSTEMS'][system]['MODE'], system, systems[system])
reactor.run()

5
install.sh Normal file
View File

@ -0,0 +1,5 @@
#! /bin/bash
# Install the required support programs
apt-get install python3 python3-pip -y
pip3 install -r requirements.txt