UnravelTEC / Raspi-Driver-DS18B20

Driver for reading ds18b20 onwire temperature sensors and outputting in prometheus scrape format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DS18B20

Software to read out DS18B20 sensor values over onewire on Raspberry Pi.

This software is licenced under GPLv3 by UnravelTEC OG (https://unraveltec.com), 2019.

Prerequisites

You might need to run the following commands as root e.g. by typing sudo before running a specific command.

Enable onewire interface

add dtoverlay=w1-gpio,gpiopin=4 to /boot/config.txt

Note: Standard pin is 4 - argument may be omitted then.

Wiring DS18B20 to Raspberry Pi

  • DS18B20: Signal -> Pi: pin 4 (or else) - and add a pullup resistor (e.g. 10K) between this pin and 3v3, or else it wont work!
  • DS18B20: VIN -> Pi: 3.3V (or any other gpio configured output,HIGH)
  • DS18B20: GND -> Pi: GND (use one of GND pinouts)

installing as a service

./install.sh

Two different drivers:

  • the (newer) python service publishes sensor data to local mqtt broker under the topic $hostname/sensors/DS18B20/temperature
  • the (older) shellscript service writes a file /run/sensors/ds18b20/last and updates it every second (which resides in RAM) - it is meant to be read out by prometheus.

About

Driver for reading ds18b20 onwire temperature sensors and outputting in prometheus scrape format

License:GNU General Public License v3.0


Languages

Language:Python 74.6%Language:Shell 25.4%