projects
/
rpi-ds18b20
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4da3b33
)
support older 4.1 kernels without temperature in /sys/bus/w1
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 25 Aug 2020 18:19:54 +0000
(20:19 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 25 Aug 2020 18:19:54 +0000
(20:19 +0200)
w1-ds18b20-influx.sh
patch
|
blob
|
history
diff --git
a/w1-ds18b20-influx.sh
b/w1-ds18b20-influx.sh
index
1891cfe
..
8b96cdc
100755
(executable)
--- a/
w1-ds18b20-influx.sh
+++ b/
w1-ds18b20-influx.sh
@@
-5,8
+5,8
@@
influx=/dev/shm/temp.influx
:> $influx
-ls /sys/bus/w1/devices/w1_bus_master*/*-*/
temperatur
e | while read path ; do
- temp=$( cat $path | awk '{ printf "%.3f\n", $1 / 1000 }' )
+ls /sys/bus/w1/devices/w1_bus_master*/*-*/
w1_slav
e | while read path ; do
+ temp=$( cat $path |
grep t= | cut -d= -f2 |
awk '{ printf "%.3f\n", $1 / 1000 }' )
id=$( echo $path | cut -d/ -f 7 )
echo "ac_temp,dc=a125,sensor=$id temperature=$temp" >> $influx
echo $temp > /dev/shm/ds18b20.$id