from byteport.clients import ByteportHttpClient client = ByteportHttpClient('test', 'd8a26587463268f88fea6aec', 'barDev1') # NOTE: This will block the current thread! client.poll_directory_and_store_upon_content_change('/home/iot_user/measured_values/', 'barDev1', poll_interval=10)
print("Failed creating table: {}".format(err)) sys.exit(-1) # SensorList [SensorName, FileName, Temperature value (set default)] SensorList = [ 'OutTemp', '/mnt/1wire/28.571AB8010000/temperature', -99, 'InTemp', '/mnt/1wire/28.7EF3FE000000/temperature', -99 ] print(" -----------------------------------------------------") print(" %s " % ("Defined sensors")) print(" %-8s %s" % (SensorList[0], SensorList[1])) print(" %-8s %s" % (SensorList[3], SensorList[4])) print(" -----------------------------------------------------") print client = ByteportHttpClient(NAMESPACE, API_KEY, uid, initial_heartbeat=False) # print header for results table print(" Date | Sensor | Temperature") print(" -----------------------------------------------------") OutTemp = -99 InTemp = -99 #while True: now = time.strftime("%c") #Read time for sensor reading # Setup filenames etc. OutSensor = SensorList[0] OutFileName = SensorList[1] InSensor = SensorList[3] InFileName = SensorList[4]