Giter Site home page Giter Site logo

theoretick / esp8266_prometheus_exporter_for_ds18b20_temperature_sensors Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 4.0 4 KB

ESP8266 (Espressif 8266) Prometheus Exporter for DS18B20 OneWire Temperature Sensors

C++ 100.00%
esp8266 esp8266-webserver espressif ds18b20 prometheus-exporter embedded

esp8266_prometheus_exporter_for_ds18b20_temperature_sensors's Introduction

ESP8266 (Espressif 8266) Prometheus Exporter for DS18B20 Temperature Sensors

Exposes a prometheus exporter endpoint endpoint for scraping DS18B20 temperature sensor readings.

Usage

  1. Configure ssid and password for wifi network within main.cpp
  2. Build library against 8266 platform
  3. hit /metrics endpoint for reading temperature (C), temperature (F), device resolution, and device count:
❯ curl 10.0.1.1/metrics

# HELP beertemp_device_total A count of probe devices connected.
# TYPE beertemp_device_total gauge
beertemp_device_total 1
# HELP beertemp_device_temperature_celsius Current device temperature in celsius.
# TYPE beertemp_device_temperature_celsius gauge
beertemp_device_temperature_celsius{id="28d1813592066618" resolution="12"} 22.69
# HELP beertemp_device_temperature_fahrenheit Current device temperature in fahrenheit.
# TYPE beertemp_device_temperature_fahrenheit gauge
beertemp_device_temperature_fahrenheit{id="28d1813592066618" resolution="12"} 72.84

esp8266_prometheus_exporter_for_ds18b20_temperature_sensors's People

Contributors

silverfisk avatar theoretick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

esp8266_prometheus_exporter_for_ds18b20_temperature_sensors's Issues

Negative temperature bug

Thanks for a nice project, this is exactly what I'm looking for!

However, when I measure the temperature in my freezer (-18 Celcius) I get some non standard characters in the output:

$ curl -s http://fridge_device/metrics
# HELP fridgetemp_device_total A count of probe devices connected.
# TYPE fridgetemp_device_total gauge
fridgetemp_device_total 1
# HELP fridgetemp_device_temperature_celsius Current device temperature in celsius.
# TYPE fridgetemp_device_temperature_celsius gauge
fridgetemp_device_temperature_celsius{id="2865ecb5050000e8" resolution="12"} -17.38ˉ�?͉�?���?ډ�?�������?
# HELP fridgetemp_device_temperature_fahrenheit Current device temperature in fahrenheit.
# TYPE fridgetemp_device_temperature_fahrenheit gauge
fridgetemp_device_temperature_fahrenheit{id="2865ecb5050000e8" resolution="12"} 0.73
$

I think it is better to convert it to a string instead of a character array? #2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.