Skip to content

Instantly share code, notes, and snippets.

View d-ng's full-sized avatar

Daphne Ng d-ng

  • OSIsoft
  • Philadelphia, PA
View GitHub Profile
@d-ng
d-ng / WriteTemp.py
Created November 12, 2015 14:07
Gets data from a DS18B20 digital temperature sensor conntected to a Raspberry Pi and write to the PI System via PI Web API.
import requests
import time
import os
import glob
import re
base_url = 'https://<PI Web API server>/piwebapi'
webId = '<WebId to PI tag>'
base_dir = '/sys/bus/w1/devices/'
yes_pattern = re.compile(r'YES')