projects
/
rpi-ds18b20
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
881f4d1
)
check if we got temperature from kernel
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 Aug 2020 12:34:24 +0000
(14:34 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 26 Aug 2020 12:34:24 +0000
(14:34 +0200)
w1-ds18b20-influx.sh
patch
|
blob
|
history
diff --git
a/w1-ds18b20-influx.sh
b/w1-ds18b20-influx.sh
index
a3ba047
..
74e32bf
100755
(executable)
--- a/
w1-ds18b20-influx.sh
+++ b/
w1-ds18b20-influx.sh
@@
-7,7
+7,7
@@
influx=/dev/shm/temp.influx
ls /sys/bus/w1/devices/w1_bus_master*/*-*/w1_slave | while read path ; do
temp=$( cat $path | grep t= | cut -d= -f2 )
- if [ $temp -ne 85000 ] ; then # 85 is error
+ if [
! -z "$temp" -a
$temp -ne 85000 ] ; then # 85 is error
temp=$( echo $temp | awk '{ printf "%.3f\n", $1 / 1000 }' )
id=$( echo $path | cut -d/ -f 7 )
name=$( grep "^$id" id2name.txt | cut -d' ' -f2 )