Recently I have been working on building a rugged packet feed into OpenHAB via MQTT eventbus for several APRS packet radio appliances around my home and some weather sensor arrays that have APRS transmissions on the 2M band.
The work so far centers on a script in systemd to reliably pipe the output from a USB RTL-SDR dongle through Direwolf and into mosquitto_pub. I can catch around 30 minutes of packet information from the local repeaters but I cannot for the life of me get mosquitto_pub to remain stable.
rtl_fm -f 144.39M -g 75 - | direwolf -c /home/pi/sdr.conf -r 24000 -D 1 - | while read line
echo $line | /usr/bin/mosquitto_pub -h $MQTT_HOST -i APRS -l -t “/openhab/aprs”
echo $line >> /tmp/direwolf.log
Description=Direwolf Packet to MQTT publisher
ExecStartPre=-/bin/bash -c “rmmod dvb_usb_rtl28xxu rtl2832”
ExecStart=/bin/bash -c “/home/pi/dw-start2.sh”
Any thoughts or suggestions to help clean this up?