• ds18b20

    From zeneca@3:770/3 to All on Sunday, April 10, 2022 11:38:10
    I have it running, but I wonder if there is somewhere a config file, a
    cron ..
    How does it run

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Andy Burns@3:770/3 to zeneca on Sunday, April 10, 2022 11:30:42
    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

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to Andy Burns on Sunday, April 10, 2022 14:43:24
    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



    --
    Chris Elvidge
    England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From zeneca@3:770/3 to All on Monday, April 11, 2022 10:31:44
    Le 10/04/22 à 15:43, Chris Elvidge a écrit :
    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



    I have it running!!!!!!!!!!
    My question is::::
    how does it work, config file, cron job ..
    I haven't found HOW it work.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to zeneca on Monday, April 11, 2022 10:08:54
    On 11/04/2022 09:31, zeneca wrote:
    Le 10/04/22 à 15:43, Chris Elvidge a écrit :
    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



    I have it running!!!!!!!!!!
    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.


    --
    Chris Elvidge
    England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From A. Dumas@3:770/3 to zeneca on Monday, April 11, 2022 09:41:52
    zeneca <pasIci@ailleur.fr> wrote:
    I have it running, but I wonder if there is somewhere a config file, a
    cron ..
    How does it run

    Well, how did you install it? There is no driver or service or daemon, it's just a gpio read-out (according to a certain protocol, that's what the
    Python library is for). If by running you mean it's logging the temperature somewhere, then you probably installed a Python program that now runs in
    the background. It might be started from /etc/rc.local or it might be
    installed as a service. We don't know. So how did you get it running?

    See https://bigl.es/ds18b20-temperature-sensor-with-python-raspberry-pi/ or https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overview

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to zeneca on Monday, April 11, 2022 12:18:58
    On 11/04/2022 11:22, zeneca wrote:
    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:
    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



    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 ?? ....

    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)
    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.


    --
    Chris Elvidge
    England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From zeneca@3:770/3 to All on Monday, April 11, 2022 12:22:12
    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:
    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



    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 ?? ....

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Martin Gregorie@3:770/3 to Chris Elvidge on Monday, April 11, 2022 12:18:29
    On Mon, 11 Apr 2022 10:08:54 +0100, Chris Elvidge wrote:

    HOW what works?

    I run the above as a background job, output recorded in a data file for further processing by gnuplot.

    Look it up! Get used to using the command line because using it is often
    faster than messing about with a web browser.

    'man' tells you about programs and functions, e.g. 'man sleep' run from
    the command line tells you about the 'sleep' command

    Don't know the name of the command you want? Use 'apropos' command:
    'apropos delay' tells you about things that cause delays, including
    'sleep'.

    Despite the title, consider about buying a copy of 'Linux for Dummies'.
    The '...for dummies' books are quite well regarded and less technical that O'Reilly books, which are really for sysadmins and developers.

    Also, you should learn how to ask technical questions. Just saying 'Wah!
    it doesn't work' is a good way to be ignored. Your post should say:

    - what you're trying to do and why

    - what you tried

    - what happened when you tried it.
    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.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From zeneca@3:770/3 to All on Monday, April 11, 2022 14:28:30
    Le 11/04/22 à 13:18, Chris Elvidge a écrit :
    On 11/04/2022 11:22, zeneca wrote:
    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:
    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



    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 ?? ....

    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.
    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)


    Your probe connects to a gpio pin (default 4 as I remember)
    You change the default pin in /boot/config.txt on the dtoverlay=w1-gpio
    line. Look it up.
    Doesn't give idea where to changes w1-gpio??

    Probe data is in millidegrees - you can't change that.


    Many thanks for you answer


    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to Andy Burns on Monday, April 11, 2022 13:25:32
    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

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to druck on Monday, April 11, 2022 13:38:50
    On 11/04/2022 13:25, druck wrote:
    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

    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


    --
    Chris Elvidge
    England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to zeneca on Monday, April 11, 2022 13:47:54
    On 11/04/2022 13:28, zeneca wrote:
    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)

    Did you look in your own crontab?

    /sys/bus/w1/devices/w1_bus_master1/28-0000034decc3/w1_slave and /sys/bus/w1/devices/w1_bus_master1/28-0000034decc3/temperature are
    updated constantly. There is one directory (28-nnnnnnnnnnnn) for each probe.

    What you mean is every five minutes w1_slave is read. You could also
    read temperature directly from the file 'temperature'.

    In your (undoubtedly python) program, is there a line such as
    time.sleep(600)? That's the delay between readings.


    --
    Chris Elvidge
    England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to Martin Gregorie on Monday, April 11, 2022 13:51:11
    On 11/04/2022 13:18, Martin Gregorie wrote:
    On Mon, 11 Apr 2022 10:08:54 +0100, Chris Elvidge wrote:

    HOW what works?

    I run the above as a background job, output recorded in a data file for
    further processing by gnuplot.

    Look it up! Get used to using the command line because using it is often faster than messing about with a web browser.


    / deleted /

    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.


    I think you replied to the wrong poster.


    --
    Chris Elvidge
    England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to Chris Elvidge on Monday, April 11, 2022 14:52:17
    On 11/04/2022 13:38, Chris Elvidge wrote:
    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

    No you don't _need_ python, but it saves faffing about extracting the
    CRC check (failures are common with long leads) and reformatting to
    degrees. If you are going to stick the value in database, this can be
    done in a couple of lines of python with the sqlite module.

    ---druck

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Martin Gregorie@3:770/3 to Chris Elvidge on Monday, April 11, 2022 14:07:10
    On Mon, 11 Apr 2022 13:51:11 +0100, Chris Elvidge wrote:

    On 11/04/2022 13:18, Martin Gregorie wrote:
    On Mon, 11 Apr 2022 10:08:54 +0100, Chris Elvidge wrote:

    HOW what works?

    I run the above as a background job, output recorded in a data file
    for further processing by gnuplot.

    Look it up! Get used to using the command line because using it is
    often faster than messing about with a web browser.


    / deleted /

    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.


    I think you replied to the wrong poster.

    Indeed. Apologies.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From John Aldridge@3:770/3 to All on Monday, April 11, 2022 22:00:19
    In article <t312ri$sd$1@dont-email.me>, chris@mshome.net says...
    Probe data is in millidegrees - you can't change that.

    The resolution is actually 1/16 degree, but reported to 3 decimal
    places.

    I think there is a similar higher resolution device (GX20MH01?), but I
    haven't tried it.

    --
    John

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From scott@alfter.diespammersdie.us@3:770/3 to zeneca on Tuesday, April 12, 2022 17:29:32
    zeneca <pasIci@ailleur.fr> wrote:
    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 ?? ....

    You might find this useful:

    http://www.catb.org/esr/faqs/smart-questions.html

    --
    _/_
    / v \ Scott Alfter (remove the obvious to send mail)
    (IIGS( https://alfter.us/ Top-posting!
    \_^_/ >What's the most annoying thing on Usenet?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From scott@alfter.diespammersdie.us@3:770/3 to Andy Burns on Tuesday, April 12, 2022 17:25:59
    Andy Burns <usenet@andyburns.uk> 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

    https://gitlab.com/salfter/pifridge

    This is some Python code that uses the kernel-space 1-Wire support to read a temperature sensor and control an addressable switch in response. 1-Wire devices connected to an appropriate interface are enumerated when the kernel boots and show up under /sys/bus/w1/devices.

    (Also related to this project: https://gitlab.com/salfter/rpi_i2c_1w, which brings 1-Wire, I2C, and power out to an RJ-45 connector. IIRC, it also adds
    an RTC.)

    --
    _/_
    / v \ Scott Alfter (remove the obvious to send mail)
    (IIGS( https://alfter.us/ Top-posting!
    \_^_/ >What's the most annoying thing on Usenet?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)