From ae0f2c7cb1bcf51b2c061cfe691337b2a38c1b87 Mon Sep 17 00:00:00 2001 From: Stefan Seegel Date: Tue, 11 Feb 2020 21:58:28 +0100 Subject: [PATCH] refactoring --- apps/lacrossegw.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/lacrossegw.py b/apps/lacrossegw.py index 75371e5..7e7de0d 100755 --- a/apps/lacrossegw.py +++ b/apps/lacrossegw.py @@ -36,7 +36,7 @@ else: try: from influxdb import InfluxDBClient - influxClient = InfluxDBClient(host='localhost', port=8086, username='admin', password='admin') + influxClient = InfluxDBClient(host='localhost', port=8086, username='admin', password='raspberry') influxClient.switch_database("sensors") except: print("influx init error") @@ -71,9 +71,9 @@ class BaudChanger(threading.Thread): time.sleep(15) print "Change" if self.baud: - rfm.SetParams(Datarate = 9.579) + rfm.set_params(Datarate = 9.579) else: - rfm.SetParams(Datarate = 17.241) + rfm.set_params(Datarate = 17.241) self.baud = not self.baud baudChanger = BaudChanger() @@ -99,6 +99,7 @@ def writeInflux(payload): influxClient.write_points([wr]) +time.sleep(4) print "Waiting for sensors..." cache = {} while 1: