Advertisement
metalx1000

Raspberry Pi GPS Radio Power Meter

Aug 4th, 2017
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.55 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. dir=/home/pi/output/
  4. mkdir -p "$dir"
  5.  
  6. output="${dir}$(date +%s)"
  7.  
  8.  
  9. rtl_power -f 314M:316M:1M -g 300 -i 1 |while read l
  10. do
  11.   echo "$(date +%s) - POWER - $l" >> "${output}_1"
  12. done &
  13.  
  14.  
  15. cat /dev/ttyS0|while read g
  16. do
  17.   echo "$(date +%s) - $g" >> "${output}_2"
  18. done &
  19.  
  20. echo "press enter to continue"
  21. read
  22.  
  23. killall rtl_power
  24. ps aux|grep ttyS0|awk '{print $2}'|while read pid
  25. do
  26.   kill $pid
  27. done
  28.  
  29. cat ${output}_1 ${output}_2 > ${output}_3
  30. sort ${output}_3 > ${output}
  31.  
  32. rm ${output}_*
  33.  
  34. echo "Thank you and have a nice day."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement