In [44]:
#make send fake temperatures to the server
import requestAPI
import random
from time import sleep
import datetime as dt
import math
In [45]:
#make connection object
connection = requestAPI.ECWConnection(host='https://ecollectweb.herokuapp.com')
In [ ]:
#send random data
delta = 0.25
hum = 60
temp = 60
press = 1000
x = 0
while True:
temp = math.sin(x)*20 + 70
res = connection.sendData(sensorId=1,datetime= dt.datetime.now(tz=requestAPI.utc),temp=temp,hum=hum,press=press)
print res
x += delta
sleep(2)
In [11]:
Out[11]:
In [28]:
Out[28]:
In [29]:
In [ ]: