projects
/
rpi-ds18b20
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53a8274
)
show temperatures without sending data to influx
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 Aug 2020 10:19:21 +0000
(12:19 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 Aug 2020 10:19:21 +0000
(12:19 +0200)
w1-ds18b20.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/w1-ds18b20.sh
b/w1-ds18b20.sh
new file mode 100755
(executable)
index 0000000..
9ef9e62
--- /dev/null
+++ b/
w1-ds18b20.sh
@@ -0,0
+1,10
@@
+#!/bin/sh -e
+
+ls /sys/bus/w1/devices/w1_bus_master*/*-*/w1_slave | while read path ; do
+ temp=$( cat $path | grep t= | cut -d= -f2 | awk '{ printf "%.3f\n", $1 / 1000 }' )
+ if [ $temp != 85 ] ; then # 85 is error
+ id=$( echo $path | cut -d/ -f 7 )
+ echo -n "$id "
+ echo $temp | tee /dev/shm/ds18b20.$id
+ fi
+done