Skip to content

Instantly share code, notes, and snippets.

@ChieftainY2k
Last active November 13, 2019 09:58
Show Gist options
  • Save ChieftainY2k/44c64c7b5af62776de2568193cb1dfb1 to your computer and use it in GitHub Desktop.
Save ChieftainY2k/44c64c7b5af62776de2568193cb1dfb1 to your computer and use it in GitHub Desktop.
RaspberryPi: Bash one-liner to read and log raw data from DS18B20 sensors into a file (every 10 seconts)
watch -n 10 "TIME=\$(date '+%Y-%m-%d %H:%M:%S'); READING=\$(cat /sys/bus/w1/devices/28*/w1_slave); echo \"\$TIME\\n\$READING\" | tee -a /var/tmp/thermo.log"
@ChieftainY2k
Copy link
Author

Follow the logs with tail -f /var/tmp/thermo.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment