Currently using the getpagermsg2mqtt_all.sh script, running on a pi with supervisord
Last active
February 24, 2019 10:31
-
-
Save matbor/12b2a7fdea16321a822d to your computer and use it in GitHub Desktop.
Scripts on using on my sdr-rtl pi for pager messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #just displays the current messages | |
| mosquitto_sub -h localhost -t pager/messages/# -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # tails the csv file and publishes it to mqtt broker | |
| tail -f 148.904M.csv | grep --line-buffered -E '@@ALERT|UPWE' | mosquitto_pub -h localhost -l -r -t pager/messages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # tails the csv file and publishes it to mqtt broker if UPWE is found. | |
| tail -f 148.904M.csv | grep --line-buffered -E 'UPWE' | mosquitto_pub -h localhost -l -r -t pager/messages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # connects to the sdr-rtl at the below frequency and then creates a csv file with all the pager messages in it. | |
| pager_freq=( | |
| 148.904M | |
| ) | |
| echo "Frequency ${pager_freq[channel]}" | |
| sudo rtl_fm -g 100 -d 0 -s 22050 -f ${pager_freq[channel]} - | multimon-ng -q -f alpha -a POCSAG1200 -a POCSAG2400 -a POCSAG512 -t raw - >> ${pager_freq[channel]}.csv & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #connects to the sdr-rtl at the below frequency and publishes all the pager messages to the mqtt broker | |
| pager_freq=( | |
| 148.904M | |
| ) | |
| date | |
| echo "Frequency ${pager_freq[channel]}" | |
| sudo rtl_fm -g 100 -d 0 -s 22050 -f ${pager_freq} - | multimon-ng -q -f alpha -a POCSAG1200 -a POCSAG2400 -a POCSAG512 -t raw - | mosquitto_pub -h localhost -l -r -t pager/messages | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #connects to the sdr-rtl at the below frequency and publishes all the pager messages to the mqtt broker but filters them first based on the keywords | |
| pager_freq=( | |
| 148.904M | |
| ) | |
| # upwey = 570864 | |
| # redesdale = 560896 | |
| date | |
| echo "Frequency ${pager_freq[channel]}" | |
| sudo rtl_fm -g 100 -d 0 -s 22050 -f ${pager_freq} - | multimon-ng -q -f alpha -a POCSAG1200 -a POCSAG2400 -a POCSAG512 -t raw - | grep --line-buffered -E '570864|560896' | mosquitto_pub -h localhost -l -r -t pager/messages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/etc/supervisor/conf.d/sdr2mqtt.conf | |
| #supervisor config file | |
| [program:sdr2mqtt] | |
| command=/bin/bash /home/pi/scripts/getpagermsg2mqtt_all.sh | |
| stdout_logfile=/home/pi/logs/supervisor.getpagermsg2mqtt.log | |
| redirect_stderr=true | |
| stderr_logfile_maxbytes=10MB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment