I have it running, but I wonder if there is somewhere a config file, a cron ..
How does it run
zeneca wrote:
I have it running, but I wonder if there is somewhere a config file, a
cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect and
read your temperatue sensor(s) ... no doubt something already exists
that can run on a Pi
On 10/04/2022 11:30, Andy Burns wrote:
zeneca wrote:
I have it running, but I wonder if there is somewhere a config file,
a cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect and
read your temperatue sensor(s) ... no doubt something already exists
that can run on a Pi
Try this:
#!/bin/bash
# get a list (array) of all devices
shopt -s nullglob
devices=(/sys/bus/w1/devices/w1_bus_master1/28*)
[ ${#devices[@]} -eq 0 ] && {
printf 'No device files found. Investigate.'
exit 1
}
shopt -u nullglob
printf '%s\n' "${devices[@]}"
while true; do # repeat forever
unset temp # new array
for d in ${!devices[@]}; do # for each device
unset t # new temperature value
# at odd times we get -015 for reading; ignore it
while [[ ! "$t" || "$t" -lt 0 ]]; do
# getting temp can take a couple of seconds
t=$(<"${devices[d]}/temperature") # get reading
done
p="${devices[d]##*-}" # probe serial number
# reading is in millidegrees
t=$(bc <<<"scale=3; $t/1000")
temp+=("P-$p ${t}") # now degrees
done
printf '%(%Y-%m-%d %H:%M:%S)T ' # date and time
printf '%s %1.3f ' ${temp[@]} # probe data
printf '\n' # newline
sleep 10
done
Le 10/04/22 à 15:43, Chris Elvidge a écrit :
On 10/04/2022 11:30, Andy Burns wrote:I have it running!!!!!!!!!!
zeneca wrote:
I have it running, but I wonder if there is somewhere a config file,
a cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect and
read your temperatue sensor(s) ... no doubt something already exists
that can run on a Pi
Try this:
#!/bin/bash
# get a list (array) of all devices
shopt -s nullglob
devices=(/sys/bus/w1/devices/w1_bus_master1/28*)
[ ${#devices[@]} -eq 0 ] && {
printf 'No device files found. Investigate.'
exit 1
}
shopt -u nullglob
printf '%s\n' "${devices[@]}"
while true; do # repeat forever
unset temp # new array
for d in ${!devices[@]}; do # for each device
unset t # new temperature value
# at odd times we get -015 for reading; ignore it
while [[ ! "$t" || "$t" -lt 0 ]]; do
# getting temp can take a couple of seconds
t=$(<"${devices[d]}/temperature") # get reading
done
p="${devices[d]##*-}" # probe serial number
# reading is in millidegrees
t=$(bc <<<"scale=3; $t/1000")
temp+=("P-$p ${t}") # now degrees
done
printf '%(%Y-%m-%d %H:%M:%S)T ' # date and time
printf '%s %1.3f ' ${temp[@]} # probe data
printf '\n' # newline
sleep 10
done
My question is::::
how does it work, config file, cron job ..
I haven't found HOW it work.
I have it running, but I wonder if there is somewhere a config file, a
cron ..
How does it run
Le 11/04/22 à 10:31, zeneca a écrit :
Le 10/04/22 à 15:43, Chris Elvidge a écrit :
On 10/04/2022 11:30, Andy Burns wrote:I have it running!!!!!!!!!!
zeneca wrote:
I have it running, but I wonder if there is somewhere a config
file, a cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect
and read your temperatue sensor(s) ... no doubt something already
exists that can run on a Pi
Try this:
#!/bin/bash
# get a list (array) of all devices
shopt -s nullglob
devices=(/sys/bus/w1/devices/w1_bus_master1/28*)
[ ${#devices[@]} -eq 0 ] && {
printf 'No device files found. Investigate.'
exit 1
}
shopt -u nullglob
printf '%s\n' "${devices[@]}"
while true; do # repeat forever
unset temp # new array
for d in ${!devices[@]}; do # for each device
unset t # new temperature value
# at odd times we get -015 for reading; ignore it
while [[ ! "$t" || "$t" -lt 0 ]]; do
# getting temp can take a couple of seconds
t=$(<"${devices[d]}/temperature") # get reading
done
p="${devices[d]##*-}" # probe serial number
# reading is in millidegrees
t=$(bc <<<"scale=3; $t/1000")
temp+=("P-$p ${t}") # now degrees
done
printf '%(%Y-%m-%d %H:%M:%S)T ' # date and time
printf '%s %1.3f ' ${temp[@]} # probe data
printf '\n' # newline
sleep 10
done
My question is::::
how does it work, config file, cron job ..
I haven't found HOW it work.
It run every 5 minutes, how to modify this, it run from a gpio.?? how to change this?? how to change the precision ?? ....
Le 10/04/22 à 15:43, Chris Elvidge a écrit :
On 10/04/2022 11:30, Andy Burns wrote:I have it running!!!!!!!!!!
zeneca wrote:
I have it running, but I wonder if there is somewhere a config file,
a cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect and
read your temperatue sensor(s) ... no doubt something already exists
that can run on a Pi
Try this:
#!/bin/bash
# get a list (array) of all devices
shopt -s nullglob
devices=(/sys/bus/w1/devices/w1_bus_master1/28*)
[ ${#devices[@]} -eq 0 ] && {
printf 'No device files found. Investigate.'
exit 1
}
shopt -u nullglob
printf '%s\n' "${devices[@]}"
while true; do # repeat forever
unset temp # new array
for d in ${!devices[@]}; do # for each device
unset t # new temperature value
# at odd times we get -015 for reading; ignore it
while [[ ! "$t" || "$t" -lt 0 ]]; do
# getting temp can take a couple of seconds
t=$(<"${devices[d]}/temperature") # get reading
done
p="${devices[d]##*-}" # probe serial number
# reading is in millidegrees
t=$(bc <<<"scale=3; $t/1000")
temp+=("P-$p ${t}") # now degrees
done
printf '%(%Y-%m-%d %H:%M:%S)T ' # date and time
printf '%s %1.3f ' ${temp[@]} # probe data
printf '\n' # newline
sleep 10
done
My question is::::
how does it work, config file, cron job ..
I haven't found HOW it work.
HOW what works?
I run the above as a background job, output recorded in a data file for further processing by gnuplot.
On 11/04/2022 11:22, zeneca wrote:No entry found in all cron I found (etc/cron.d ....)
Le 11/04/22 à 10:31, zeneca a écrit :
Le 10/04/22 à 15:43, Chris Elvidge a écrit :
On 10/04/2022 11:30, Andy Burns wrote:I have it running!!!!!!!!!!
zeneca wrote:
I have it running, but I wonder if there is somewhere a config
file, a cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect
and read your temperatue sensor(s) ... no doubt something already
exists that can run on a Pi
Try this:
#!/bin/bash
# get a list (array) of all devices
shopt -s nullglob
devices=(/sys/bus/w1/devices/w1_bus_master1/28*)
[ ${#devices[@]} -eq 0 ] && {
printf 'No device files found. Investigate.'
exit 1
}
shopt -u nullglob
printf '%s\n' "${devices[@]}"
while true; do # repeat forever
unset temp # new array
for d in ${!devices[@]}; do # for each device
unset t # new temperature value
# at odd times we get -015 for reading; ignore it
while [[ ! "$t" || "$t" -lt 0 ]]; do
# getting temp can take a couple of seconds
t=$(<"${devices[d]}/temperature") # get reading >>>> done
p="${devices[d]##*-}" # probe serial number
# reading is in millidegrees
t=$(bc <<<"scale=3; $t/1000")
temp+=("P-$p ${t}") # now degrees
done
printf '%(%Y-%m-%d %H:%M:%S)T ' # date and time
printf '%s %1.3f ' ${temp[@]} # probe data
printf '\n' # newline >>>> sleep 10
done
My question is::::
how does it work, config file, cron job ..
I haven't found HOW it work.
It run every 5 minutes, how to modify this, it run from a gpio.?? how
to change this?? how to change the precision ?? ....
What runs every five minutes? And where did you get it from?
Look at your cron file (crontab -e) for the 5 minute interval time.
Your probe connects to a gpio pin (default 4 as I remember)Doesn't give idea where to changes w1-gpio??
You change the default pin in /boot/config.txt on the dtoverlay=w1-gpio
line. Look it up.
Probe data is in millidegrees - you can't change that.
zeneca wrote:
I have it running, but I wonder if there is somewhere a config file, a
cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect and
read your temperatue sensor(s) ... no doubt something already exists
that can run on a Pi
On 10/04/2022 11:30, Andy Burns wrote:
zeneca wrote:
I have it running, but I wonder if there is somewhere a config file,
a cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect and
read your temperatue sensor(s) ... no doubt something already exists
that can run on a Pi
The python w1thermsensor module is useful, it also includes a command
line program to scan for all ds18b20 devices.
---druck
No entry found in all cron I found (etc/cron.d ....)
every 5 minutes a read data from the ds18.. is iniiatted and data stored
in /sys/bus/w1/devices/w1_bus_master1/28-0000034decc3/w1_slave where I
can read temperature from.
My appli display temperature on a web page, store it in a rrdtools
database, display graphics
And temperature is alos displayed on a NOKIA-5110 display (writen in C)
On Mon, 11 Apr 2022 10:08:54 +0100, Chris Elvidge wrote:
HOW what works?Look it up! Get used to using the command line because using it is often faster than messing about with a web browser.
I run the above as a background job, output recorded in a data file for
further processing by gnuplot.
Include the command you ran and the 'whole' response to that command
by copying and pasting text from the screen. ALWAYS show what you see
on screen and NEVER paraphrase it.
- what you expected to happen.
On 11/04/2022 13:25, druck wrote:
On 10/04/2022 11:30, Andy Burns wrote:
zeneca wrote:The python w1thermsensor module is useful, it also includes a command
line program to scan for all ds18b20 devices.
---druck
You don't need python. Just list:
/sys/bus/w1/devices/w1_bus_master1/28-*
Current temperature (millidegrees) is in /sys/bus/w1/devices/w1_bus_master1/28-[serialnum]/temperature
On 11/04/2022 13:18, Martin Gregorie wrote:
On Mon, 11 Apr 2022 10:08:54 +0100, Chris Elvidge wrote:/ deleted /
HOW what works?Look it up! Get used to using the command line because using it is
I run the above as a background job, output recorded in a data file
for further processing by gnuplot.
often faster than messing about with a web browser.
Include the command you ran and the 'whole' response to that commandI think you replied to the wrong poster.
by copying and pasting text from the screen. ALWAYS show what you
see on screen and NEVER paraphrase it.
- what you expected to happen.
Probe data is in millidegrees - you can't change that.
Le 11/04/22 à 10:31, zeneca a écrit :
I have it running!!!!!!!!!!
My question is::::
how does it work, config file, cron job ..
I haven't found HOW it work.
It run every 5 minutes, how to modify this, it run from a gpio.?? how to change this?? how to change the precision ?? ....
zeneca wrote:
I have it running, but I wonder if there is somewhere a config file, a cron ..
How does it run
You have to have something that will scan your 1-wire bus, detect and read your
temperatue sensor(s) ... no doubt something already exists that can run on a Pi
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 371 |
Nodes: | 16 (2 / 14) |
Uptime: | 174:59:43 |
Calls: | 7,915 |
Files: | 12,983 |
Messages: | 5,797,724 |