Skip to content

Instantly share code, notes, and snippets.

@jacobtomlinson
jacobtomlinson / publish_temps.py
Created March 29, 2017 07:19
Send 1-wire temperature values from a Raspberry Pi to an MQTT broker
from __future__ import print_function
import os
import time
import paho.mqtt.client as mqtt
from paho.mqtt.client import MQTT_ERR_SUCCESS, MQTT_ERR_NO_CONN
DEVICES_PATH = "/sys/bus/w1/devices"