APRS Pi-Star Beacon
https://forum.pistar.uk/viewtopic.php?t=1724
https://nq4t.com/making-my-hotspots-beacon-aprs-is-w-real-time-connection-data/
(here explains a lot how it works)
Worth trying...
PS . See bellow another user has tried with another piece of code....
In order to utilize this script, you need to install the following on your hotspot:
The modified bm_links2.php file should reside in your /var/www/dashboard/mmdvmhost/ folder and renamed to drop the .txt file. You can copy/paste it in to shell to write it or use wget. If you don't use DMR you can skip this step. It currently only works for Brandmeister as that's pretty much all I use. I also don't really run YSF, P25, or NXDN; so I have no clue how difficult it'd be to add those. YSF can probably use the slightly modified DStar routine since it's one reflector at a time. Brandmeister is done this way since we can have multiple static and dynamic TGs. DStar reflector scraping has also been changed; swapping out the if statement and just pulling the entire field
I have not tested dynamic TGs yet..I'm going on the theory that they will also show up since the script largely just deletes all line-breaks and displays the content, removing the word "None" where Dynamic TGs show up if it's there.
You will need to modify the script with your Callsign/user, APRS-IS passcode, and your APRS object to match what you use. Actual piping to ncat is disabled by default, the output will display on the screen so you can make sure you're getting the expected output before going live. It should look something like this:
When the pipe to ncat is enabled and we send live data, the script will return with this:
Currently the script displays the overlaid car icon, it is hard-coded to do this. Changing it requires modifying the script in a couple of places. The first is where it extracts and parses the GPS coordinates.
By default this selects the alternative set of icons (\). If you want to change to the "standard" icons, you need to change the line to this:
The actual selection of icon is done by using the character immediately following the GPS information:
In this case, we send ">" which is the symbol for index 29. You can refer to this APRS Symbol chart for which table and which symbol you should use.
To go through the process each step (for those who are still confused):
First thing we do is we ask gpspipe to connect to our gpsd (in my case a Pi NTP server with GPS) and receive 8 lines of raw NEMA, then exit. At some point in those 8 lines we will have one $GPGGA sentence which contains our location and gps-sync status. We filter out the sentence of interest and stuff it in to a variable.
Now we take the data in the variable we just wrote, treat it like a CSV file, and read the "7th field". This "7th field" should be either 1 if we have GPS lock, or a 0 if we don't. We can have other numbers...but it's unlikely I'll have them without specifically goofing (like activating fakegps). If we have a 0 here, we just leave the script; there's no point in running the rest if GPS is gone.
If the data we did get was valid, we take the GPS coordinate information, drop the last two decimal places (it can't be that critical), then format it for insertion to our APRS packet. The selection of the standard or alternate icons takes place here in the form of the seperator between lat and long.
Now we scrape data for reflector or talkgroup information. In the case of D-Star, we're just going to read the repeaterstatus.php page, grep it for both spellings of "linked", strip the HTML out of that line, and change the capital L to a lowercase one. The case change just looks nicer (to me) since I append stuff in front. An overall case change wasn't desired as I do want REF/XRF/DCS to remain capitalized. With Brandmeister it's a little different. The modified php file basically just displays talkgroup information instead of the entire table. We read this file, remove all line breaks, change "TG" to "#", and remove the word "None" that appears if you have no dynamic TG's going. We also slip the entire comment in to it's variable.
From there we simply parse our dynamic information in with the pieces of the header that remain static and write that do a variable.
Last step is to parse the information we'll pipe through ncat, and pipe through ncat.
-------------------
http://sp2ong.noip.pl/pl/blog/hotspot-na-aprs-fi
https://nq4t.com/making-my-hotspots-beacon-aprs-is-w-real-time-connection-data/
(here explains a lot how it works)
Worth trying...
PS . See bellow another user has tried with another piece of code....
CODE: SELECT ALL
#!/bin/bash
# load nema sentence from GPS
gpsr=$(gpspipe -n 8 -r gpsdaddress:2947|sed -n '/$GPGGA/{p;q}')
#GPS Sync Check - if no GPS lock, no run
gpss=$(printf "$gpsr" | cut -d ',' -f7)
test "$gpss" = "0" && exit
#we didn't exit so we can continue
gps=$(printf "$gpsr" | cut -b 19-42|sed 's#N,#N\\#g'|sed 's#,##g'|cut -b 1-7,10-19,22)
#Define login info
user=URCALL
password=URPASS
#Define object user info
senduser=URCALL-SSID
#Define comment - DMR ONLY
# get DMR TG info, parse it, write it to file
#dmr=$(curl -s http://pi-stardmr.local/mmdvmhost/bm_links2.php| sed 's/<[^>]\+>//g' | sed 's/None//g' | sed ':a;N;$!ba;s/\n/ /g'|sed 's/TG/#/g')
#comment="BrandMeister TGs: $tg"
#Define data - DSTAR Only
dstar=$(curl -s http://pi-dstar.local/mmdvmhost/repeaterinfo.php | egrep "Linked|linked" | sed 's/<[^>]\+>//g' | sed 's/L/l/')
comment="DStar $dstar"
data="$senduser>APN100,TCPIP*:=$gps> $comment"
#Send data to the server
#By default the command to pipe output to ncat is disabled.
#only uncomment and merge the lines when you are sure your
#setup is working. Just delete the # and resulting line break,
#it should all be one line.
printf "%s\n" "user $user pass $password" "$data"
#| ncat rotate.aprs2.net 14580
- gpsd-clients
nmap
modified version of bm_links.php
The modified bm_links2.php file should reside in your /var/www/dashboard/mmdvmhost/ folder and renamed to drop the .txt file. You can copy/paste it in to shell to write it or use wget. If you don't use DMR you can skip this step. It currently only works for Brandmeister as that's pretty much all I use. I also don't really run YSF, P25, or NXDN; so I have no clue how difficult it'd be to add those. YSF can probably use the slightly modified DStar routine since it's one reflector at a time. Brandmeister is done this way since we can have multiple static and dynamic TGs. DStar reflector scraping has also been changed; swapping out the if statement and just pulling the entire field
I have not tested dynamic TGs yet..I'm going on the theory that they will also show up since the script largely just deletes all line-breaks and displays the content, removing the word "None" where Dynamic TGs show up if it's there.
You will need to modify the script with your Callsign/user, APRS-IS passcode, and your APRS object to match what you use. Actual piping to ncat is disabled by default, the output will display on the screen so you can make sure you're getting the expected output before going live. It should look something like this:
CODE: SELECT ALL
pi-star@pi-dstar(rw):~$ ./aprs.sh
user NQ4T pass ****
NQ4T-10>APN100,TCPIP*:=3843.64N\07725.96W> D-Star linked to: REF001 C
CODE: SELECT ALL
pi-star@pi-dstar(rw):~$ ./zzzzliveaprsdontrunzzz.sh
# aprsc 2.1.4-g408ed49
# logresp NQ4T verified, server T2IRELAND
CODE: SELECT ALL
gps=$(printf "$gpsr" | cut -b 19-42|sed 's#N,#N\\#g'|sed 's#,##g'|cut -b 1-7,10-19,22)
CODE: SELECT ALL
gps=$(printf "$gpsr" | cut -b 19-42|sed 's#N,#N/#g'|sed 's#,##g'|cut -b 1-7,10-19,22)
CODE: SELECT ALL
data="$senduser>APN100,TCPIP*:=$gps> $comment"
To go through the process each step (for those who are still confused):
First thing we do is we ask gpspipe to connect to our gpsd (in my case a Pi NTP server with GPS) and receive 8 lines of raw NEMA, then exit. At some point in those 8 lines we will have one $GPGGA sentence which contains our location and gps-sync status. We filter out the sentence of interest and stuff it in to a variable.
Now we take the data in the variable we just wrote, treat it like a CSV file, and read the "7th field". This "7th field" should be either 1 if we have GPS lock, or a 0 if we don't. We can have other numbers...but it's unlikely I'll have them without specifically goofing (like activating fakegps). If we have a 0 here, we just leave the script; there's no point in running the rest if GPS is gone.
If the data we did get was valid, we take the GPS coordinate information, drop the last two decimal places (it can't be that critical), then format it for insertion to our APRS packet. The selection of the standard or alternate icons takes place here in the form of the seperator between lat and long.
Now we scrape data for reflector or talkgroup information. In the case of D-Star, we're just going to read the repeaterstatus.php page, grep it for both spellings of "linked", strip the HTML out of that line, and change the capital L to a lowercase one. The case change just looks nicer (to me) since I append stuff in front. An overall case change wasn't desired as I do want REF/XRF/DCS to remain capitalized. With Brandmeister it's a little different. The modified php file basically just displays talkgroup information instead of the entire table. We read this file, remove all line breaks, change "TG" to "#", and remove the word "None" that appears if you have no dynamic TG's going. We also slip the entire comment in to it's variable.
From there we simply parse our dynamic information in with the pieces of the header that remain static and write that do a variable.
Last step is to parse the information we'll pipe through ncat, and pipe through ncat.
-------------------
http://sp2ong.noip.pl/pl/blog/hotspot-na-aprs-fi
Many people ask how to make our hotspot visible on the http://aprs.fi map. If our hotspot is configured only for DMR mode on PI-Star, there is no way to configure that such information about our hotspot appears on the aprs.fi map (unless we use DMRGateway and we have a connection to the XLX server, our data will appear on aprs.fi ).
The solution to this problem is to use a script that will send our items to APRS Server on PI-Star. The data that is shown on APRS.fi are taken from the Pi-Stra configuration from the / etc / mmdvmhost file, i.e. coordinates, frequency, color code, power. The power size of our hotspot can be set in Pi-Star: Configuration-> Expert-> MMDVMHost and in the " Info " section. It is important to enter the approximate coordinates of the location of our hotspot in the configuration of the hotspot select from the menu " Configuration " -> " Expert " -> " MMDVMHost " and the " Info " part enter the coordinates and height above sea level (Height):
We download scripts to send coordinates. After logging in via ssh on Pi-star:
rpi-rw
cd /tmp
sudo wget http://sp2ong.noip.pl/downloads/aprshotspot.tgz
sudo tar xvzfP aprshotspot.tgz
The scripts for sending data to aprs.fi will be placed in the / etc / aprs / directory. The main executable script is a file called ' aprshotspot ', the second file is used to send data and coordinate conversion to the format used in aprs.fi
The content of the information as shown can be adjusted individually, just edit the aprshotspot file :
sudo nano /etc/aprs/aprshotspot
and enter your own content of information on APRS instead of example:
$description="Pi-Star Hotspot DMR ";
The SSID number in our APRS mark is 10 by default but instead of 10 we can enter from 1 to 15. How to specify SSID for APRS other than 10 can be found here: http://www.aprs.pl/stacja.htm The SSID value is changed in the file doing edits:
sudo nano /etc/aprs/aprshotspot
and look for the SSID definition:
$ssid="10";
If we want the information on APRS to include information on which romantic groups on BM we are available on our hotspot, we can enable the options Note required generation of the BM key API: http://wiki.pistar.uk/PI-Star_integration_with_BrandMeister_API
$tglist="1";
Save the file using the key combination: CTRL + X and then the " Y " key
We can manually run the script by writing the command:
sudo /etc/aprs/aprshotspot
We can check on the map http://aprs.fi if our data appeared.
We can now add cyclical execution of our script with the command:
cd /etc
sudo nano crontab
and we add lines to the end of the file:
*/20 * * * * root /etc/aprs/aprshotspot > /dev/null 2>&1 &
and enter it as in the picture below in a red frame (instead of 20 min we can change how much our report should be sent):
save the file using the key combination CTRL + X and then the " Y " key
We are restarting the crontab service with the command:
sudo /etc/init.d/cron restart
and after 20 min we have the position of our hotspot on the map aprs.fi.
Attention. If you are using the YSFGateway hotspot configuration, disable the option to send data to APRS by setting Enable = 0 in the YSFGateway configuration for APRS. If you use DMRGateway, you cannot only send data to APRS.