TRENDING NOW

About

Circuits.dk is a portal committed to providing helpful electronic circuits schematics and related electronic design information. I have studied carefully all appropriate internet resources and gathered together maximum of  interesting good quality electronic circuits, application notes, design help, and tutorials available. My single-purpose directory has been created specially for electronics developers, engineers,  students, and hobbyists worldwide (including myself) in order to help them find useful development solutions for their next and current project. In addition you will find circuits designed by me. You can suggest some featured information as well.
The person behind this web site is an electronic engineer with professional experience in electronics design since 1992. Speciality: analog electronics and switch mode power supplies.

Oslo, Norway 19.10.2008

Terje S.

Join the Discussion

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discussion

  1. Adrian S.

    My name is Adrian S. and I have very small feedback linked to this tutorial.
    50-raspberry-pi-linux-commands-and-utilities-youll-actually-use/

    A correction:
    dpkg –get-selections | grep XXX
    dpkg –get-selections

    A feedback:
    My CPU temperature is: temp=53.0’C
    My memory split between the CPU and GPU:
    arm=992M
    gpu=16M

    Thank you Terje!

  2. Birger Schacht

    Hello Terje ,

    i have build my own version of yor temperature logger:
    https://www.circuits.dk/temperature-logger-running-on-raspberry-pi/
    works great so far with 1 to 4 sensors (snum=1 to snum=4)
    Now my problem is, i want to add sensor no 5, and ive edited the .py-script at line 21 to match that 5 sensor setup (snum=5), and ive edited line 92 to add the datapoint for the sensor

    from
    “fields”: {“temperature 1″:temp[0],”temperature 2″:temp[1],”temperature 3″:temp[2],”temperature 4”:temp[3]}

    to
    “fields”: {“temperature 1″:temp[0],”temperature 2″:temp[1],”temperature 3″:temp[2],”temperature 4″:temp[3],”temperature 5”:temp[4]}

    but it is not working, the output is:

    root@raspberrypi:/home/pi# python templogger.py -db=temp_logger_db -sn=test1
    (‘Session: ‘, ‘test1’)
    (‘Run No: ‘, ‘202004261449’)
    (‘DB name: ‘, ‘temp_logger_db’)
    (‘/sys/bus/w1/devices/28-00000bdf14a5/w1_slave’, 0, 24.1)
    (‘/sys/bus/w1/devices/28-00000bded388/w1_slave’, 1, 27.6)
    (‘/sys/bus/w1/devices/28-00000bdeeb72/w1_slave’, 2, 33.5)
    (‘/sys/bus/w1/devices/28-00000be15ef1/w1_slave’, 3, 26.5)
    Traceback (most recent call last):
    File “templogger.py”, line 110, in
    datapoints=get_data_points()
    File “templogger.py”, line 81, in get_data_points
    temp[sensors] = read_temp(device_file)
    IndexError: list assignment index out of range

    the sensors are found:
    root@raspberrypi:/home/pi# ls /sys/bus/w1/devices
    28-00000bded388 28-00000bdeeb72 28-00000bdf14a5 28-00000be12694 28-00000be15ef1 w1_bus_master1

    can you help me, what am i missing to get the script and database working correctly?

    Thanks and greetings from germany
    Birger Schacht

  3. Lars

    can anyone explain the pyhton code part7. Temperature logger python code .It seems that there are no relevant explanations of the code..Ex:
    And the setup for influx database are not up to date??
    EX: from code??

    # add more sensor variables here based on your setup

    temp = [‘sensor code’, ‘tttttttttt’, ‘ddddddddddd’, ‘ssssssssss’]
    base_dir = ‘/ sys / bus / w1 / devices /’

    device_folders = glob.glob (base_dir + ’28 * ‘)

    snum = 4 #Number of connected temperature sensors

    # Set required InfluxDB parameters.
    # (this could be added to the program args instead of being hard coded …)
    host = “localhost” #Could also use local ip address like “192.168.1.136”
    port = 8086
    user = “root”
    password = “root”

Back to top