Skip to content

Instantly share code, notes, and snippets.

@matbor
Last active February 24, 2019 10:31
Show Gist options
  • Select an option

  • Save matbor/12b2a7fdea16321a822d to your computer and use it in GitHub Desktop.

Select an option

Save matbor/12b2a7fdea16321a822d to your computer and use it in GitHub Desktop.
Scripts on using on my sdr-rtl pi for pager messages

Currently using the getpagermsg2mqtt_all.sh script, running on a pi with supervisord

#!/bin/bash
#just displays the current messages
mosquitto_sub -h localhost -t pager/messages/# -v
#!/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
#!/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
#!/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 &
#!/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
#!/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
#/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