text: from Adafruit_HTU21D import *
  import time
  import datetime
  from influxdb import InfluxDBClient
  import configparser
  
  # Read configuration
  config = configparser.ConfigParser()
  config.read('config.ini')
  
  # InfluxDB
  USER = config['influxdb']['user']
  PASSWORD = config['influxdb']['password']
  DBNAME = config['weather']['dbname']
  
  if __name__ == "__main__":
      while True:
  
          try:
              sensor = HTU21D()
              temperature = sensor.read_temperature()*1.8+32
  #            print('Temperature = {0:0.2f} F'.format(temperature))
              time.sleep(0.25)
              humidity = sensor.read_humidity()
  #            print('Humidity = {0:0.2f} %'.format(humidity))
              time.sleep(0.25)
  
              now = datetime.datetime.utcnow()
              datapoint = [
                  {
                      "measurement": "temperature",
                      "time": now.strftime('%Y-%m-%dT%H:%M:%S'),
                      "fields": {
                          "value": temperature,
                      },
                  },
                  {
                      "measurement": "humidity",
                      "time": now.strftime('%Y-%m-%dT%H:%M:%S'),
                      "fields": {
                          "value": humidity,
                      }
                  }
              ]
  
              client = InfluxDBClient('localhost', 8086, USER, PASSWORD, DBNAME)
              client.write_points(datapoint)
  
          except:
              pass
  