Skip to content

Instantly share code, notes, and snippets.

@errkk
Created April 20, 2015 16:07
Show Gist options
  • Save errkk/981b51761e7ac8f1541e to your computer and use it in GitHub Desktop.
Save errkk/981b51761e7ac8f1541e to your computer and use it in GitHub Desktop.
Print just the temperature from a DS18B20
# Print the number in degrees
awk -F'=' '/ t=/ { print $NF/1000 }' /sys/bus/w1/devices/$DEVICE_ID/w1_slave
# For Curling
curl $URL --data "value=$(awk -F'=' '/ t=/ { print $NF/1000 }' /sys/bus/w1/devices/$DEVICE_ID/w1_slave)" --compressed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment