Read DS18B20 temperature-sensors on a 1-wire bus
- automatic sensor detection
- continuously refreshing temperature and status
- indicating current read pointer, timestamp, duration device id, temperature and connection-status
This script is running on a Raspberry Pi 3
This is optional.
The lower the resolution the faster the scan...
This is the simplest solution i have found, directly via linux shell.
cd /sys/bus/w1/devices/
sudo su
for dir in 28-*; do echo 10 > "$dir"/resolution; echo "$dir"; done
or
sudo su
for dir in /sys/bus/w1/devices/28-*; do echo 10 > "$dir"/resolution; echo "$dir"; done
cat 28-*/resolution
or
cat /sys/bus/w1/devices/28-*/resolution
cd /sys/bus/w1/devices/
sudo su
for dir in 28-*; do echo 10 > "$dir"/resolution; echo "$dir"; done
for dir in 28-*; do echo save > "$dir"/eeprom_cmd; echo "$dir"; done