Jump to content

Ausreißer bei Temperaturabfrage


mkett
[[Template core/global/global/poll is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Recommended Posts

Hallo,

ist jemand schon mal der Fehler unterlaufen, dass beim Abfragen von Temperatursensoren "merkwürdige" Ausreißer vorkommen?

 

Habe das Python Abfrageskript einfach kopiert:

 

#!/usr/bin/env python

# -*- coding: utf-8 -*- 

 

HOST = "localhost"

PORT = 4223

UID = "XYZ" # Change to your UID

 

from tinkerforge.ip_connection import IPConnection

from tinkerforge.bricklet_temperature import Temperature

 

# Callback function for temperature callback (parameter has unit °C/100)

def cb_temperature(temperature):

    print('Temperature: ' + str(temperature/100.0) + ' °C')

 

if __name__ == "__main__":

    ipcon = IPConnection() # Create IP connection

    t = Temperature(UID, ipcon) # Create device object

 

    ipcon.connect(HOST, PORT) # Connect to brickd

    # Don't use device before ipcon is connected

 

    # Set Period for temperature callback to 1s (1000ms)

    # Note: The callback is only called every second if the

    #      temperature has changed since the last call!

    t.set_temperature_callback_period(1000)

 

    # Register temperature callback to function cb_temperature

    t.register_callback(t.CALLBACK_TEMPERATURE, cb_temperature)

 

    raw_input('Press key to exit\n') # Use input() in Python 3

    ipcon.disconnect()

 

 

Wenn ich das laufen lasse kommen ab und zu Werte wie: -0,93 oder +120 Grad

und diese Werte können definitiv nicht vorkommen.

 

Hat jemand Hinweise oder eine Lösung?

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...